Skip to main content

Actions

An action is what the rule does when the flow reaches it. A rule may end in as many actions as you like, and they all run.

ActionWhat it does
Send MQTTPublishes a message to an MQTT topic
Send LoRaWAN downlinkSends a downlink to a LoRaWAN device
Send emailEmails organization members or addresses you type
Send SMSTexts organization members or numbers you type
Send HTTPCalls an external endpoint
Write logWrites an entry to the Logs page
Trigger ruleRuns another rule
Do nothingEnds the branch without doing anything

Most actions send through a connector, so create the connector before you build the rule. The action's connector list only offers connectors of the right kind.

Message bodies, topics and payloads accept variables that resolve when the rule runs.

Each action is configured in the Settings panel on the right of the canvas.

The Settings panel for the Send MQTT action, with the connector, topic and message body

The Settings panel for the Send LoRaWAN downlink action, with the connector, port and payload

The Settings panel for the Send email action, with recipients, subject and body

The Settings panel for the Send SMS action, with recipients and the message text

The Settings panel for the Send HTTP action, with HTTP connector, Execution policy, Method, Body, Additional headers and Query params

The Settings panel for the Write log action, with the log message

Send MQTT

Publishes a message to an MQTT topic through a Generic connector.

SettingWhat it does
ConnectorA Generic connector with an MQTT protocol
TopicThe topic to publish on
PayloadThe message body

The recommended topic shape is yggio/generic/v2/<your-topic>. See Generic MQTT for the formats and what subscribes to them.

This is the action behind most actuator control. The lighting rule on the overview page is ten of these, one per lighting group.

Sends a downlink to a LoRaWAN device. No connector is needed - the network server is taken from the device itself.

SettingWhat it does
Device sourceSelected device, or the triggering device
DeviceWhich device, when the source is a selected device
PortThe LoRaWAN fPort, 1 to 223
PayloadThe frame, as hexadecimal
ConfirmedAsk the device to acknowledge the downlink

Triggering device sends to whichever device started the rule, so one rule serves a whole fleet. It needs a trigger that carries a device - a sun event trigger does not, so there you have to name the device.

The payload is whole bytes of hexadecimal, so an even number of characters, up to 242 bytes. It can contain variables, and the literal stretches between them still have to be whole bytes.

Note: a variable that does not resolve fails the action rather than sending a short frame. A shortened frame would be a different command, which is worse than no command.

Send email

SettingWhat it does
ConnectorAn Email connector
TitleThe subject line
BodyThe message
RecipientsWho receives it
Execution policyWhen the action runs

Recipients are either organization members - the contacts in your organization that have an email address - or addresses you type in. Both can be used on one action.

Send SMS

SettingWhat it does
ConnectorAn SMS connector
BodyThe message
RecipientsOrganization members with a phone number, or numbers you type
Execution policyWhen the action runs

Send HTTP

Calls an external endpoint through a Generic connector configured for HTTP.

SettingWhat it does
ConnectorA Generic connector with an external HTTP downlink
MethodGET, POST, PUT, PATCH or DELETE
HeadersA JSON object of headers
ParamsA JSON object of query parameters
BodyA JSON object or plain text
Execution policyWhen the action runs

Headers and params have to be valid JSON objects once their variables have resolved. The body may be either JSON or plain text.

Write log

Writes an entry to the Logs page, filed against the rule.

SettingWhat it does
MessageThe text, up to 512 characters
TypeInfo, Warning or Error
PriorityLow, Medium, High or Severe
Execution policyWhen the action runs

It is the cheapest way to leave a trail. A rule started by a sun event or a timer touches no device, so without this action the only record of it is the run history. A log entry is searchable alongside everything else.

Trigger rule

Runs another rule, without that rule waiting for its own trigger.

Note: the Trigger rule action is not in the palette yet. It is on its way in a coming release.

SettingWhat it does
Target ruleThe rule to run
TriggerOptional. Which of the target's triggers to enter at
Execution policyWhen the action runs

Only the target's trigger matching is bypassed. Its conditions still evaluate, against the event forwarded from this rule.

Naming a trigger runs only the branch below it. Leave it empty and the whole target rule runs, every trigger included - which is not what you want for a rule whose triggers do opposite things. A streetlight rule with one trigger for sunset and one for sunrise would switch the light on and off at once.

It is how a manual override reaches an automatic rule: a button or a light sensor drives a rule that chains into the branch of the scheduled rule it wants to take over.

The run history of the target records which rule and which action started the run, so a rule that ran with nothing of its own happening can still be traced back.

Do nothing

The Settings panel for the Do nothing block, which carries only a label

Ends the branch without doing anything. It is a placeholder while you build - it lets you wire a condition's branch and check the shape before the real action exists.

When an action runs

Every action except Do nothing has an execution policy, which decides how often it fires relative to the condition in front of it.

PolicyRuns
Every eventEvery time the flow reaches the action
On enterOnce, when the condition turns from false to true
On exitOnce, when it turns back from true to false

On enter and On exit are what stop an alert repeating. A temperature above 25 degrees on a sensor reporting every five minutes would otherwise send a message every five minutes for as long as it stays warm. On enter sends one when it crosses, and an On exit action on the false branch sends the all clear when it drops back.

Two rules apply to the wiring:

  • An On enter action has to be reachable from a condition's true branch.
  • An On exit action has to be reachable from a condition's false branch.

"Reachable" allows a delay in between. An action wired straight to a trigger has no condition to transition, so only Every event is available there.

The state is kept per device, so one rule watching a hundred sensors tracks a hundred separate crossings.