I’m not sure if this is already done but here’s the scenario.
(Assuming you have an UPS on your HA)
There is a power outage, all lights and hue hub goes down, power is restored, now all lights are on, but you’re not home! So when you get home you find all your lights lit up.
If you can store the state of lights, you can monitor the hue hub going down, and based on that, assume there was a power outage, and as soon as it’s back online restore the lights state to the whole house (including turning off everything that was not before)
Let me know if you have address this scenario in a different way