Is there a webhook for a photon when it goes offline or comes back online?
I’m trying to see if I can build a push-based solution vs having to poll device status on a regular basis.
Is there a webhook for a photon when it goes offline or comes back online?
I’m trying to see if I can build a push-based solution vs having to poll device status on a regular basis.
I don’t think the “came online” event (nor it’s opposite) are actually created by the device and hence won’t be accessible for a webhook.
But you can always actively publish an even from your device when the device comes online and hook onto that. The opposite is a rather obscure endeavour as you’d need to publish the loss of connection which requires an active connection
But even cloud created “went offline” message isn’t actually generated by a dedicated event but rather by the fact that the device failed to check in in time and hence a lost connection is assumed.
You can publish values to ThingSpeak at a regular interval and use their API to get the “last data age” for any channel/field.
Then use a local Photon to check the Data Age for all your remote Photons, or a simple HTML file that lists the # of seconds for each Photon, like this:
The Local Photon could publish Alerts (for IFTTT, etc) when any remote Photon hasn’t updated.
I’m not sure if this helps you, but its a nice feature of the ThingSpeak API.