Each recipe names the blocks, their settings and where to wire them. Recipes 1 to 5 and 8 to 9 go into a root flow on the IoT host (the tenant-wide root or a profile root); insert them on the telemetry output of the Message type switch, before or after Save telemetry as stated. Test every change with Test before you deploy. See The flow editor.
1. Store a value only when it changes enough
A level sensor reports every 10 seconds, but a change under 0.5 cm does not matter.
Message type ─telemetry→ Only changes → Save telemetry
- Only changes: property
msg.payload.level_cm, modedeadband, value0.5, first on. Key: leave the default (one memory per device). - Records without
level_cmshould still be saved: put a Switch first (propertymsg.payload.level_cm, rulenempty), send its rule output through Only changes and its otherwise output straight to Save telemetry.
This reduces stored points, not counted messages. To reduce messages, change the device’s reporting. See Message quota and usage.
2. Consumption from a meter that can restart
A water meter sends a growing volume_m3; after a power loss it restarts from 0.
Message type ─telemetry→ Delta ─out→ Save telemetry
└other→ Save telemetry
- Delta: input
msg.payload.volume_m3, outputmsg.payload.volume_delta_m3,on_negativezero, seedlatest, round 3.
For hourly or daily consumption you can also chart the raw counter with the increase aggregate. See Derived values.
3. Alarm when a sensor goes silent
Raise a warning when a device stops sending temperature for 15 minutes, clear it when it reports again.
Message type ─telemetry→ Switch (msg.payload.temperature nempty) → Watchdog ─timeout→ Raise alarm
└ok→ Clear alarm
- Watchdog: ms 15 min, key
msg.originator(default), repeat off. - Raise alarm: alarm
temperature_silent, severity warning, textNo temperature for 15 minutes. - Clear alarm: alarm
temperature_silent. - Keep the Switch‘s output also wired to Save telemetry, or wire the watchdog branch beside it.
A watchdog starts watching a device at its first message after the deploy. For devices that are completely offline, also use an offline alarm rule. See Offline alarms.
4. Forward every reading to your server
Save telemetry → HTTP request
Create an HTTP endpoint connection tohttps://ingest.example.comwith bearer authentication. See Connections and secrets.
HTTP request: method POST, path/readings, bodytemplate, template_formatjson, template:{"device": {{ msg.metadata.deviceName }}, "ts": {{ msg.metadata.recordTs }}, "values": {{ msg.payload }}}
latesend, so a backlog after an outage is forwarded too.
Wire the request’s error output to a System log block (textforward failed: {{ msg.error.code }}).
Wiring after Save telemetry forwards only what was stored. For many devices, put a Batch (count 50) and a Join (auto, array) before the request to send groups.
5. A status key for site views and charts
Site views colour rooms by a status key. Store one derived from the temperature:
Message type ─telemetry→ Switch (msg.payload.temperature nempty) → Calculate → Save telemetry
- Calculate: target
msg.payload.status, exprmsg.payload.temperature > 8 ? 2 : (msg.payload.temperature > 6 ? 1 : 0).
Site views read 2 as critical and 1 as warning. As a number, status also charts and aggregates. See Site views.
6. Mail and SMS an on-call address when an alarm opens
A flow (not a root) on the IoT host:
Device message (types: alarm) → Switch (msg.metadata.alarm.transition) ─created→ Rate limit → Notify
- Device message: types
alarm(tick it by name), profiles: the ones you care about. - Switch: property
msg.metadata.alarm.transition, ruleeqcreated. - Rate limit: n 5, per_ms 1 h, mode drop, key
msg.topic(one limit for all). - Notify: recipients
addressoncall@example.com,phone+905551112233, androleADMIN(in-app and push); title{{ msg.payload.title }}; textAlarm on {{ msg.payload.deviceName }}: {{ msg.payload.title }} ({{ msg.payload.severity }}); urgency critical.
Roles reach members in the app, by push and in chat apps; only address and phone rows get mail and SMS. See Alarm, command and notify blocks.
7. Night mode
Two flows on any host switch a third flow (“Night actions”) on at 22:00 and off at 06:00.
- Flow A: Schedule (daily,
22:00, every day, tzEurope/Istanbul) → Enable or disable a flow (flow: Night actions, state enable). - Flow B: Schedule (daily,
06:00) → Enable or disable a flow (state disable).
Both need the typed confirmation at deploy. At most 6 switches a minute per organisation.
8. Switch a pump between two levels
Start a fill pump below 30 % and stop it above 80 %. Between the two levels nothing is sent, so the pump does not chatter.
Save telemetry → Switch (property msg.payload.level_pct)
─rule 1: lt 30→ Not repeated → Send command pump.set {"on": true}
─rule 2: gt 80→ Not repeated → Send command pump.set {"on": false}
- Switch: property
msg.payload.level_pct, ruleslt30 (Namelow) andgt80 (Namehigh), stop_first on. A record without the key goes to otherwise and is ignored. - Each Not repeated: period 10 min, so the command is sent once and repeated at most every 10 minutes while the level stays out of the band.
- Send command: the profile’s
pump.setcommand with params{"on": true}or{"on": false}.
Commands from flows are limited to 30 a minute per device, and a late message sends nothing. For operator-facing control with Manual and Auto modes, the Rules card is often the better tool: see Rules card: actions.
9. Decode a binary payload
A device sends 4 bytes: a signed temperature × 10 and an unsigned humidity. It arrives as raw (base64).
Switch (msg.payload.raw nempty) → Change → Base64 (decode) → Hex (encode) → Bytes (decode) → Save telemetry
- Change:
setmsg.payloadto the pathmsg.payload.raw. - Bytes fields:
temperatureoffset 0i16scale 0.1;humidityoffset 2u16.
10. Take readings from another system by webhook
An outside system posts JSON to Hermetry, and the flow forwards it.
- Webhook trigger: auth
hmac, parsejson, replyaccepted. Copy the address and secret from the Webhooks dialog. - Then Switch on
msg.payload.type, Change to reshape, and an action: Notify, Webhook, MQTT out, or Set variable.
By default a webhook’s message is about the organisation, not a device, so Save telemetry refuses it. To feed device readings from another system, let it send them as the device over MQTT or the device HTTP API. See Device HTTP API.

