Alarm for offline devices

This thread is very old, but I’m wondering if someone can help. I have absolutely zero expertise with this sort of thing, but I have a Particle Photon plugged into the same outlet as my sump pump. A few years ago I set up an ITTT applet to try to notify me (email/SMS/phone call) if the device went offline (indicating a power or internet failure), but it never worked very well (there was no adjustable timeout period, so I would end up with hundreds of alerts every week.

This seems like exactly the kind of solution I need (send me an email or SMS if the device is offline for ~10 minutes), but I have absolutely no idea how to implement this (it’s all way over my head). Could anyone point me to a guide or step-by-step that would help me set up something like this for my Photon? I have no programming knowledge (apart from Basic in the 1980s and writing simple batch files in Windows), but am not afraid of tweaking variables in code if it’s simple enough.

Any help would be much appreciated!

@jbroses

There are a number of ways to make this work but, I believe, all will require you to employ some “back-end” service to keep track of the last connection and send the alerts.

I use Ubidots to do this as they have a robust events engine that can sent email, SMS and even Slack messages.

You simply have your Photon send a regular (“heartbeat”) message to Ubidots using a Webhook or the Ubidots Particle library. Then, when the events engine notices a number of missed messages (you can set this value) it sends an alert.

Here is a tutorial on sending web hooks to Ubidots and one for events. Free to ask questions here if you go this route:

Thanks,

Chip

1 Like

Thanks so much, Chip! Of course, I want to add complexity here by seeing if I can find a free back-end service for this application. If that’s not possible, I totally understand, but curious if you have any thoughts on that.

Thank you again for this advice!
Jon

@jbroses ,

Sure, I think you have captured the core trade-off - complexity and cost.

So, here is one approach (others may have better ideas) If you were going for free…

  • You could send periodic calls to your back-end service via webhook. As long as you stay under your data operations budget for the device / month, you should be OK. BTW, these web hooks could be to report data you want to log not just “I’m alive”.
  • You would need a back-end that is on-line and accessible such as an AWS (free tier) account or a server on your home network with a publicly accessible IP address.
  • On the back-end you could, for example, have a function as a service (AWS Lambda) that would spring into existence when you send the webhook, do its thing and pop back out of existence. These services generally have generally free tiers. Using an ephemeral service would save you from getting into “paid” space of keeping an AWS instance on-line 24/7.
  • Let’s say you go with AWS Lambda (1M calls a month free for 12 months) and an API gateway (also 1M calls a month free) you could create an API endpoint for the Webhook and then execute your code to parse the webhook, check to see how long it has been since the last call (and store data in the - you guessed it - free S3 storage) and initiate a free AWS Simple Notification Service call to send an email letting you know if your device is off-line.

There are plenty of tutorials on this step such as:

Now, this is code that you will need to monitor and maintain. But, it could get you the functionality you need and it would be free for at least a year. There may be other service that have a free-tier that could be less complex but this approach would give you valuable experience in build a cloud native application.

The question is what do you want to spend your time on and what is your time worth?

Hope this helps,

Chip

1 Like

Hey there, and @jbroses : welcome to the community!

I wanted to mention two things:

  • would any of you two mind if I split this discussion into a new one and we continue the talk there?
  • I’ll wait until your green light for the split to mention my point of view.

Thanks

1 Like

Hey,
another option is Google Firebase Cloud, which I imagine will be free forever at this level of traffic.
However, the cloud function would need to run periodically on its own as well, in order to check for offline devices.

I would think that the Ubidots way would be the simplest one. Is there a free tier with Ubidots these days? I forgot.

Thanks

@gusgonnet ,

Yes, Firebase is another option and, like AWS it has robust free tiers. I am just a little more familiar with the associated services in AWS even thought I have played with Firebase to store device configuration data.

Ubidots has a free tier for STEM as long as it is for non-commercial use.

Chip

1 Like

@gusgonnet and @chipmc - thank you both so much for your replies, and sorry for my long delay. End of summer/back to school stole all available time!

First - totally fine to split this discussion into a new one.

Second - it’s quickly becoming clear to me that I’m out of my depth here. I was able to get and install my Particle, and had a service working with ITTT, but this all seems a few levels above that. Is there a way I could hire someone to research and implement this for me? I’d much rather spend a little bit of money one time to have someone figure out how to do this without a subscription and get it set up for me. I’ve heard of upwork, but I’m not sure if that’s the right venue for this sort of project.