Good day
Does anybody have an irrigation script for me to use and modify?
I would like my irrigation valve (connected to relay) to open 2 times a day at 06:00 and 13:00 every day of the week for 10 minutes.
If possible please also add code to prevent the valve from opening if an soil moisture sensor value is above value of 300.
Here is what I have in my scripts folder in a file called irrigation.yaml:
sequence:
- alias: Switch On Relay - Solenoid Valve Open
trigger:
- platform: numeric_state
entity_id: sensor.arduino_a0
below: 300
condition:
platform: time
# At least one of the following is required.
after: '06:00:00'
before: '20:00:00'
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
- sun
- alias: Relay On
service: homeassistant.turn_on
data:
entity_id: switch.irrigation_valve
- delay:
# supports seconds, milliseconds, minutes, hours, etc.
minutes: 10
- alias: Relay Off
service: homeassistant.turn_off
data:
entity_id: switch.irrigation_valve
- alias: Message Valve Closed
service: notify.pushbullet
data:
{"message:"Valve Closed"}
Kind regards,
Riaan