Hi there. This is my first week using Home Assistant so please be gentle with me. If I am posting in the wrong place or in the wrong format, apologies. I am sure there is an obvious answer to this, but I've been Googling for an hour and I'm about ready to give up and throw my Home Assistant Green off the balcony!!
I have some ThirdReality PIR sensors set up. Each is rigged with two automations: one to turn on the lights in a room once it starts detecting motion, and another to turn off the same lights once it stops detecting motion (with a delay in some cases). For rooms with one light, the action targets the light entity, and for rooms with multiple lights I have created light groups, so the light group is the target entity. The lights themselves are a mix of LIFX and Hue - I have a Sonoff Zigbee hub running the Hue bulbs.
The motion sensor/light automations have all worked perfectly up to now - lights come on when I enter a room, and turn off when I leave it.
So the problem is this:
I have also created a light group called "All The Lights", to toggle everything on or off at once. The problem is that if I toggle the "All the Lights" group to "On", the motion sensors don't turn the lights off afterwards in areas where there is no motion. I think by manually activating the lights, I'm accidentally creating a situation where the "lights off" automations never trigger, because there is no motion to "stop detecting".
So how do I fix this? All automations seem to require a trigger rather than a condition - that is, there is no option to say "If motion isn't currently being detected", only "If motion STOPS being detected". Have I set up my automation in a daft way? Am I misunderstanding how motion sensors work? How do I get this set up so that if I turn on all the lights, the system will just turn off anything in an empty room after the usual delay period has expired?