I would like som help with my watering system. when i turn on the switch “water 1” then i would like it to automaticly switch off after 1 hour. And i would also like to be able to turn it off if i somehow don´t want it to go the full time.
I now have 4 magnetic valves that i control via a Sonoff 4 pro that is included in my Home Assistant.
(in the best of worlds i would also like a slider so i could choose the length of time the sprinklers are on. but i know that it might be “overkill”)
alias: water_system_off_1h
description: Turn off switch water system after one hour
mode: single
trigger:
- platform: state
entity_id: switch.water_system
to: 'on'
for: '1:00:00'
condition: []
action:
- service: switch.turn_off
target:
entity_id: switch.water_system
About the slider, you can do it with a helper entity. First edit the script to take the value from the helper entity and assign it to the “for” entry in the script.
Once achieved, you only need to tunne it in the UI to be shown as a slider. See this topic
Is it possible to set to monitor multiple entities and tun off after 1 hour? I have created an automation as below. I have 12 zones and want to make sure that when the script is fired by automation that whatever happens no single zone will run for longer than 1 hour. Will this work?
Thanks in advance
alias: Sprinklers Off After 1 Hour
description: Turns off the Sprinklers if they have been left on for more than 1
hour
trigger:
- platform: state
entity_id:
- switch.irrigation_zone_1
- switch.irrigation_zone_2
- switch.irrigation_zone_3
- switch.irrigation_zone_4
- switch.irrigation_zone_5
- switch.irrigation_zone_6
- switch.irrigation_zone_7
- switch.irrigation_zone_8
- switch.irrigation_zone_9
- switch.irrigation_zone_10
- switch.irrigation_zone_11
- switch.irrigation_zone_12
attribute: 'on'
for:
hours: 1
minutes: 0
seconds: 0
condition: []
action:
- service: switch.turn_off
data: {}
target:
entity_id:
- switch.irrigation_zone_1
- switch.irrigation_zone_2
- switch.irrigation_zone_3
- switch.irrigation_zone_4
- switch.irrigation_zone_5
- switch.irrigation_zone_6
- switch.irrigation_zone_7
- switch.irrigation_zone_8
- switch.irrigation_zone_9
- switch.irrigation_zone_10
- switch.irrigation_zone_11
- switch.irrigation_zone_12
mode: single