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.
- Controls 4 independent water valves via relay outputs
- MQTT valve entities auto-discovered by Home Assistant (no manual HA configuration)
- Per-valve
open/closedstate reporting retained on the broker - Configurable watchdog timer (0–120 min) prevents valves from running indefinitely;
0disables 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
| 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 |
| 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.
- PlatformIO (CLI or VS Code extension)
- MQTT broker (e.g. Mosquitto) on your local network
- Home Assistant (optional, for GUI control)
cp include/Exampleprivate.h include/Private.hEdit include/Private.h and fill in:
secret_mqtt_server– your MQTT broker IP/hostnamesecret_mqtt_username/secret_mqtt_passwordsecret_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.his listed in.gitignoreand will never be committed.
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) |
# 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 monitorValve 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.
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.
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).
https://github.com/Genestealer/Home-Assistant-Configuration
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