hi,
I am having trouble using a mqtt light component:
this is my setup:
light:
- platform: mqtt
name: Licht Büro
command_topic: "hm/set/HM-LC-Sw1PBU-FM LEQ1234567:1/STATE"
state_topic: "hm/status/HM-LC-Sw1PBU-FM LEQ1234567:1/STATE"
payload_on: '{"val": true}'
payload_off: '{"val": false}'
state_value_template: '{{value_json.val}}'
this will send a message like:
hm/set/HM-LC-Sw1PBU-FM LEQ1234567:1/STATE {"val": true}
or
hm/set/HM-LC-Sw1PBU-FM LEQ1234567:1/STATE {"val": false}
(even though, the later cannot be send because if this issue)
which correctly switches on the light but the switch immediately toggles back to the off state, even though the lights are kept on
whenever the real switch is toggled, either by hand, through some remote or through home assistant, mqtt shows the state change like this:
hm/status/HM-LC-Sw1PBU-FM LEQ1234567:1/STATE {"val":true,"ts":1533586178971,"lc":1533585670207,"hm":{"ADDRESS":"LEQ1234567:1"}}
or
hm/status/HM-LC-Sw1PBU-FM LEQ1234567:1/STATE {"val":false,"ts":1533586178971,"lc":1533585670207,"hm":{"ADDRESS":"LEQ1234567:1"}}
when off
to verify the state read out I created a temporary binary sensor which displays the current state correctly:
binary_sensor:
- platform: mqtt
name: "Licht Status Büro"
state_topic: "hm/status/HM-LC-Sw1PBU-FM LEQ1234567:1/STATE"
device_class: light
value_template: '{{ value_json.val }}'
payload_on: true
payload_off: false
the binary sensor shows the state correctly but I am unable to apply this value to the light component
any ideas?