Notifications
Clear all
I/O Devices - Sensors - Modules
1
Posts
1
Users
0
Likes
1,354
Views
Topic starter
2021-03-13 9:35 pm
I'm using a PIR sensor with an ESP8266. I have an interrupt service routine for when the PIR's output changes (goes high or low). The ESP8266 publishes a message via MQTT to Home Assistant to set the state of a binary sensor. However, the sensors always shows as clear.
The MQTT configuration:
binary_sensor:
- platform: mqtt
unique_id: dining_room_motion
name: "Dining Room Motion"
json_attributes_topic: "home/diningroom/motion"
device_class: motion
payload_on: "on"
payload_off: "off"
json_attributes_template: "{{ value_json.state }}"
The JSON message I am sending to MQTT is:
{"state": "on"}
Any ideas why it's never being set in the dashboard?
Thanks