Switching build¶
On this page: what the switching build may switch, the rules that always apply, how requests are prioritised, the interlocks per function, behaviour on failures, the hardware it requires, and how outputs are configured.
Not yet released for real pools
The switching build is built and its logic is tested on the host. The hardware-in-the-loop tests and a 7-day endurance test without unrequested switching must pass before it is used at a real pool.
Mains work only by a licensed electrician
Any work on mains voltage (230/400 V), on the supply of pumps, heaters, heat pumps and lighting, on contactors and interposing relays switching those loads, and on earthing and equipotential bonding of the pool installation must be done by a licensed electrician under local regulations (for example NEN 1010 in the Netherlands, IEC 60364 generally). See Electrical installation and safety.
What must never happen¶
- An output turns on without a request, not even briefly at start-up.
- A request from the cloud does something that was not set up or allowed on site.
- An interlock is relaxed remotely. Limits in the firmware are the maximum; settings can only make them stricter.
- Two outputs of one exclusion group (pump speeds) are on at the same time, not even during a change.
- A failure (I2C, settings, clock, network, crash) leaves an output on that would otherwise be off.
When in doubt: off. Off is the safe state for every function in this build. Functions for which off is not safe (moving a pool cover, dosing) are deliberately not included.
Functions¶
Each DO is unassigned, and therefore always off, until it gets a function on site. Functions and channels can never be changed through the cloud.
| Function | Class | Channels | Notes |
|---|---|---|---|
pump_speed |
B | 1 to 3, one group | Speeds 1, 2, 3 of a variable-speed pump with digital inputs; the group is mutually exclusive |
pump_run |
B | 1 | Pump without speeds (on/off through a contactor) |
backwash |
B | 1 | Backwash valve |
heat_enable |
B | 1 | Enable signal for heat pump or heater |
fill |
B | 1 | Refill valve |
light |
A | 1 | |
aux |
A | 1 | Free name, class A rules only |
Inputs get a function on site too: level_low, level_fill, level_high (level floats), flow,
pump_feedback (auxiliary contact of pump or contactor), button (local control per output) and cover
(read only). Prefer NC contacts for level_low and flow, so a broken wire reads as an alarm.
Request priorities¶
A request is (output or function, state, source, expiry). Highest priority first:
| Priority | Source | May | Expires |
|---|---|---|---|
| 1 | Interlock | Only off (forces off) | When the condition is gone, after its recovery time |
| 2 | Local (button on a DI, setup on site) | On and off | Button: next press or the maximum on-time |
| 3 | Schedule on the box | On and off | End of the time slot |
| 4 | Cloud (set_output) |
On only with "changes from the cloud" enabled; off always | for_s, default and at most the function's maximum on-time |
- Interlocks always win.
- Network lost: local and schedule continue; cloud requests expire on time and are not extended.
- After a restart (power, crash, update) no request returns except the schedule. Light stays off; backwash and refill are not resumed.
- Schedules only run with a valid clock. They follow wall-clock time in the box's time zone: a slot in the hour that does not exist at the spring clock change does not run that night; a slot in the hour that occurs twice in autumn runs twice.
Interlocks per function¶
Values are default / hard limit in the firmware. Settings may choose between the two, never beyond the hard limit.
Pump (pump_speed, pump_run)¶
- Off when
level_lowis active (after 5 s debounce); free again only afterlevel_lowhas been inactive for 60 s. - Minimum on-time 120 s / 30 s; minimum off-time 60 s / 30 s.
- At most 6 starts per hour / 12 per hour; beyond that the pump stays off until the hour is over.
- Speed change: break-before-make, old speed off, wait 500 ms / 200 ms, new speed on.
- With
pump_feedbackconfigured: no feedback 10 s after on, or feedback without an on command for longer than 10 s, gives alarmpump_feedback, pump off, and a retry only after confirmation.
Backwash¶
- Only with the pump on and running stably for at least 30 s.
- Sequence: valve on at the current pump speed, wait for the valve (5 s / 2 s), pump to the highest speed, run for the maximum duration (180 s / 600 s), pump back to its previous speed, wait again, valve off.
- At most 1 per 24 hours / 2 per 24 hours, at least 12 hours apart.
- Never with
level_lowactive; if it becomes active during backwash, everything stops immediately with an alarm. - During backwash
heat_enableandfillare off, and the pump cannot be switched off or change speed by a request (only by an interlock).
Heating enable (heat_enable)¶
- Only with confirmed flow (2 s debounce, 60 s run-in); flow lost means off immediately.
- Only with the pump on (if a pump function is configured).
- Minimum on-time and off-time 300 s / 120 s.
- Hardware required: the flow contact in series with the coil of the enable relay. Without confirming this
during setup,
heat_enablecannot be assigned.
Refill (fill)¶
- On only after
level_fillhas been active for more than 60 s; off whenlevel_fillis inactive orlevel_highis active. - At most 30 min per fill / 120 min; at most 120 min per 24 hours / 240 min.
- Alarm
fill_no_riseif the level does not change after 20 minutes: off, and no new fill until confirmed. fillcan never be switched on from the cloud.
Light and aux (class A)¶
- Maximum on-time 6 hours / 12 hours per request.
Inconsistent inputs¶
level_highandlevel_lowactive at the same time, orlevel_lowactive whilelevel_fillis not: treated aslevel_low(pump and refill off) plus alarmlevel_inconsistent.- An input changing more than 10 times per minute is treated as active (safe side) plus alarm
input_flapping.
Failures¶
| Failure | Result |
|---|---|
| I2C write or read fails (3 attempts), read-back does not match, expander missing | All outputs off and blocked until restart, alarm io_fault |
| Settings invalid | All outputs unassigned (off), alarm config_invalid |
| Clock invalid | Schedules do nothing; interlock timers keep running on the internal monotonic clock |
| Network lost | No effect on local control and schedules; cloud requests expire |
| Watchdog or crash | Restart; all outputs off at start-up |
| Start-up loop (safe mode) | Outputs are not started; all stay off |
| Firmware update | All outputs off before the restart; after the update 10 s of stable running before outputs are free |
| Power loss | The expander starts with all outputs off; nothing resumes except the schedule |
Alarms are sent to the cloud immediately (through the buffer, so also kept offline) and written to the log in flash.
Required hardware¶
- DO outputs drive only relay or contactor coils (at most 500 mA). Never a load directly. See Electrical installation and safety.
- Required hardware interlocks:
heat_enable: flow contact in series with the coil.pump_*: dry-run contact (level_low) in series with the pump start, if the pump allows it.fill: preferably a float valve orlevel_highin series with the valve.
- Recommended:
pump_feedbackfrom an auxiliary contact, so the firmware sees whether the pump really runs.
To be confirmed
Wiring diagrams for these interlocks are planned but not published. They must be reviewed by a qualified electrician.
Configuring outputs¶
Output functions, input functions, pool type and numbers are set on site as one installation profile, validated as a whole against the hard limits (all or nothing).
To be confirmed
The setup page does not have the output wizard yet. Until it does, the installation profile is posted as JSON from a laptop on the box's temporary network. Pre-loading an installation profile from the web flasher and a short local test per output are designed but not built.
Remote control¶
set_outputfrom the portal: off is always allowed; on only with "changes from the cloud" enabled on site, and for class B functions only with an explicit confirmation by the user. See Remote commands and settings.- The box reports each assigned output with its state, source of the last change and the reason when it does
not do what was requested (for example
interlock:level_low).
Related pages¶
Last reviewed: 2026-11-24. Applies to Lutra Lite 0.4.1.