Rain Bird (LNK WiFi)
Driver: rainbird
Local control of Rain Bird irrigation controllers through the LNK WiFi module. GEM talks directly to the LNK module on the controller's LAN IP using the shared device password — all traffic is AES-encrypted and stays on the local network, with no Rain Bird cloud account in the middle. Supported controllers include the ESP-ME3, ESP-ME, ESP-TM2, ESP-RZXe, and other LNK-compatible models.
Use it to start and stop individual stations (valves), set per-run durations, kick off a controller program, read the controller's rain sensor for automation, and enable or disable stations in the controller's own programs.
One Rain Bird controller is one device in GEM. Each physical station — the valve wired to terminal 1, 2, 3, … — becomes its own zone, addressed by its station number. Unlike some other irrigation integrations, this driver does not auto-create those zones; you add one zone per station yourself (see Setup).
Prerequisites
- A Rain Bird controller with the LNK WiFi module installed and online on the same LAN the GEM controller can reach.
- The LNK device password — set in the Rain Bird mobile app under Advanced Settings → Password. This is the password GEM uses to connect, not your Rain Bird account login.
- Give the LNK module a static IP or a DHCP reservation. The integration addresses the controller by IP, so a moving lease takes it offline.
Setup
- Open Devices and add a new device. Pick the Rain Bird (LNK WiFi) driver.
- In Controller IP enter the LNK module's LAN IP (e.g.
192.168.1.50), and in LNK Password enter the device password from the Rain Bird app. The password is stored encrypted. - Enable the device. On connect the driver negotiates the controller model
and firmware and enumerates the available station numbers; the log shows the
detected
model,version, and station count. - Run the
get_infocommand on the device's Commands page to list the controller's available station numbers (it returnsmodel,version,serial, and thezonesarray of valid station numbers). - For each physical station, open Zones and add a zone:
- Select this Rain Bird device.
- The Subsystem is pre-selected to irrigation (an
irrigationsubsystem ships with GEM by default). Leave it there, or re-home as needed. - Set the zone address to the 1-based station number that matches the
physical valve wiring (
1,2,3, …) — the address field hint reminds you this is the Rain Bird station number.
- Assign the new zones to a UI as you would any other zone. The driver then polls the controller and keeps each zone's on/off state and time remaining current.
A zone's address must be the integer station number wired at the controller.
A zone whose address isn't one of the numbers returned by get_info is treated
as not connected and never updates. Run get_info to confirm the valid
numbers for your controller model.
Running stations vs. program enable/disable
There are two different ways the driver touches a station, and they are not the same thing:
- Manual run / stop —
on(orrun) starts the station watering for a duration;off(orstop) stops it. This is direct, immediate control of the valve. - Program enable / disable —
enableanddisablechange whether the station participates in the controller's programs. They do not turn the valve on or off right now. Use them to take a station out of (or back into) automatic programmed watering without rewiring or reprogramming the controller.
For ad-hoc manual watering, always use on/run and off/stop. Reserve
enable/disable for changing programmed participation.
Run duration
When you send on/run without a seconds argument, the driver uses a
default duration:
- the zone's own Default Run Duration (
default_run_seconds) if set, else - the device's Default Run Duration (
default_run_seconds, default 300 seconds).
Pass an explicit seconds argument to override both for a single run — e.g. a
macro step that runs station 3 for 600 seconds.
State and the rain sensor
While the device is enabled, the driver polls the controller (every Refresh Rate seconds) and writes back to each zone:
state—onwhile the station is watering,offotherwise.time_remaining— seconds left in the current run;0when idle.
At the device (controller) level it tracks one sensor reading for use as an automation trigger source:
rain_sensor—truewhen the controller's rain sensor is holding watering.
Point a trigger at the device's rain_sensor
attribute to, for example, suppress a scheduled run or send a notification when
rain is detected.
The LNK WiFi module accepts only one client session at a time. If the Rain Bird mobile app is connected at the same time as GEM, either side may see stale state. Keep the Refresh Rate at its default (15 s) or higher, and avoid hammering the controller from multiple apps at once. The driver also serializes station activations internally, so starting several stations at once queues them rather than interleaving.
Attributes
Set these in the Attribute editor for the device or zone; the labeled device/zone fields also appear in the device and zone forms.
Device
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
ip | string | yes | — | LAN IP of the LNK WiFi module. Shown as Controller IP. |
password | string | yes | — | LNK device password from the Rain Bird app. Shown as LNK Password; stored encrypted. |
refresh_rate | int | no | 15 | Refresh Rate (seconds) — how often the driver polls the controller for status. Minimum 5; keep at 15 or higher (single-session module). |
sync_time | bool | no | false | Sync Time — when on, sync the controller clock to GEM's clock at startup and hourly. |
default_run_seconds | int | no | 300 | Default Run Duration (seconds) — run length used when on/run is sent without a seconds argument. |
show_request_response | bool | no | false | Log Request/Response — verbose protocol logging; enable only for troubleshooting. |
rain_sensor | bool | — | — | Driver-written. true when the controller's rain sensor is holding watering. Usable as an automation trigger source. |
Zone
zone.address is the 1-based station number matching the physical valve
wiring. Driver-written state attributes:
| Attribute | Type | Description |
|---|---|---|
state | string | on while the station is watering, off otherwise. |
time_remaining | int | Seconds left in the current run; 0 when idle. |
You can also set one configurable attribute per zone (in the zone's Attributes editor or zone form):
| Attribute | Type | Default | Description |
|---|---|---|---|
default_run_seconds | int | falls back to the device's default_run_seconds (300) | Default Run Duration (seconds) — run length used when on/run is sent to this station without an explicit seconds argument. Overrides the device default for this zone only. |
Commands
These are the commands the driver declares and keeps current, so they appear
automatically on the device's Commands page and can be
tested there. The address argument resolves to the zone's station number.
| Command | Args | What it does |
|---|---|---|
on / run | address, optional seconds | Start the station watering for seconds (or the default run duration). |
off / stop | address | Stop the station. |
stopall | — | Stop all irrigation on the controller. |
enable | address | Include the station in the controller's programs (program participation, not an immediate on). |
disable | address | Exclude the station from the controller's programs. |
start_program | program | Start a controller program by its identifier. |
get_info | — | Return the controller model, version, serial, the valid station zones array, and whether the rain set point has been reached. |
refresh | — | Force an immediate status poll of the controller. |
The rows above are rewritten by the driver every time the system starts. Add your own commands if you need them, but don't hand-edit the templates or args of these — your changes are overwritten on the next restart.
Known limitations
- Single-session module. The LNK module serves one client at a time; running the Rain Bird app alongside GEM can produce stale readings on either side. Keep the refresh rate at 15 s or higher.
- Serialized activations. Station activations are queued one at a time, so starting several stations in quick succession does not interleave — they run in order.
- Older controllers. Some older models don't report live station state directly; the driver falls back to inferring state from the controller's program state automatically. Reported timing on those models is approximate.
- Controller turned off. If irrigation is switched off at the controller's front panel, stations never show active even though the connection is healthy — the controller simply won't run them.
Troubleshooting
| Symptom | Check |
|---|---|
Device never connects; log shows rainbird missing ip or rainbird missing password | The Controller IP (ip) and/or LNK Password (password) attribute is blank. Set both. |
| Connect fails with an auth error | The LNK Password doesn't match the module. Confirm it in the Rain Bird app under Advanced Settings → Password and re-enter it. |
| Zones never show active | Irrigation may be off at the controller's front panel — the controller won't run stations. Turn irrigation on, then send a manual run. |
| A zone never updates / shows disconnected | Its address isn't a valid station number for this controller. Run get_info to list the valid numbers and set the zone address to one of them. |
Manual run works but stations don't water on schedule | The station may be disabled from programs. Send enable for that station, and check the program setup on the controller. |
| State looks stale or laggy | Lower contention on the single-session module — close the Rain Bird app while GEM is connected — and confirm the Refresh Rate is at a sensible value (15 s default). |
Related documentation
- Devices — add the Rain Bird controller and set its IP and LNK password.
- Zones — add one irrigation zone per station, addressed by station number.
- Subsystems — the irrigation subsystem these zones live on.
- Commands — where
run/stop/start_program/get_infoappear and can be tested. - Triggers — use the device's
rain_sensorattribute as an automation trigger source. - Hunter Hydrawise — the other irrigation-controller integration in GEM.