I want to change the brightness of my lamps depending on the time. My goal is to avoid the use of smart light switches. Is there a way where the light can generate an event in HA when it receives electricity, and HA would in turn set the brightness to the desired level.
Or is there another alternative method that you would recommend?
If so, their state will be reflected in HA when they are powered on - going from unknown to either on or off depending on their power on settings. That can be used as a tgrigger to set brightness.
You should bear in mind that they will be marked unavailable if the are powered off for more than about two hours. Better to leave them powered on permanently and use HA to turn them on and off and change their brightness.
Also, if you keep powering them off your zigbee network will be weakened substantially.
Thanks, for me the event only fires when the device is turned on using another event such as an automation via a smart switch or turning it on via software.
My goal is that my house still works even if my server is not running and the lights would turn on an off via a normal switch. So they would either get power or not get power. When the light receives power, unfortunately this event is not triggered for me. (I would be setting the brightness/color depending on the time of day)