Skip to content

genestealer/Controllino-Irrigation

Repository files navigation

Controllino-Irrigation

PlatformIO CI Release License GitHub release (latest by date) PlatformIO

Ethernet-based irrigation controller running on a Controllino Maxi (ATmega 2560 + W5100). Controls up to four water solenoid valves via relay outputs with full Home Assistant integration through MQTT auto-discovery.


Features

  • Controls 4 independent water valves via relay outputs
  • MQTT valve entities auto-discovered by Home Assistant (no manual HA configuration)
  • Per-valve open/closed state reporting retained on the broker
  • Configurable watchdog timer (0–120 min) prevents valves from running indefinitely; 0 disables the timeout
  • NTP time-sync with a scheduled 7-day maintenance reboot (2–4 AM window)
  • Non-blocking MQTT reconnect with automatic Ethernet/reboot fallback
  • Ethernet DHCP with periodic Ethernet.maintain() calls

Hardware

Component Details
Controller Controllino Maxi – ATmega 2560 + W5100 Ethernet
Power 12 V PoE Active Splitter (IEEE 802.3af)
Valves 12 V Electric Solenoid Valves
Protection Vishay 1N4001 flyback diodes on each valve

Relay outputs

Screw terminal Valve
DIGITAL_OUT_11 Valve 1
DIGITAL_OUT_10 Valve 2
DIGITAL_OUT_09 Valve 3
DIGITAL_OUT_08 Valve 4

Relays can switch higher voltages or provide galvanic isolation if needed.


Getting started

1 – Prerequisites

  • PlatformIO (CLI or VS Code extension)
  • MQTT broker (e.g. Mosquitto) on your local network
  • Home Assistant (optional, for GUI control)

2 – Create your private configuration

cp include/Exampleprivate.h include/Private.h

Edit include/Private.h and fill in:

  • secret_mqtt_server – your MQTT broker IP/hostname
  • secret_mqtt_username / secret_mqtt_password
  • secret_byte – a unique MAC address for each controller
  • MQTT command and state topics for each valve
  • ntp_server – NTP server (default: pool.ntp.org)

Private.h is listed in .gitignore and will never be committed.

3 – Select your target controller

Two configurations are supported. Set IRRIGATION_CONTROLLER in platformio.ini (or use the named environments below):

Value Description
1 Front Garden
2 Back Garden (default)

4 – Build and upload

# Build for Back Garden (default)
pio run

# Build for Front Garden
pio run -e front_garden

# Build for Back Garden explicitly
pio run -e back_garden

# Upload to Front Garden controller
pio run -e front_garden -t upload

# Monitor serial output (115200 baud)
pio device monitor

MQTT topics

Valve command payloads follow the Home Assistant valve standard:

Direction Payload
Open valve OPEN
Close valve CLOSE
Valve open state open
Valve closed state closed

The watchdog duration (in minutes, range 0–120) is also exposed as a Home Assistant number entity on topic Home/Irrigation/Watchdog/Command. Set to 0 to disable the watchdog timeout.


CI/CD and Automation

The project includes GitHub Actions workflows for:

  • Build Pipeline – Builds firmware for all three environments on every push/PR
  • Release Pipeline – Builds and attaches firmware binaries to GitHub releases
  • Dependency Check – Weekly scan for outdated library versions

Firmware artifacts are available for download from the Actions tab.


Scheduled maintenance reboot

The firmware reboots once every 7 days during the 2–4 AM window (UTC). NTP is synced on boot via pool.ntp.org (configurable in Private.h).


Matching Home Assistant configuration

https://github.com/Genestealer/Home-Assistant-Configuration


Screenshots

Home Assistant main view

Home Assistant settings view


Bill of Materials


PlatformIO configuration summary

The platformio.ini follows PlatformIO best practices:

  • Global [platformio] section for project-level settings
  • [common] section for shared flags and dependencies (DRY principle)
  • Version-pinned library dependencies for reproducible builds
  • Three named environments: controllino_maxi, front_garden, back_garden
  • Compiler warnings enabled (-Wall -Wextra)

Based on the earlier ESP8266 variant: https://github.com/genestealer/Irrigation-Controller

About

Dual Channel Irrigation controller using Controllino (Arduino Mega + W5100 ethernet), MQTT and Home Assistant - Arduino platformIO

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors