Hi all,
I have a remote raspberry pi that sends an MQTT message when the PIR detects movement - a python app on the raspberry does this with the following code…
publish.single(state_topic, "true", retain=False, hostname=broker)
On the homeassistant the sensor to receive is currently setup like this
- platform: mqtt
name: "Dayroom Movement"
state_topic: "dayroom/movement"
qos: 0
payload_on: "true"
payload_off: "false"
sensor_class: motion
So it’s kind of fine but not as I want as it just turns ON when movement is detected, then it stays ON in home assistant. I could set it OFF in python on the raspberry after a few seconds but that seems a bit wrong.
I envisage this working a bit like a ping, each time the PIR gets movement it pings HA and HA records that there was a movement event.
am i doing it wrong ? / any tips to do it better ?