I could have given this topic a few names. What you see is not what you get would be another.
So the scenario
I have a couple of scenes
A turn everything I want "off at night" off.
A version of my turn on my morning alarm scene with a load of extra devices
The code for both at the end
They have been around for a long time and I use these to check my network is functioning after an upgrade. What I call my "stress test". The name is not because it is
I can relate to that.
I asked myself, long ago, what is the safest way to control a device? Then I saw some posts regarting the "dead" status of a device, and how to get out of that.
They detection of failure is the 'log' property, something you don't see often used on the forum!
This script works best if you have a mains operated device that you can power on and off.
I wanted to use that script in production, but I never did. At the moment, I can live with the