Rule 4 question certain hours

I'd like to have my basement lights shut off during certain hours if they were left on accidentally, how would I go about that with rule 4.0? Thanks.

Would something like the following work?

image

If any of the basement lights turns on, this will set a timer to turn them off after 10 minutes if the time is between 8 and 11 AM. If any of their states change, it will either cancel the 10 minute timer (if they all turn off) or re-start it (if some of them turn off while others remain on or one that wasn't on before turns on now).

Thanks for your help, that's what I'm looking for.

What is the first cancel delayed actions for? Is that even needed.

Yes. The second "Cancel Delayed Actions" only runs if all the lights turn off. If some of them turn on or off but others remain on, the first part of the "IF" will run again, and this is necessary to cancel the existing "timer" that would otherwise turn them all off (before creating a new timer to do the same, assuming nothing else again changes before then).

If you're only using one light/switch (or a group), then the rule could be simplified a bit and that part, among some other details, could be removed.