Dears
I’m trying to use turn off two switches after some time. The time comes from two sliders
This is my scripts.yaml file
timed_bagno:
alias: "set bagno timer"
sequence:
# Cancel ev. old timers
- service: script.turn_off
data:
entity_id: script.timer_off
# Set new timer
- service: script.turn_on
data:
entity_id: script.timer_off
timer_off:
alias: "turn off bagno"
sequence:
- delay: '00:{{ states.input_number.slider1.state | int }}:00'
- service: homeassistant.turn_off
entity_id: switch.luce_bagno
#timed_wc:
# alias: "set wc timer"
# sequence:
# # Cancel ev. old timers
# - service: script.turn_off
# data:
# entity_id: script.timer_off
# # Set new timer
# - service: script.turn_on
# data:
# entity_id: script.timer_off
#timer_off:
# alias: "turn off wc"
# sequence:
# - delay: '00:{{ states.input_number.slider2.state | int }}:00'
# - service: homeassistant.turn_off
# entity_id: switch.luce_wc
this is my automation.yaml file
#bagno time
- alias: bagno time
trigger:
platform: state
entity_id: switch.luce_bagno
to: 'on'
action:
service: homeassistant.turn_on
entity_id: script.timed_bagno
# toilette time
- alias: wc time
trigger:
platform: state
entity_id: switch.luce_wc
to: 'on'
action:
service: homeassistant.turn_on
entity_id: script.timed_wc
now, once I uncomment the part in the scripts.yaml file, the automation does not work anymore. Any hint?
thx