Hello everyone! I am trying to create an automation to turn on a specific area of lights. I found an example on the forum, but I am not being able to get it to work.
I always get the message “ERROR (MainThread) [homeassistant.components.automation.automatic_lights_garden] Error while executing automation automation.automatic_lights_garden: Template rendered invalid service: light.turn_on” in the logs
I, try switch.turn_on service but with same result. And test it on Developer Tools and there works with the service light turn on. the group automatic lightsgarden exist and work if i turn on the switch on lovelace panel
Thanks in advance.
However, how about a random pattern in this automation.
I would like to switch of the members of the group with a random delay like this to simulate manual switching when going to bed
So, groups have changed significantly since the posts above. Still, when you turn off a group, how/when the individual entities in the group get turned off is kind of beyond your control. If you want to control the sequence and timing, you’ll have to write an automation and/or script to do so, at least as far as I know.
I have a similar automation, but it’s a bit more complicated than that. (E.g., it takes into account which lights are actually on, and simulates going to the “furthest” light, possibly turning lights on in the process, and then turning them off along a “path” to the bedroom, with random delays between all those steps.)
Anyway, possibly the simplest way to do what you want may be something like this:
That was a typo I fixed right after I posted the suggestion. Per the update of my post, it should be homeassistant.turn_off. I only used that service because I didn’t know if all the entities you wanted to turn off were of the same type (i.e., light.) If they are, then yeah, light.turn_off is probably better anyway.