Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Integrating with Home Assistant

Neil Enns edited this page Jun 9, 2020 · 4 revisions

Home Assistant is a handy place to collect information about the events happening in your world, including knowledge of when motion is detected by a camera.

MQTT binary sensors provide an easy way to get motion status into Home Assistant from the AI detection system. By default the AI detection system sends a payload that includes {"state": "on"} messages when motion starts and a {"state": "off"} payload 30 seconds after motion stops.

The MQTT binary sensor setup in Home Assistant should look something like this:

platform: mqtt
device_class: motion
name: "Front door motion"
state_topic: aimotion/triggers/FrontDoor
payload_on: "on"
payload_off: "off"
value_template: "{{value_json.state}}"

Simply replace the state_topic value with the topic specified in your triggers.conf file. The length of time required before the off status is reported can be configured with the offDelay property on the trigger configuration.

With sensors configured in Home Assistant you can now do things like show the motion history of a camera using the Lovelace History graph card or trigger HD camera recording using a NodeRed state_changed node.

Clone this wiki locally