@wyx087 wrote:
Emulated Hue and Sleep Cycle app on a template switch to trigger morning routines as well as turning off the light when setting the app.
But I have an input_select that allows me to select the bedside light I’m using. (have toddler, so I regularly have to sleep in guest room).But the value_template doesn’t reflect my actual light status, which is changed by input_select.
Current value_template:
{{ is_state('light.master_bedroom_1', 'on'}}
Input_select that allows me to select which light I’ll be using:
{{states.input_select.w_bed_light.state}}
This returns pre-populated entity ID, such as “light.bedroom_2_light_bulb”. I then use this in my morning routine script and turn_off command action the selected light.
Putting latter into the former doesn’t work
This returns false:
{{ is_state("{{states.input_select.w_bed_light.state}}", 'on') }}
Without " it simply gives me errors.
Is there a special syntax to get the template to evaluate inner template first, then use output of that template to evaluate the whole statement?
Posts: 5
Participants: 2