Skip to content

Rule engine ​

Open Rule Engines.

A rule engine is a chain of nodes. It runs for a device when that device’s profile points at a Started engine, or when a scheduler job runs the engine.

The chain adds your logic. It does not replace storing telemetry, and it does not replace the alarm rules on the profile.

Rule engines

ControlWhat it does
Start from a blank canvasMessage in only. The badge says Not wired until a link exists. A blank engine still saves. Readings are still stored. Profile alarms still run
New Rule EngineOpens the choices for a new engine
ImportCreate a draft from an Export JSON file. Passwords and tokens are cleared — re-enter them
ExportDownload the engine JSON (secrets cleared)
StartThe engine can run. A draft does not run
PauseThe engine stops running. A paused engine is not a failure when another engine calls it
Make defaultProfiles with no engine of their own use this one
The nameOpens the graph

Default on a row is the tenant default. Clear default removes that.

Rows named Example: are shipped with the platform (eighteen drafts). Each node appears in one of them. They are drafts, they are not on a device profile, and they cannot be deleted, started, or saved over. Duplicate (list or New Rule Engine → Shipped Example) makes an editable copy. Preview still runs on the example and does not send mail, create an alarm, or store a reading.

How to build ​

How to build a rule engine

Log and Drop are placed as soon as you pick them. Every other node opens its settings first. Add to graph places it. Cancel does not.

The engine name is required and is at most 200 characters. Edit it in the page heading or in Details → Name; both save the same value. Forward telemetry to my server is the name of that template only. Tap an output name, then tap the next node, including the node body. One output can feed more than one node. A filter value that is not a finite number up to 1e12 is refused. Each of those chains runs. A new line does not remove the line already there. If any chain uses Drop, that reading is not stored. The × on a line removes that line. Dragging from the coloured dot still works.

Not wired means Message in has no link yet. Graph OK means the links are valid. Needs fixes means a node is incomplete. A geofence node with entered or left unconnected shows that warning in the header instead of Graph OK. Save stays available for a blank engine.

Run Preview marks the path. It uses the sample you paste, or Load last telemetry from a device. Preview does not send mail, create an alarm, or store a reading.

Save writes the graph. The first save is kept as version 1. A later save that changes the graph is kept as the next version. Saving again without a change does not add a version. Start is separate from Save. An engine that is only saved, and still draft, does not run.

A started engine on the device's profile runs when a reading arrives. Executions increases by one. If that reading is stored and this engine does not run, Live debug says why: the engine is not started, it is paused, it is not attached to that device's profile, or the graph was rejected. A profile alarm rule still runs on its own when the chain does not.

Live debug lists runs from about the last 30 minutes (you can ask the API for a longer window or a single run id). A Command and wait that is still open stays on one row until the reply or timeout; the continuation steps are written into that same run. The wait step stores the RPC request id so you can match it to the device RPC / command log. A device reply resumes only the wait with that same request id. A reply that only wakes a wait does not add a separate “Skipped” row when Message in does not accept rpc_response. If the API restarts while a wait is open and the wait job is still saved, the platform restores that job and the normal timeout or reply runs once. Only a wait with no saved job is marked Timed out (recovered after restart) without running the failure branch again.

Message in ​

Message in is the start. It accepts telemetry unless you tick more:

KindWhen the chain sees it
telemetryA reading arrives
attributesThe device sends client attributes. Server and shared attributes do not start this message
alarm_createdA profile alarm rule raises an alarm
alarm_updatedAn active profile alarm is raised to a higher severity (same device + rule; no new row)
alarm_clearedA profile alarm rule clears an alarm
device_activeThe device becomes active
device_inactiveThe inactivity timeout expires
rpc_responseA command reply arrives
scheduledA scheduler job runs this engine

Message type splits those kinds onto separate outputs. There is no single output named alarm. A new alarm and a cleared alarm are separate. A kind you do not tick goes out on other.

To process telemetry, attributes, and alarms on different branches: on Message in, tick every type you need (including alarm_created / alarm_updated / alarm_cleared), then add Message type and connect each output to its own path. The create-from-template Split telemetry / attributes / alarms builds that graph for you.

An alarm created by Create alarm in the chain is stored and does not come back into the chain. That stops the chain from raising the same alarm again. While an alarm stays active at the same severity, the open row is refreshed but the chain does not get another message (use Throttle on alarm_created if you need a periodic notify). Acknowledging an alarm does not send a message into the chain.

Nodes ​

The palette is grouped.

Flow. Message in, Message type, Throttle, Delay, Dedupe, Burst, Run another engine.

Filter. Filter, Switch, Compare with previous, Key gone quiet, Geofence, Shift clock, Sequence, Profile switch, Alarm status, Key present, Value stuck, Deadband, Profile rule ahead, Shift edge, Named script paths.

Transform. Enrich, Related entity, Script, Math, Change since last, Window, Rate per minute, Period total, Roll-up, History, Split list, Attributes on message, Message count, Log.

Action. Create alarm, Open work order, Clear alarm, Set attribute, Send command, Notify, Act on related device, Delete attribute, Continue as, Command and wait, Command pending, Alarm count, Drop.

External. Webhook, REST call, Integration downlink, MQTT publish.

Most demos need only Filter → Create alarm / Notify / Delay / Send command. Prefer those templates under New Rule Engine, or Duplicate a shipped Example, before opening the full palette. Profile Alarm Rules already cover everyday thresholds — use Create alarm in a chain only for a different condition.

NodeWhat it does
FilterTrue or false on a key
DropStop. This reading is not stored. The reply is dropped: true, not queued: true
LogOne line in the server log. The chain continues. It does not save telemetry
DelayWait, then continue. The platform stores the reading when the delay finishes
Create alarm / Clear alarmA chain alarm, separate from the profile alarm rules
Set attributeWrite an attribute the chain decides. Not required to keep what the device already sent
Delete attributeRemove that key. Telemetry history stays
Send commandSend a command. Does not wait
Command and waitWait in this chain for the reply, up to 60 seconds. Live debug keeps that wait on the same run: the row says Waiting for device (Ns) until the device answers or the wait ends, then the same row shows Replied after N ms or Timed out and the steps that followed
NotifyEmail, SMS, or Telegram. Mail and SMS use the account under Tenant Settings
Run another engineCall another Started engine on the same device
HistoryAverage, min, max, sum, or count of one key from stored telemetry, up to 7 days

Run another engine ​

The other engine must be Started. This chain waits, then continues on success with the message it returned. If the other engine drops the message, this node goes out on failure. Three levels deep is the limit. An engine that calls itself fails that node. A paused target does not fail the chain: the message continues unchanged.

A worked shape ​

One engine can decide, and another can do the work.

  1. Filter on temperature greater than 30.
  2. true goes to Run another engine.
  3. The other engine is Started, and its only job is a Log of the temperature.
  4. false goes to a Log that the room is cool.

The reading is stored either way, because neither path uses Drop. The profile alarm rules still run beside this.

Shipped examples ​

These drafts are on the rule engine list (filter Examples). None of them is on a device profile. None of them can be deleted or changed. Duplicate makes a copy you can edit.

ExampleWhat it shows
Inner logNested target for Run another engine
FlowMessage type, throttle, dedupe, delay
FilterFilter, switch, compare previous, key quiet
Time and placeShift clock, sequence, geofence, profile switch
Alarm stateAlarm status / count / create / clear (draft does not raise alone)
NumbersMath, delta, rate, window, period, roll-up, history
ShapeEnrich, script, split, related entity
ActionsAttributes, work order, notify, drop, related action
CommandSend command and command-and-wait (draft does not send)
ExternalWebhook, REST, MQTT, downlink (draft does not call out)
Run another engineFilter then call Inner log
Key and attributesKey present; server attribute label on the message
Count and burstMessage count window, then burst (last reading)
Stuck and deadbandValue stuck / deadband (no alarm)
Named pathsScript returns high, ok, or low
Distance to the profile ruleHow far from the profile rule — no second alarm
Waiting command and shift edgeFirst message after 08:00 India time; command pending
Block the next startGeofence then blockNextStart (draft does not send). See Geofences

support@autoconnecto.in · founder@autoconnecto.in · +91 92121 00555 · app.autoconnecto.in