Means of Detecting or Announcing Hub Restart via Maker API?

Don't think anyone has asked this directly before, so I will . . .

Is there an officially-sanctioned way for an external application, such as Dashboard app, to "know" when the hub is about to restart or indeed has just finished rebooting? From all I've seen under Maker API, I don't recall any way to subscribe to this event.

(Something tells me one or more 3rd party apps, like Hub Device by @thebearmay, may approximate this through judicious watching of its attributes. But if an app could be warned in advance that a reboot is scheduled and/or completed, it would allow for a chance at suspending polling on eventStream or Maker API, and perhaps reset itself after a nominal wait.)

Considering how frequently firmware updates get released around here, this strikes me as a valid topic of conversation, and welcome anyone's viewpoint on it, even a link to something in the Dev Docs.

When you're setting up your rule, a trigger under location events could be systemstart. I use that to notify me when the system starts. It works, but I have no real use for it. I have another rule that reboots using @thebearmay 's hub information driver when memory gets low, but that hasn't kicked off either. I think it would notify me if it did, using the systemstart event.

2 Likes

I believe the initialize method is called on a device on reboot as well, if you want to write some code.

1 Like

Yes. There will be a systemStart event after the hub restarts that is sent over Maker API.

If you are watching for hub/location events that is. It obviously is not a device event, as the hub itself isn't an end device.

In terms of a warning before rebooting... As hub updates never happen automatically, it is up to the end user to do whatever management on external systems they want to when they initiate the hub update.

AKA there is no need for it to send an event before rebooting, because it is user initiated to begin with.

If you wanted some easier way to notify external systems that a reboot is getting ready to happen, you could always do it with a virtual device that you manually toggle on, and have a rule to set it back to off after the restart is done.

Example events monitoring from node-red. Note to get these you have to have the "POST location events" option enabled in Maker API.

image

image

3 Likes

Great info, everybody. Really appreciate the leads.

Here is my super simple rule I made in RM to notify me

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.