New: the AI firewall watches every module and explains each incident in plain words. See how it works

Rules card cookbook

Ten ready Rules-card rules – fans, lights at sunset, holidays, doors, standby and duty pumps, offline devices, seasons, formulas, sequences.

Each recipe is written as the card shows it: When, Only if, Then, Options. Device names, keys and commands are examples; use your own. Commands must exist in the device profile’s command catalog. Test each rule with Test now before saving.

1. Fan on when the room is hot during working hours

  • When: Room sensor · temperature rises above 28 and stays so for 5 minutes.
  • Only if: A time window after 08:00, before 18:00, Monday to Friday.
  • Then: Send a command Fan · fan.set with on = true.

A second rule switches it off: When temperature falls below 25 and stays so for 5 minutes; Then fan.set with on = false. The gap between 28 and 25 keeps the fan from cycling.

2. Lights at sunset, off at 23:00

Rule “Lights on”:

  • When: Sunrise or sunset · Sunset, 15 minutes after (negative: before).
  • Then: Send a command Every Light controller · light.set with on = true.

Rule “Lights off”:

  • When: A time of day · 23:00, Every day.
  • Then: Send a command Every Light controller · light.set with on = false.

The site needs a location for sunset. See Time, sunrise/sunset, dates and holidays.

3. Heating on weekday mornings, not on public holidays

  • When: A time of day · 06:00, Monday to Friday.
  • Only if: A public holiday · Today is a working day.
  • Then: Change a setting Every Thermostat · setpoint to 21.

Holidays come from your organisation’s holiday calendar; without one, every day is a working day.

4. Heater off while the loading door is open

  • When: Loading door · door_open becomes true.
  • Then:
    1. Send a command Door heater · heater.set with on = false.
    2. Wait until something holds: Loading door · door_open is false, for at most 30 minutes, then stop.
    3. Send a command Door heater · heater.set with on = true.
  • Options: Ignore the new one.

If the door stays open longer than 30 minutes, the run stops and the heater stays off; add a third step under a choice to tell people if you want.

5. Standby pump takes over

  • When: An alarm · Pump 1 · is raised, at least Major. Also: A device connects or disconnects · Pump 1 · goes offline.
  • Only if: Pump 2 · is online.
  • Then:
    1. Send a command Pump 2 · pump.start.
    2. Tell people · Admins · “Pump 1 failed; Pump 2 started.”

6. Duty pumps alternate by week

Two rules, one per pump, using days of the month as weeks.

Rule “Pump 1 duty”:

  • When: Days of the month · days 1–7, 15–21 and 29–31, at 06:00.
  • Then: Change a setting Pump 1 · duty to 1; Change a setting Pump 2 · duty to 0.

Rule “Pump 2 duty”: days 8–14 and 22–28, with the values swapped. The pump controllers read their duty shared attribute.

7. Tell people when a device stays offline

Start from the ready rule Tell people when a device stays offline:

  • When: Gateway · goes offline.
  • Then:
    1. Wait 10 minutes.
    2. Choose by a condition: If Gateway is offline then Tell people · Admins · “A device has been offline for 10 minutes.”

A short outage that ends within the wait tells nobody. For a recorded alarm instead, use a Device offline rule.

8. Summer and winter setpoints

  • When: A time of day · 05:00, Every day.
  • Then: Choose by a condition:
    • If Months or dates · Between two dates 05-15 to 09-30 then Change a setting Every Air handler · mode to cool.
    • Otherwise Change a setting Every Air handler · mode to heat.

9. Night cooling with outside air

  • When: Every so often · 15 minutes.
  • Only if:
    • Day or night · It is night.
    • A formula: [Office].[temperature] > [Outdoor].[temperature] + 3.
    • A value · Office · temperature is above 23.
  • Then: Send a command Window actuators · window.open.
  • Options: Ignore the new one.

10. A flushing sequence started by hand

  • When: Only when I press Run now.
  • Only if: Tank · level is above 40.
  • Then:
    1. Send a command Flush valve · valve.open.
    2. Wait 3 minutes.
    3. Send a command Flush valve · valve.close.
    4. Tell people · Members · “Flushing finished.”

Operators start it with Run now in the card (“Run name now? It moves equipment at once.”).

Tips

  • Pair “on” and “off” rules with a gap between their thresholds, or use and stays so for, to avoid cycling.
  • Use Every profile rows for whole groups of devices, up to 200 per row.
  • A rule that only tells people can be marked Also runs in Manual.
  • When a rule grows beyond the card, Detach into an ordinary flow. See Flows.