What is the latest and cleanest way to trigger an automation for when a certain device becomes available?
Context, I live in a sh!thole 3rd world country where power outages are normal, and mosquitos are a thing so I have electrical mosquito repellents that are on smart switches.
If the power happens to be out when the normal automation runs (and they’re unavailable), I want to be sure that they turn on if they go from unavailable between hours of x and y.
This will probably also trigger after a restart, that may or may not be what you want. You might want to add a test using the uptime sensor if you dont.