Hi,
I’m making a switch to control water irrigation so I would like to have it ON for set time then OFF.
I would like to use input_slider as input for “for” function in trigger as per below. Is it possible? How should I write it?
Please help. Thanks.
PS: I tried different way using template but it didn’t seem to work.
input_slider:
flower_timer:
name: Flower Timer
initial: 30
min: 0
max: 300
step: 10
automation:
- alias: Turn OFF when switch after set seconds
initial_state: True
hide_entity: True
trigger:
platform: state
entity_id: switch.flower
from: ‘off’
to: ‘on’
state: ‘on’
for:
seconds: "HERE IS WHERE I WANT TO USE INPUT FROM INPUT_SLIDER"
action:
service: homeassistant.turn_off
entity_id: switch.flower