zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Getting current status of Tradfri bulb after Home Assistant restart

Open stratplayer opened this issue 8 years ago • 3 comments

I am still configuring my HA and having to restart many times, everytime I do so the Tradfri bulb I have connected in the lamp which is on before I restart HA shows up as off after I restart. The only way I can get it to appear in the correct state is to turn the switch on in HA where it then shows correctly. On a couple of other MQTT devices I set up an automation to ask for the status, I tried to do the same with this but it didnt work.

  • alias: "Ikea Lamp status after HA restart" trigger: platform: homeassistant event: start action:
    • service: mqtt.publish data: topic: "zigbee2mqtt/0x90fd9ffffe8c6523/set" payload: ""

stratplayer avatar Jul 29 '18 13:07 stratplayer

Might have to retain status in MQTT.

https://github.com/Koenkk/zigbee2mqtt/issues/139#issuecomment-399661976

Sent with GitHawk

ryanbeaton avatar Jul 29 '18 15:07 ryanbeaton

As @ryanbeaton mentioned, set retain: true for this device: https://github.com/Koenkk/zigbee2mqtt/wiki/Device-specific-configuration

Koenkk avatar Jul 29 '18 18:07 Koenkk

Hi thanks guys, sorry to have been such a numpty! Working fine now

stratplayer avatar Jul 29 '18 21:07 stratplayer