Zigbee2MQTT - Remember last power state

Hi, I have 4 zigbee devices integrated in Z2M.


I am not yet very familiar with Z2M but I have a question.

When I turn off the 4 lights (via a group in HA) and then pull the power plugs, upon replugging the power the lights turn on to the latest setting - just before turned off via zigbee.

Is it possible to configure a zigbee device to “remember” last power state and if so how?

is that a device specific setting? e.g. should a hue lamp do this better?

If the light supports it, yes. But the device has to support it - if it does there’ll be a setting shown in Zigbee2MQTT for it under Exposes:

I have all of my Hue bulbs set to power_on_behavior: previous, but they still don’t retain their previous state after a power outage.

same issue here!

I have some Hue bulbs and they seem to retain previous setting when I tested but maybe not consistently. I will test them again later.

I have four Sengled BR30 bulbs in my office in a light group (was almost 1/3 price of Hue) and they always turn on after a power failure. What I did is make a toggle helper and automation that keeps in sync with the light group, and have automation that runs a check every 15 sec. (maybe that is overkill) to see if the lights need to be turned off based on toggle (which its state survives a system reboot) and shuts them off (if already off, it still executes that branch of automation, but doesn’t actually change the state again since they already off, and history of the entity does not show this - ie. does not fill up with a bunch of off in logbook). This is not perfect, but if power goes out in middle of night the lights will shut off at least. I originally had it do this on HA system startup, but I have it on a UPS so this won’t work during a brief brownout, which is why I also add time trigger.

Did any find a solution to this issue?
Every time I turn on my Philips hue light attached to Zigbee2mqtt its 100 % on, not previous state.