Standalone HomeKit-enabled irrigation system built using HAP-NodeJS.
Provides:
- Multi-zone irrigation control
- Water tank level monitoring (ultrasonic)
- Flow-based leak detection
- EveHome history support
- Built-in Web UI (HomeKitUI)
- No Homebridge required
This project includes a built-in web interface powered by HomeKitUI.
- Dashboard with live water tank levels
- Irrigation zone configuration
- Tank configuration
- System options
- Live log streaming
- HomeKit pairing management
http://:8582
Port is configurable via:
options.webUIPort
Displays:
- Water tank levels (percentage + litres)
- Tank capacity
- Last updated readings
Tank data is updated automatically from sensor events.
- Fully self-contained UI (no external frontend)
- Config changes require restart
- Log sources (priority):
- journald (systemd)
- log file (if configured)
- console (fallback)
Built with readily available off-the-shelf components, housed in a sealed ABS enclosure.
As the system is installed externally, mains wiring (240v → 24v transformer) is isolated in a separate enclosure.
- Raspberry Pi Zero W
- 24v AC transformer (Hunter irrigation)
- LM2596HV AC/DC step-down converter (5v output)
- JSN-SR04T waterproof ultrasonic sensor
- 8-channel solid-state relay board (high-level trigger)
- Water flow sensor (pulse output)
- Waterproof push-on/push-off LED switch
- Mains power cable
- Irrigation wiring
Defined in IrrigationSystem_config.json under tanks.
Example:
"tanks": [
{
"name": "Rainwater Tank",
"enabled": true,
"capacity": 5000,
"sensorTrigPin": 20,
"sensorEchoPin": 21,
"sensorHeight": 1970,
"minimumLevel": 200
}
]| Name | Description |
|---|---|
| name | Tank name |
| enabled | Enable/disable tank |
| capacity | Tank capacity (litres) |
| minimumLevel | Minimum measurable level (mm) |
| sensorEchoPin | GPIO echo pin |
| sensorTrigPin | GPIO trigger pin |
| sensorHeight | Sensor height above tank base (mm) |
| uuid | Auto-generated (DO NOT CHANGE) |
- Ultrasonic sensor measures water distance
- Readings are smoothed internally
- Percentage is calculated from:
- sensor height
- minimum usable level
- Dashboard displays:
- % full
- litres remaining
- last updated time
Defined in zones.
"zones": [
{
"name": "Back Lawn",
"enabled": true,
"runtime": 300,
"relayPin": 14
}
]| Name | Description |
|---|---|
| name | Zone name |
| enabled | Enable/disable zone |
| relayPin | GPIO relay control |
| runtime | Default runtime (seconds) |
| uuid | Auto-generated |
Defined under options.
| Name | Description | Default |
|---|---|---|
| debug | Enable debug logging | false |
| elevation | Height above sea level | 0 |
| eveHistory | Enable EveHome history | true |
| flowRate | Flow sensor rate (L/min @1Hz) | — |
| latitude | Location latitude | 0 |
| longitude | Location longitude | 0 |
| leakSensor | Enable leak sensor | false |
| powerSwitch | Virtual power switch | false |
| maxRuntime | Max zone runtime (seconds) | 7200 |
| sensorFlowPin | Flow sensor GPIO | — |
| waterLeakAlert | Trigger HomeKit alert | false |
| webUIPort | HomeKitUI port | 8581 |
Includes usonic_measure.c for sensor readings.
Requires:
sudo apt install wiringPi
Compile:
gcc -o dist/usonic_measure usonic_measure.c -l wiringPi
Sensor used:
- JSN-SR04T
- Min distance: ~200mm
- Max distance: ~4500mm
Exposes:
- IrrigationSystem service
- Valve services (zones)
- Optional:
- Leak sensor
- Power switch
Supports:
- Siri control
- EveHome advanced features
- History logging
This is a personal hobby project provided "as-is", with no warranty whatsoever, express or implied, including but not limited to warranties of merchantability or fitness for a particular purpose.
Building and running this project is done entirely at your own risk.
I am not affiliated with any companies such as Apple or other related entities. The author of this project shall not be held liable for any damages or issues arising from its use.
If you find this project useful, sponsorship to support ongoing development is always appreciated.