There is an ST app that uses a ‘canary’ bulb.
This works by using a bulb that is always kept off.
If the power goes out and then it comes back on, the canary bulb will go to 100% the same as the rest.
The app knows if that bulb is on then there has been a loss/restore of power.
The app also checks every 5 mins and records the ‘state’ (i.e whether off or on) of each bulb
Once it detects a power loss/restore then it will reset the hulbs to the last state.
Here is the thread about the app, you just need to port it to Hubitat
Andy