Notifications
Clear all

Motion Binary sensor in Home Assistant always "clear"

1 Posts
1 Users
0 Likes
1,354 Views
(@yurkshirelad)
Member
Joined: 3 years ago
Posts: 493
Topic starter  

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

 


   
Quote