@ronny06 wrote:
Hello,
I need a binary sensor that tell the state of my sonoff switch if ON or OFF.
I create a following but in home assistant is always “unavailable”- platform: mqtt state_topic: "stat/sonoff4pro2/POWER1" name: "Tapparella_stato" availability_topic: "tele/sonoff4pro2/LWT" payload_on: ON payload_off: OFF value_template: "{{ value_json.state }}" device_class: "door"
The result of the sensor in the home assistant is “unavailable”
Perhaps there is something wrong in value_json and in the device_class.
Can someone help me?
Posts: 8
Participants: 2