For some of the automation that I have, I use the SmartRules app which allows me to have the following: If this happens:
Multipurpose Sensor Opens While any of things are true:
Kitchen Lights are on
TV is on Than do these:
Turn off kitchen lights
Turn off TV
Now the problem is that this is not always reliable because it does not always triggers the actions…
My question is, can I use something similar (simple as that one) in order have this While any of things are true option between conditions?
The custom automation tool wouldn’t work in this case. You can’t use a device as a condition and an action in the same automation with it. Unless something has changed.
The problem with Toggle, if I remember, is that it doesn’t check the state of the devices, it only remembers the state it stores, which can end up causing problems. (Though, that may not matter, considering the way the OP stated the problem.)
In that line of thinking, though. Create a virtual switch, and use a couple of Smart Lights rules to control the virtual switch (one for on, and one for off). The restrictions in Smart Lights do allow you to check the switch you’re controlling. Then, create another Smart Lights rule, and use the Mirror option in Smart Lights to control the TV and kitchen lights with that virtual switch. Just a thought.