Actions and how to use them

About Actions

Actions in sepioo® Platform are crucial for any complex use case. They are used to perform several functions: 

  • To automate workflows
  • To react on events from our sepioo® platform
  • To integrate sepioo® seamlessly into your software
 
Each action is assigned to: an Entity type (1) and a Trigger (2)
Only “Active” actions will be executed (3)
To limit the Actions to a set of entities, a Condition can be set (4)
All active Commands will be executed on all the given Entities (5)
 

Entity Type

The Entity Type specifies the type of Entity on which the Action will be performed.

The following options are available:

  • Object
  • Gateway
  • Location

Trigger

The Trigger specifies when the Action will be executed. The options may vary depending on the “Entity Type”.

The following options are available:

  • Button Press (Object): Will be triggered when a button is pressed on a Device.

  • Change (Object, Gateway, Location): Triggers when the Custom Fields of an entity change.

  • Device Data (Object): Triggered when a Device transmits device data.

  • Device Status Update (Object, Gateway): Triggered when a Device changes its status (e.g. Connection Status).

  • Event Status Update (Object): Triggered when an Event Status of a Device changes.

  • Gateway Group Change (Object): Triggered when a Device changes the Gateway and the new Gateway has a different “Gateway Group Name” as the old one.

  • Scheduler (Object, Gateway, Location): A timer determines when this Action is triggered. For this type, a “Cron” value must be set. The “Cron” value can be testet with: https://crontab.guru/

  • Webhook (Object): An external HTTP call triggers this Action. The webhook address is “…/{account}/{location}/actions/{id}/trigger” and can be found in the API specification. The Action ID (which is used in the HTTP URL) is written in the section “Webhook Configuration” after the first save.
    The value “Object ID field mapping” must also be specified, so the system can map the provided data to the internal Entity (e.g. “[?= idFromWebhook?]“). The mapping is taken from the Body of the Webhook POST call.Gat

External Data Source

Some combinations of “Entity Types” and “Triggers” allow you to specify an external data source. This means that the data is not provided by the internal system, instead it is loaded from a 3rd party system of your choice.
The external data can be retrieved with following options:

  • HTTP (HTTP GET API call)
  • FTP
  • MQTT

 

The flag “Per location” will specify if the Actions runs once or per Location.
For this feature, you have to set a “Location field mapping” (only if per Location is deactivated) and an Object ID field mapping, so the system can map the external to the internal items.

Name

The name has no effect on the system, it is only used for better readability and traceability in the “Actions History”.

Active

Only actions with the “Active” checkbox checked will be executed.

Condition

A “Condition” filters the entities on which the Action is performed. 
For example: The Action should only affect Objects, where the custom field “type” has the value “1” –> [?= type=1 ?]

Commands

An Action can have one or multiple “Commands”. Every Command has following base attributes:

  • Active: Only “Active” Commands will be executed (the checkbox on the top left).

  • Name: The name has no effect in the system, it is only used for better readability.

  • Skip on error: If this value is set, the next command will also be executed if this Command fails. Otherwise the Action will stop and fail.

  • Condition: This condition will be combined with the condition on the Action with a logical AND.

Some command types are restricted to certain “Entity Types” and “Triggers”. The sepioo® platform provides the following Commands for Actions:

  • Internal Web Hook: Calls an internal Action with the Trigger “Webhook”.

  • Send request: Send a HTTP request to a external system.

  • Sleep: Wait the specified time before the action is continued.

  • Actions:
    • Ping: Create a Ping Task.
    • Refresh: Create a Refresh Task.
    • Flash: Create a Flash Task.
    • Image: Create a Image Task.
    • Switch Page: Create a Switch page Task.
    • NFC: Create a NFC Task.
    • Set Device Data: Create a Set Device DataTask.
    • Get Device Data: Create a Get Device DataTask.
    • Temperature: Create a TemperatureTask.

  • Write to …
    • Message Queue: Write a new entry to the internal MQ. The entry will be added in the queue “…” actions.
    • FTP: Write a new entry to an FTP server.
    • WriteMQTT: Write a new etry to an MQTT server.

  • Send Mail: Send a email.

  • Modify: Modify the custom fields of the current Entity.

Actions examples

In this section, users can find examples of useful actions which can also be adjusted to individual use cases based on requirements and needs.

Action to send email when battery status is “BAD” on a Digital Display

This action is a simple email action to warn users when it is time to replace or recharge batteries on either 2.4 GHz Digital Displays, or NB-IoT displays.

The condition applies to all the Displays in current form, and naturally it can be narrowed down to work only on specific Digital Displays, and/or Locations based on what the Use Case requires.

Please keep in mind that this action will send an email every time a Device reports BAD battery status, and will require action of the user to recharge or replace batteries to stop it. 

Action to send email when Gateway goes Offline

 

This action will send an email to the user when one of the gateways goes Offline. 

This is applicable on any Gateway type and can be more specific in the condition if the Use Case demands it.

Action to Modify Display Custom Data and Send it via email upon button press

Some use cases can benefit from managing the Custom Data on a Digital Display, and upon a button press, the data is sent via email to User(s). 

Here is a generic example of an Action which can be downloaded and adjusted.