Receive an email when your LoRa extension gateway is off
You can put in place your own LoRa gateways to improve your local network coverage and manage it with your Live Objects portal.
Now as this equipment becomes crucial for your devices to communicate you want to be notified in real time if this gateway goes Offline.
If you have additional local gateways, you can monitor them in Live Objects in Device tab.
You can receive email notifications when your gateways is down. This is easy to do thanks to the Live Objects “Triggers and Actions” API.
Simple associate an action to an event
Event types who can trigger an action could be, among others, a device activity, an incoming data, or even in our case, your LoRa gateway status change. The complete list of usable events is available here.
Actions are notifications you can send by email, by push http to an external server, pushed to a Microsoft Azure or published to a FIFO for a MQTT consumption.
These notifications can be customized dynamically with the information contained in the event generated (see event definition in the link above) thanks to a mustache-like format.
Let’s do it with an example;
Just setup the rule using API
See the documentation at API documentation
POST liveobjects.orange-business.com/api/v1/event2action/actionPolicies
{
"name": "myNotif",
"enabled": true,
"triggers": {
"loraGatewayStatus": {
"version": 1
}
},
"actions": {
"emails": [{
"to": ["xxxx@orange.com"],
"cc": ["yyyyy@orange.com","zzzz@orange.com"],
"subjectTemplate": "State change for gateway {{gatewayId}}",
"contentTemplate": "gateway {{gatewayId}} changes from state {{status.previous}} to state {{status.current}} at {{timestamp}}"
}]
}
}
Customize the notification email
… with the information contained in the event generated when the gateway status changes. The structure of such event looks like
{
"type":"loraGatewayStatus",
"version":1,
"gatewayId":"ABCD1234",
"status": {
"current":"ONLINE",
"previous":"OFFLINE"
},
"timestamp":"2020-09-11T09:50:00.394Z"
}
See in the developper guide for event structure definition
Now if your gateway turns OFFLINE you will receive immediately an email
And in the portal the Gateway is flagged “OFFLINE”
Note you will receive all status changes for all your gateways.