Overview of Event Rules
Event Rules are used to trigger actions from inputs in the system. For example, Event Rules are used to show a Speeding alert on the map and to detect that a vehicle has entered or left a Geofence/POI. Event Rules can be very simple, but you can also create more complex Event Rules from multiple signals for more advanced logic.
Event Rules are also used to send alerts over SMS, email, and mobile application to fleet operators and to send data to other systems over TCP/IP or HTTP connections.
The Event Rule wizard guides you through the different steps required to create an Event Rule. It goes from defining what Users the rule is for, what it does and finally what the output should be.
The guide below will teach you on how to create an event if the driver breaks the 80km/h speed limit and will send email alert then show alarm on the map. We named it “Speeding Event“.
1. Go to Admin –> Event Rules then click “Add new Event Rule”.
Rule name and description, each event rule needs a name and a description. Use descriptive names as they are used in alerts and reports.
Enabled switch is used to control Event Rules. If selected Yes, the event is active and if NO, the event is only active for reporting purposes. Click Next to proceed to next step.
2. Who this rule applies to
By default an Event Rule applies to all Users, but you can select specific vehicles for the Event Rule.
3. Schedule rule activity
Always active = event rule is active at all times.
Activate on schedule = there are three options set on a daily basis. You can set a time span, or have the rule active or inactive all day.
the example below, the event is active only from Monday-Friday 8AM – 6PM AND active all day for Saturday and Sunday.
Usually, Event Rules finish when signal changes (more about that below). As shown above, it is possible to end events automatically when a schedule ends without requiring any signal input.
4. Expressions are used to start and end the events by evaluating incoming signals and position data. This is the section in the Event Rule wizard where you define the criteria for an event.
Refer below the available signals data can be use;
- Speed = use this signal for Speeding event and combine with Satellite Count signal or non working hours alert.
- Satellite count = add this signal if you want to create an Speeding event and to filter out the false event due to GPS signal inaccuracy. Minimum value to be considered the GPS accuracy is 10.
- Temperature = to monitor the Temperature reading.
- Voltage = use this signal to create an Event if the vehicle is having Low Voltage Battery and combine the signal with Engine = OFF, to filter out the false event, because usually if the vehicle started the engine, the voltage suddenly drop and goes up again.
- Engine = use this signal for Engine ON runtime, Low battery alert, Vehicle idling event.
- Immobilizer = trigger an alert whenever the immobilizer is activated/deactivated.
Driver ID Login:
- IButton = to add the Driver Name in any event alert, show the Driver Name that currently drive the Vehicle or create an alert when the driver didn’t use the IButton while driving.
- RFID = show the Asset name (i.e. Trailer no., BIN no.) that currently attached to Vehicle.
- To create an event/alarm when enter/exit the Geofence.
Points of Interest
- To create an event/alarm when enter/exit the Point of Interest.
So, from this example, conditions for Speeding event are;
- Speed > 80 km/h
- Satellite Count >=10
- Minimum delayed event = 3 minutes
Click the drop-down list and select “Analog Expression” then choose “Speed”.
To add the Satellite Count, click the “+” button then select “Analog Expression” then look for “Satellite count” and tick “Match all”.
Minimum event delay = you can trigger an event immediately or set a delay for a number of minutes before actually triggering the event.
The above expression means, when Speed greater than 80 km/h AND Satellite count greater or equal 10 within 3 minutes, the event will trigger.
NOTE: Satellite count, is a number of GPS satellites in orbit. Currently, the maximum number of GPS satellites that GPS can connect is 24 but may vary according to GPS model. The purpose of Satellite count expression in the speeding event is to eliminate the false event when GPS device is having an inaccurate signal, so 10 or more connected satellites are good enough to determine that Speed is accurate. Read more about how GPS works.
This step is where you setup any notifications that the Event Rule should trigger. The sample below shows that an email will be sent to all users in “All users” tag when the event starts.
As shown above the Email subject and message can be scripted using variables, refer below;
- Address will return [POS_ADDRESS], to show the location where the event triggered.
- Vehicle name will return [USER_NAME], to show the Vehicle No.
- Engine will return [SIGNAL_ENGINE_ON], to show the Engine status (ON/OFF).
- Event Duration will return [EVENT_DURATION], to show the duration of the event.
- Geofence will return [GEOFENCE_NAME], shows the Geofence name.
- Immobilizer will return [Immobilizer], shows the Immobilizer status.
- Satellite count will return [SIGNAL_SATELLITECOUNT], shows the signal strength of GPS.
- Speed will return [SIGNAL_SPEED], shows the vehicle speed in km/h (i.e 10km/h)
- Temperature will return [SIGNAL_TEMPERATURE], shows the temperature reading in ºC
- Trigger time will return [EVENT_TIME], shows the date/time when the event triggered.
- Voltage will return [SIGNAL_VOLTAGE], shows the vehicle battery voltage.
- POI Name will return [POI_NAME], shows the Point of Interest name.
To add the Mobile App notification, follow the steps below;
1. Click the “+” button to add another type of notification and select “Command“.
2. Select Custom server, _ExternalNotification, http and enter this URL “http://api.fleetmanager.sg/v1/notification/ReceiveQuery“, then choose if Notify Start,End or Start and End. (copy exactly the complete url but don’t include the double qoutes).
The following notifications are also available:
- DriverID = set the DriverID as a driver for a vehicle (used with the Driver ID Login expression).
- Argument = add an argument to the event icon shown on the map under “Label” (used in step 6 below).
- Email = send an email to all Users in the recipient Tag.
- SMS = send an SMS message to all Users in the recepient Tag.
- Icon = display a colored icon in the Vehicle list to show the event state.
- Report Argument = Add arguments to Event Rule reports. Example, [SIGNAL_SPEED]; will show the vehicle speed, [EVENT_DURATION];will show the duration of the event.
- Command = send a command to a tracking device or an external system over http or TCP/IP. Read here to enable the mobile app notification.
- Tag Notifier = dynamically add Users to Tag.
Here you can have an option if the events should show up on the map or just used for reports and notifications.
- If enabled, events will show on the map.
- Can either select if the events should close manually by user or automatically when event finished.
- Set the color of the alarm.
- Select default or custom icon, add a label (which you defined as an Argument notifier in the previous step) and alarm marker clustering.
- Notification area = If enable, new events will show up as a colored notification in the lower right corner of Fleet Manager. Auto-open, will automatically open the notification window.
- A sound will play if events triggered.