Managing 'smart' bulbs and power failures

Does anyone have a good way to manage smart bulbs like the Ikea and Innu ones that turn on when power is restored.

On Phillips Hue bulbs this can be disabled in firmware but I’ve not been able to do this for the others so my house is ‘interesting’ after a power failure - and I get far too many of these!

I have a UPS on my HASS so it normally stays up during the power failures as most are short (less than 1 second to 5 minutes)

Is there a clever way to detect a power restore and switch them off - or even better restore them to their previous state please?

Does your ups tell the pi when power is off?

No, unfortunately. It is really just a big battery.

I have been thinking about perhaps setting up a ESP8266 using ESPHome so that it can detect power drops and restores - I’m fairly sure this won’t be too difficult.

If/when I get a signal for the power outages, how would I use it?

I am not sure exactly, but I think you would somehow save the state of all the light entities affected and when the power comes back on, wait some time (for them to all come back up) and turn them to the state they were previously. All via a couple of automations. Don’t ask me for the exact code.

Are these not running Tasmota or Esphome?

I assumed ikea and innu had proprietary firmware, but I may be wrong.

Thanks, all.

I have now built an ESP-01 to deliver power interruption and restore state via ESPHome so I’m getting the status. I’ll start researching code / automation options.

@DavidFW1960 - I have paired the Ikea bulbs to my Phillips Hue hub and manage them through that.

@nickrout - yes, both Ikea and Innu use proprietary firmware and I’ve not found a way to change the default power on behaviour of either unfortunately.