Heartbeat Routing Example

Hello, All!

Has anyone yet managed to get an example of the “Heartbeat” route (in the Dashboard > Routes)?

I’d thank you profusely to see a working example or hint!

Thanks!

Hey there! We’re slightly behind on updating the docs, but let me help you out here. Right now, our heartbeat route kind of functions as a two step process:

Step 1:

Create a heartbeat route that “listens” for a particular topic (the “subscribe to” topic - see here for reference on system topics that are automatically associated with each CSR message).

If “heartbeat time” number of seconds elapses, without the Hologram cloud receiving a message with that “subscribed to” topic, then the “publish to” topic gets posted to, which can then trigger any outbound routes listening for that topic.

Here’s an example heartbeat route setup that listens for any message from my device id: 56481, and triggers the topic “Nightlight_heartbeat” when no message has been received for an hour:

Step 2:

Create an outbound route that handles the “publish to” topic from your heartbeat route.

In the following example, I’m simply creating an email route that “subscribes to” the same topic that gets triggered whenever my heartbeat route goes off (topic: “Nightlight_heartbeat”):

With the combination of these two routes, I now receive an email alert whenever my Nightlight device does not report to the hologram cloud for an hour. Currently, by default, the data associated with a triggered heartbeat alert will simply be:

"Heartbeat rule triggered for tags: [tags] "

Thus my email alert looks like this:

As we work on expanding the heartbeat functionality out of beta, we’ll be adding the ability to further customize the outbound message associated with a triggered heartbeat, among whatever feedback we receive from the community.

Hope that helps get you started!

Thanks, Pat!

That absolutely works perfectly. :slight_smile:

I’ve also verified it works with SMS, too.

Thanks for the note on customizing the outbound message down the road, as well.

Are others experiencing issues with the heartbeat routings…or is there a known issue? Both MichaelM and I are having issues with previously functioning heartbeat routings. I have made no changes since we last tested.

Thanks !

Hi, what issue are you seeing?

I just tested and it seems to be working ok for me.

I have a heartbeat route that was originally configured a few months ago, that still appears to be functional. Are you seeing issues with the rule not triggering?

Thanks for the quick response! I will send you screenshots later this evening. Easier for you to see that rather than read through a long description.

In my case, I have a heartbeat routing set up to SMS and email after 100 minutes. I have data set to push every 90 minutes. I tested the function by powering down the device for several hours. No heartbeat SMS or email was received after being down for 4 hours.

Once a heartbeat “alert” has been triggered, it won’t send out any additional alerts until the trigger has been reset. The trigger should reset as soon as a message is received again for that particular heartbeat topic.

Just to double-check, are there some 90min-interval messages showing up in the data logs before powering down the device?

The data logs show consistent 90min interval massages until I powered down around 1pm on 4/2. The last 90min message was sent at 12:53pm so I should have received the heartbeat alerts (SMS and email) at 2:33pm but I received nothing.

In your data logs, there should be a heartbeat message that shows up whenever a heartbeat event is triggered. During a successful trigger, it would look something like this:

If you see this message in your logs, that means that the Heartbeat rule is functioning properly there’s probably something wrong on the side of the Email/SMS routes. I’m guessing that this message is not showing up in your logs though, so we’ll look through on our end to see if we can detect anything.

In the meantime, could you try making a duplicate Heartbeat rule and seeing if the new instance might trigger? Please leave the original Heartbeat rule in tact so that we can investigate in case it is an issue that happened with that particular instance.

As you expected, there was not a heartbeat message in the log. There was an error message after the power down.

I set up the duplicate heartbeat rule (I hope correctly). I will test and report back. I did notice when I set up the heartbeat rule, there was a Publishes To default of HEARTBEAT00000 which does not exist in my original rule. Is this an issue?

Nope, this shouldn’t be an issue. This was added a few weeks after the initial release of Heartbeat, to provide a default topic that each heartbeat rule will publish to, without need for further customization.

Thanks for pointing that out though.

The new heartbeat rule triggered. I received both the SMS and email 100 minutes after the last scheduled message. I believe the setup of the new rule is identical to the old.

Great, thank you - we’ll take a look and get back shortly about what’s going on with that original rule.

We’ve identified the cause, and it looks like it was possibly due to a database migration a while back that produced duplication of certain internal _device_* topics - yours happened to be one of them.

We’re investigating further exactly why this happened in the first place, to identify the scope of the bug and so we can make sure it doesn’t happen again.

You shouldn’t experience any issues with your new heartbeat route, but please leave the original rule intact as we continue our investigation.

Thanks for reporting this issue!

Thanks Pat! Appreciate the quick responses on this issue.

Hi, Guys! Still no joy for me on the heartbeat. Here’s what I’ve set (see two attached screenshots). My Dash is in 90-minute reporting interval, heartbeat is set for 15 minutes. According to the data log, it’s not being triggered.

Last little niggle: The heartbeat time selection still states “number of seconds” (which it was a while back) but the pulldown is now in days / hours / minutes. :slight_smile:

Any thoughts?

Hey Michael - we’ll take a look and see if this is the same root cause as with Tony.