I had this configuration working for a few months now and in the last few days for some reason the binary sensor doesn’t change state.
name: "Ulazna Vrata Zatvorena"
state_topic: "homeassistant/cmd/event/282"
device_class: door
value_template: "{{ 'OFF' if value_json.value == '1' else 'ON'}}"
The door does indicate open when i receive the mqtt message
Topic: homeassistant/cmd/event/282QoS: 0
{"value":0,"humanName":"[Ulazna Vrata][Ulazna Vrata Senzor][Closed]","unite":"","name":"Closed","type":"info","subtype":"binary"}
However 5 seconds later i get another message when the door is closed:
Topic: homeassistant/cmd/event/282QoS: 0
{"value":1,"humanName":"[Ulazna Vrata][Ulazna Vrata Senzor][Closed]","unite":"","name":"Closed","type":"info","subtype":"binary"}
But now the sensor doesn’t change it’s state. It has been working perfectly fine for months and now I’m perplexed why it gets stuck in the open state even though the second message arrives normally into MQTT.