Hi everyone,
I am trying to do the following and have this for 90% working but I need a little help for the final 10%.
I have a button (button-card) the calls via the tap_action a script.
tap_action:
action: call-service
service: script.sidebar_light
service_data:
entity_id: '[[[ return entity.entity_id ]]]'
The script is
sidebar_light:
mode: restart
sequence:
- service: light.toggle
data_template:
entity_id: '{{ entity_id }}'
- condition: template
value_template: "{{ trigger.entity_id.state == 'on' }}"
- service: input_select.select_option
data_template:
entity_id: input_select.sidebar_light
option: '{{ entity_id }}'
- delay: '10'
- service: input_select.select_option
data:
entity_id: input_select.sidebar_light
option: info
This setup works like I want it to (almost).
It toggles the light ON en sets the input_select correctly. This then changes a entities card on the HA Frontend via state-switch and shows me the brightness/temp/color controls for the toggled light. This then changes back to its default card after 10 seconds.
Now I can’t get the condition part working. Because I do not want to run the input_select.select_option part of the script when I turn OFF the light.
I’ve tried various ways to write the condition but none work.
Thanks in advance.
Mike