Send mqtt message when motion is detected (#3152)

* Send mqtt message when motion is detected

* Use object processing instead of passing mqtt client around

* Cleanup

* Formatting

* add comment

* Make off delay configurable.

* Handle updating each camera based on config off delay

* Formatting

* Update docker-compose.yml

* Fix processing issue

* Update mqtt docs

* Update main config docs

* Make sure multiple True values aren't published for the same motion

* Make sure multiple True values aren't published for the same motion

* Update payload to fit existing HA standard values

* Update docs to fit new values

* Update docs

* Update motion topic

* Use datetime.datetime and remove unused imports

* Cast to int

* Clarify motion detector behavior in docs

* Fix typo

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
This commit is contained in:
Nicolas Mowen
2022-05-15 06:03:33 -06:00
committed by GitHub
parent 90bff605fa
commit de244d6873
4 changed files with 45 additions and 8 deletions

View File

@@ -134,6 +134,10 @@ class MotionConfig(FrigateBaseModel):
mask: Union[str, List[str]] = Field(
default="", title="Coordinates polygon for the motion mask."
)
mqtt_off_delay: int = Field(
default=30,
title="Delay for updating MQTT with no motion detected.",
)
class RuntimeMotionConfig(MotionConfig):