Skip to content
IntellobotsTechnologies

Use · How-to

Rules: react to device messages

Select messages with SQL, filter them, and send them on to topics, HTTP endpoints, queues, twins or other devices. Test before you save.

Updated 11 Nov 20262 min read

All ThingsX IoT Core pages

A rule watches a topic, picks the fields you want, filters with WHERE, and runs one or more actions on every match.

SELECT temperature, topic(3) AS device
FROM 'tic/things/+/telemetry'
WHERE temperature > -15
The rule editor with its test bench, and the rules list with matched, OK and failed counts
Rules: write, test against a sample message, then save

Functions you can use

FunctionReturns
topic(n)The nth part of the topic (topic(3) of tic/things/freezer-1/telemetry is freezer-1)
topic()The whole topic
clientid()The client ID that sent the message
timestamp()When the message arrived, in milliseconds

+ matches one topic level and # matches the rest.

Actions

ActionUse it to
RepublishSend the result to another topic, for example alerts/freezer
HTTPCall your webhook or API with the result as JSON (with headers you choose)
QueueSend to a message queue for your backend to process
TwinUpdate a device's twin
CommandSend a command to a device

If an action fails, the message goes to the rule's dead letters, where you can see the error and replay it once the cause is fixed.

Write and test a rule

  1. Open Rules. Give the rule a name (letters, digits and underscores).
  2. Write the SQL.
  3. Paste a sample topic and sample payload, then press Test. You see whether it matches and what each action would receive.
  4. Add the actions and Save rule.