During a recent update, I discovered a new component for ESPHome; Irrigation. Given that I had recently started working on an irrigation system, I was pleased to see this addition.
I have a couple of ESP8266’s already running on HA. A salt level detector and a garage door switch. I’d like to add the irrigation system. Based on my understanding of the irrigation integration, I’ve pieced together some code. It’s meant for a four valve control. No pump, just four valves. Would you mind having a look through it and advising of any issues?
---
esphome:
name: irrigation-south
esp8266:
board: esp01_1m
# WiFi connection, replace these with values for your WiFi.
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable logging
logger:
# Enable Home Assistant API
api:
# Enable over-the-air updates.
ota:
password: !secret ota_password
# Enable Web server.
web_server:
port: 80
# Sync time with Home Assistant.
time:
- platform: homeassistant
id: homeassistant_time
# Text sensors with general information.
text_sensor:
# Expose ESPHome version as sensor.
- platform: version
name: irrigation_south ESPHome Version
# Expose WiFi information as sensors.
- platform: wifi_info
ip_address:
name: irrigation_south IP
ssid:
name: irrigation_south SSID
bssid:
name: irrigation_south BSSID
# Exposed switches.
# Switch to restart the irrigation_south.
switch:
- platform: restart
name: "irrigation_south Restart"
# Enable On-Board Status LED.
status_led:
pin:
# Pin D4
number: GPIO2
inverted: true
sensor:
# Uptime sensor.
- platform: uptime
name: irrigation_south Uptime
# WiFi Signal sensor.
- platform: wifi_signal
name: irrigation_south WiFi Signal
update_interval: 60s
sprinkler:
- id: lawn_sprinkler_ctrlr
main_switch: "Lawn Sprinklers"
auto_advance_switch: "Lawn Sprinklers Auto Advance"
reverse_switch: "Lawn Sprinklers Reverse"
valve_open_delay: 5s
valves:
- valve_switch: "Front Lawn"
enable_switch: "Enable Front Lawn"
run_duration: 900s
valve_switch_id: sprinkler_valve_sw0
- valve_switch: "Front Garden"
enable_switch: "Enable Front Garden"
run_duration: 900s
valve_switch_id: sprinkler_valve_sw1
- valve_switch: "South Gaden"
enable_switch: "Enable South Garden"
run_duration: 900s
valve_switch_id: sprinkler_valve_sw2
- valve_switch: "Back Garden"
enable_switch: "Enable Back Garden"
run_duration: 900s
valve_switch_id: sprinkler_valve_sw3
switch:
- platform: gpio
id: sprinkler_valve_sw0
pin: 0
- platform: gpio
id: sprinkler_valve_sw1
pin: 2
- platform: gpio
id: sprinkler_valve_sw2
pin: 4
- platform: gpio
id: sprinkler_valve_sw3
pin: 14