Hi,
I want to add a feature that let me choose 2 values in HA (switch and time) and then start a timer to turn off the selected switch.
I’m stuck at the part of passing the selected switch to a “timer script”.
Here’s my script :
scripttimeroff:
sequence:
- delay: "00:{{ states('input_number.boxtimerlampesalon')| int }}:00"
- service: switch.turn_off
entity_id: "{{ states('input_select.listswitches') }}"
I have my input box :
boxtimerlampesalon:
name: Lampe salon timer 2 (minutes)
initial: 5
min: 1
max: 120
step: 1
mode: box
Here’s my input_select :
input_select:
listswitches:
name: List Switches
options:
- switch.sonoffsalon
- switch.tv_lg
For the “time” part, everything’s ok. My problem is with the switch name.
Trying to get the entity_id from the state of my switches list do not work.
Somebody have an idea how I can achieve my goal ?
My final goal is to have this working on my HADASBOARD wallpanel.