Automation
Automation combines the possibility of selecting multiple conditions to fire different actions, we call these advanced notifications – triggers.
There’s 3 main steps to creating any trigger:
- Select the conditions that must be met to fire the trigger
- Select the entities that the trigger will apply to
- Select the actions the trigger will perform once the conditions are met
Lets start by making a simple trigger for notifying when the ignition of our vehicle is turned ON and send an email notification.
Create your Trigger
From the automation module click on the top right icon to create a new trigger, and give it a name.
Add your Conditions
To add conditions start by clicking on the button, this brings up a dialog where you can choose from several predefined conditions. We’ll start simple and select the first one Ignition turns ON.
Select your Entities
Click on the entities tab, and select the entities that you want to apply the trigger to, in this case we’ll select Vehicles and click on the vehicles that we want to monitor this notification with. Note that you can select multiple groups / vehicles / or assets.
Select the Actions to Perform
Now we can select what happens when the ignition is turned ON for any of the vehicles we selected. We have several actions available:
- Alerts – these are alerts that appear as popup on the gateway, and we’ll see later that they can be browsed on the Alerts app
- Email – this will send an email notification to any of the emails written here
- Safe Immobilization – this will activate the safe immobilization feature of your vehicle if it’s installed
- Output Management – this will activate or de-activate the device’s outputs
- SMS & Voice Calls – this will send an SMS Text Message or place a Phone call to any number destination*
- External Integrations – send an HTTP request to an external API
* – note that the SMS & Voice calls requires a subscription service, please talk to your gateway administrator for more information.
Click on CONFIGURE next to Alerts & Create a Gateway Alert, this will bring up a list of users on the right hand side, by default the creator of the alert is selected. You can choose to make it Informative, Warning or Critical, these levels are optional and can be used to distinguish the importance of the alert.
For example in the Alert card inside of tracking dashboard, you will see Critical alerts first, then any warning and information type next.
Press the back button to go back to the list of actions and click on CONFIGURE next to the email action. Click on the input and you will see a dropdown of users in your group, or else write any email you want to notify.
Save the Trigger
The options tab is optional but it’s where you can customize the time zone of the trigger or how many times it will fire. Click on the SAVE button on the top right of the page to finish creating your trigger.
You’re all set to receive an email notification and generate an alert inside the system when any of the vehicles we selected turn ON.
Sample Email
The email that the system generates will automatically contain the following information:
Subject: Name of the trigger – time it was generated – entity name – event that triggered the alert.
Body: Name of the vehicle, the event, the time and date, the address of the place the alert was generated, the speed, heading and coordinates, and a map snapshot of that location.
Optional: Adding a Custom Message
You can add a custom message to the alert by going back to the Conditions tab, and going down to the “Default Message” section. Then write your custom message.
It will appear inside the email you send, and on the alert that’s generated inside the gateway. Note the red area, which are the customizable sections of the alert.
Trigger Options
The trigger options are used to have more control over the trigger, it allows you to set a limit for how many times it should fire, or create a timed countdown till the actions are fired.
Time zone: The time zone option is used when sending a date/timestamp in a trigger message, for example the time that appears in the email is controlled by this Time Zone option. By deafult it is set to the timezone of your computer browser.
Firing limit: The firing limit is used to fire the trigger a limited number of times, in other words as soon as the trigger fires by the number that’s put here, it will stop sending messages. Please note that a change in the trigger’s condition’s resets this firing limit. Also, note that when the limit is reached the trigger WILL STAY ACTIVE.
Firing rate: The firing rate is a limit of how many times the trigger will generate in a given time window. This is useful to avoid receiving repeated triggers within a certain time frame, for example the vehicle is speeding and you only want to be notified when it happens 5 times within 2 hours. If the trigger generates 6 times in less than 2 hours then it will ignore the last time that it met the condition and not fire the actions. This applies per entity, so if you select multiple vehicle’s each one will have it’s own ‘up to 5 times in 2 hours’ rate
Countdown: The countdown is a delay in the firing of the trigger’s actions. It is recommended that this is used with a “Clear active countdown for the following triggers” option. Let’s take a real world example.
Let’s say that we want to be notified when the vehicle spends more than 20 minutes inside a particular geofence with the Ignition ON.
To do this we first create a trigger that has the condition: Ignition is ON AND Is inside a geofence and we give it a countdown of 20 minutes.
This means that when the condition is met, the countdown starts counting down.
Then we create a new trigger to get rid of, or clear this 20 minute countdown,
the conditions for this new trigger can be whenever the Ignition is turned OFF OR Is outside a geofence
Thus we would have a trigger that fires a notification after 20 minutes of detecting that the vehicle is inside of a zone with the ignition ON.
FREQUENTLY ASKED QUESTIONS
I just received an email, why am I not seeing an Alert inside the system?
- An email is not necessarily a Gateway alert, the Alerts module only shows alerts that are gateway generated, they are associated to a level: informative, warning, or critical. Check the trigger for the alerts option to be enabled.
My trigger is firing a lot, what did I do wrong?
- One of the most common mistakes when working with triggers is that the conditions used are matching multiple scenarios. For example, if you want to be notified when the ignition is turned ON inside a geofence, don’t select the “Ignition is ON” and combine this with the geofence, instead select the “Ignition is turned ON”, that way it only occurs once.
- Know the difference between when to use a label and when to use the trigger parameter keys, for example, if you want to know when the Input 3 is ON, don’t build the condition “Input 3 is ON”, because Input 3 may stay ON depending on the sensor / button / switch that’s connected to this input, instead select a Label: in3on that fires once when the condition is met on the device.
Why am I not getting a popup alert or sound?
- First make sure that your options are enabled for your user.
- Next, make sure you allow popups for the browser:
- Double check that the tab you have open is not muted, you can right click on the tab and check if there’s an unmute option, if that option is not there then proceed.
When I receive the coordinates there’s a comma in the latitude & longitude?
- To fix this you can use stringformat:”f” filter, example:
https://maps.google.com/maps?q={{body.lat|stringformat:"f"}},{{body.lon|stringformat:"f"}}
prints: https://maps.google.com/maps?q=7.916460,-72.472190