My problem is getting names of turned on lights to use it on the notify action. I’m trying to use the turned_on_lights variable to avoid repeting code for getting names but I have try several options but didn’t work.
What he said, mostly. Turn off all lights, they will all turn off. Use all as a thing in the entity field. Don’t need to enumerate them. If there are one or 2 you want to leave on, just turn those back on…
Yes, I want to learn how to use templating, but I don’t want to turn off all, I just want to take in consideration light groups.
For example I have shelly devices which are configured as dettached switches because I don’t want to turn electricity off…
Then configure your detached channels as switches and all lights as lights, then simply turn off all lights with light.turn_off
This will only turn off lights and leave all switches on.