diff --git a/README.md b/README.md index 32f55594..f3e2fa42 100644 --- a/README.md +++ b/README.md @@ -274,6 +274,7 @@ detectors: | frigate.url | | Base URL for Frigate | | frigate.attempts.latest | `10` | Amount of times API will request a Frigate `latest.jpg` for facial recognition | | frigate.attempts.snapshot | `0` | Amount of times API will request a Frigate `snapshot.jpg` for facial recognition | +| frigate.attempts.mqtt | `true` | Process Frigate images from `frigate/+/person/snapshot` topics | | frigate.image.height | `500` | Height of Frigate image passed for facial recognition | | frigate.cameras | | Only process images from specific cameras | | frigate.zones | | Only process images from specific zones | diff --git a/api/src/constants/defaults.js b/api/src/constants/defaults.js index 786d83f5..3d296517 100644 --- a/api/src/constants/defaults.js +++ b/api/src/constants/defaults.js @@ -16,7 +16,7 @@ module.exports = { }, time: { timezone: 'UTC' }, frigate: { - attempts: { latest: 10, snapshot: 0 }, + attempts: { latest: 10, snapshot: 0, mqtt: true }, image: { height: 500 }, }, purge: { diff --git a/api/src/util/mqtt.util.js b/api/src/util/mqtt.util.js index ae4313d5..831f0a29 100644 --- a/api/src/util/mqtt.util.js +++ b/api/src/util/mqtt.util.js @@ -113,11 +113,12 @@ module.exports.subscribe = () => { topics.push(...frigateTopics); frigateTopics.forEach((topic) => { const [prefix] = topic.split('/'); - topics.push( - ...(FRIGATE.CAMERAS - ? FRIGATE.CAMERAS.map((camera) => `${prefix}/${camera}/person/snapshot`) - : [`${prefix}/+/person/snapshot`]) - ); + if (FRIGATE.ATTEMPTS.MQTT === true) + topics.push( + ...(FRIGATE.CAMERAS + ? FRIGATE.CAMERAS.map((camera) => `${prefix}/${camera}/person/snapshot`) + : [`${prefix}/+/person/snapshot`]) + ); }); }