Heartbeat messages - alarm

HI
I have a bunch of Sigfox devices sending 6 hourly heartbeat messages to my losant backend. I want to be notified (email using sendgrid) if i miss two or more of these messages, ie if the device has gone offline.
I am pulling the data via a webhook and using various tests on the data field to pull the heartbeat messages out from the real notifications.

What is the best way of going about this?

I would recommend using the Device: Inactive Trigger. This trigger will fire whenever any specified device does not report state for a specified amount of time.

The easiest approach is to ensure all of your devices have a common tag key. With Sigfox devices, we typically see every device having a sigfox_id tag (or something similar) to map the Losant device to the Sigfox device.

You’d then configure the Device: Inactive trigger for every device that has the tag, regardless of value: sigfox_id=*. If your devices report a heartbeat every 6 hours, I would recommend configuring the trigger for ~13 hours (long enough to ensure you’ve missed two messages).

The Device: Inactive trigger is driven by state, so your heartbeat messages would have to ultimately record state to the device. I would recommend adding a heartbeat number attribute and record a 1 whenever you get a heartbeat message.

With this configuration, the trigger would fire whenever a device does not record a heartbeat state message for ~13 hours, which means it missed two messages. You’d then connect an Email Node or a SendGrid Node to the trigger to send your alert.

Protrip: on the payload that the Device: Inactive trigger creates, the field {{triggerId}} is the ID of the device that went inactive. You can use that in conjunction with a Device: Get Node to get the full details of the device to send with the email.

1 Like

thanks, this is exactly what I was looking for, i just didn’t think to create an additional workflow.