I've looked at the 'similar topics', the CookBook and other searches but none seem to fit my example.
I have an ESPHome device that only comes online every 30 minutes - it is in a deep sleep the rest of the time to save battery. I have defined a 'switch' in the HA interface that is read by the device when it comes on line to stop it from going to sleep so that I can do things such as a firmware update.
However as there can be a considerable time between clicking the switch and the device coming online (long enough for me to be distracted!!!) and several times the battery has run down before I've got around to doing the update.
I already have an automation that is triggered when a new ESPHome firmware update is installed and that will update all of the online ESPHome devices - except for this one.
What I'm looking for is a trigger that will fire when the device comes online (with a later condition that there is an update ready to be installed) so as to perform the action of toggling the 'switch' to stop the device going back to sleep, performing the update and then toggling the switch again.
However I don't seem to find the correct thing to act as the trigger for the automation. (I stupidly tried the Google AI that came up when I did a search for answered, but it just produced the usual slop that was totally wrong.)
Perhaps whatever ESPHome uses to say if a device is 'Offline' of 'Online' in the 'ESPHome Builder' page....
Thanks
Susan
