I have an input_select with following options:
Daylight, Warm, Relax, Night
For each room, I have a series of scripts
Living_warm, living_relax, dining_warm, dining relax etc.
which set a number of lights to the relevant setting
Now i am trying to have one automation which calls the relevant script based on the option set in the input_select
Here is my code, but I am not getting the right values in the call.
Because scripts are services. There is a caveat with calling a script like that though: Scripts - Home Assistant
Doing it with the service template will wait for the script to complete before moving to the next action (if there is one). Doing it with script.turn_on will run the script and the next action in parallel.
The automation is triggered by input_select.cycle_living_lights. That means its state is available in the action via the Trigger State Object. The template doesn’t have to request the input_select’s state but can simply get it via trigger.to_state.state like this: