It is possible to assign one or more actions to each rule. An action is an operation to be executed when a rule condition is verified.
Following action types are available:
- Mail action
- HTTP action
- MQTT action
- Telegram action
SMS action(SMS can be forwarded with HTTP actions)
For each action it is possible to specify the condition to notify:
- Activation, the alarm started
- Shutdown, the alarm ended
- Both, both the alarm start and end
Placeholders
Depending on the variables used in the rule it's possible to use the following placeholders in action text:
- the value of a variable when the alarm has activated, the syntax to use is %%variabie%%
eg. %%x0%% - the value of a variable before the alarm has activated, the syntax to use is %%variable_1%%
eg. %%x0_1%% - value substitution, the syntax to use is %%variable_sub%%
eg. %%x0_sub%% - value substitution notes, the syntax to use is %%variable_sub_notes%%
eg. %%x0_sub%% - variable signal/device/widget/report description, the syntax to use is %%variable_desc%%
eg. %%x0_desc%% - variable signal/report device description, the syntax to use is %%variable_device_desc%%
eg. %%x0_device_desc%% - variable signal/device token, the syntax to use is %%variabile_token%%
eg. %%x0_token%% - variable signal device token, the syntax to use is %%variabile_device_token%%
eg. %%x0_device_token%% - if the rule contains a report, the download link of the file, the syntax to use is %%reportVariable_pdf%%
eg. %%x0_pdf%% - if the rule contains a widget, the download link of the file, the syntax to use is %%reportVariable_csv%%
eg. %%x0_csv%% - the date of the alarm, the syntax to use is %%alarm_date%%. The date uses the fixed format 24/07/2018 08:04.
Mail action
Mail action has the following fields:
- Receivers
- CC and BCC, the fields are editable after a receiver has been added
- Subject
- Text
HTTP action
HTTP action has the following fields:
- Method, it's possible to choose among POST, GET, PUT, DELETE
- URL, the address to forward the request to, the whole address must be specified including http or https
- Header, allow to add headers to the request specifying their key and value
- Payload:
- if text in paylod is in JSON format the json field of request is used
- if text isn't JSON:
- as default body field is used
- if text starts with text: the text field of request is used with the text following the keyword
MQTT action
MQTT action has the following fields:
- URL, MQTT broker address
- Client ID, the id to be used to identify the client
- Username and Password, to authenticate
- Topic, the topic where publishing to
- QOS payload
- Payload, the message to be pubished on topic
Telegram action
To set up and forward alarms to the Telegram bot read the dedicated article at Alarms on bot.
SMS action (Twilio + HTTP action)
You need to have a Twilio account in order to send SMS.
It's possible to send SMS using a HTTP action in a few steps:
- Create a HTTP action with method POST
- Set the URL
where SID and AUTH-TOKEN are provided by Twilio Consolehttps://<SID>:<AUTH-TOKEN>@api.twilio.com/2010-04-01/Accounts/<SID>/Messages.json
- Set a header with:
- key:
Content-Type
- value:
application/x-www-form-urlencoded
- key:
- Payload must follow the format
where:Body=<SMS text>&From=<FROM>&To=<TO>
- SMS text is the message to be forwarded
- FROM is the phone number in Twilio
- TO is the number to forward the message to (it must be preceeded by prefix)
0 Comments