Hi guys!
I’m trying to configure my light via MQTT.
If have command topic: “/h_room_sw-2/cmd”
To turn light On I’ve to send “GPIO,5,1” payload
To turn light Off I’ve to send “GPIO,5,0” payload
State I can get through “/h_room_sw-2/R1/State” topic.
And when light is On I get “1” and “0” when light is off.
I made the following configuration:
light:
- platform: mqtt
name: "hall_light_add"
command_topic: "/h_room_sw-2/cmd"
state_topic: "/h_room_sw-2/R1/State"
state_value_template: "{{'GPIO,5,1' if value == 1 else 'GPIO,5,0'}}"
payload_on: 'GPIO,5,1'
payload_off: 'GPIO,5,0'
qos: 0
optimistic: false
And can succesfully turn light on, but in few seconds controll turns to off, but in state topic I can see the “1”.
I tried different configuration, but did not understand, how to get right state of the control.
Hope for help!
Valera