A group of lights where turn on and turn off do different things

Hi,

I want to create a grip of lights (downstairs) where turn on and turn off change a different set of lights specifically when using Alexa.

The idea is this our downstairs consists of a few rooms with lots of lights. Some are used all the time and some only rarely. I want to create config so that when I come downstairs in the morning I ask Alexa to “turn on the downstairs lights” and the lights we use normally should come on.

However when I go to bed at night I want to ask Alexa to “turn off the downstairs lights” and if I’m turning them off this way I want literally any light that is on to turn off.

Any ideas on a neat way to do this?

Make “downstairs lights” in input_boolean and attach two automations that watch for it going to on and going to off.

Thanks - will that only work if we always turn it on/off via the binary sensor? I.e. if the binary sensor is OFF and we still ask to turn it off will that work?

It’s an input Boolean not a binary sensor.

But yes, if IB is already off and you want to re-run the “off” actions, then it won’t work. You’d have to turn it on then back off.