[OBSOLETE] Device Monitor - Get Notified if Devices Stop Reporting


So I’m trying to use this script to get notified when my Zigbee outlet goes offline. A simple method to detect if I have lost power in my house (My UPS system is consumer grade and has no notification service).

My UPS will only last about 1 hour, so I need a shorter interval. I could plug a device into the outlet and get energy reading, and then theoretically I would stop getting those messages. I suppose that would put me at a 5 minute interval, but it would be nice to do this by simply changing the interval option to be in minutes, not just hours.

I can edit the math in the script but figured I’d check with you first to make sure I wasn’t overlooking something obvious.


OK - so just noticed the ‘Check Interval’ Option. I set that the 5 minutes but did not get notified. I noticed if I go to ‘Device Monitor’ I do not see the status of my outlet being shown. I confirmed my device was selected and saved (I see it as a smartapp within the device).

FYI, it seems this app is being affected by some changes at ST on rate limits.

See this over in another thread:

I am noticing rate limit errors for Device Monitor too now in my Live Logging.

UPDATE: The ST rate limit changes have been rolled back for now:

1 Like

I’ve been using this for a while, but I was getting constant notifications about delayed devices (I’m still not 100% sure exactly what that entails).

As I’m using it to let me know if contact sensors have gone offline (to make them viable for a homebrew security system, that works wonderfully with a BBU powering my network gear and ST hub, FYI), I really only wanted to know if devices had stopped communicating/gone offline, as that usually means the battery needs to be reseated/replaced.

I don’t know this code, but it was similar enough to what I’ve worked with before that I could read through all of it and copy/edit the deviceOnline notification/settings options for an option to enable or disable notifications for delayed devices. Seems to work, so I added an “issue” on the GitHub repo and included the lines of code I changed, in case you wish to include it in an update.

Still fairly new using GitHub, and I always get confused with the push/pull/whatever stuff.

Thanks @Ninjamonkey1982. I added an option to disable “Device Delayed” notifications. Great for people that only want to use the device ONLINE / OFFLINE status to determine if a device is working or not.

What setting do I need to configure to have the hub offline send me an SMS? Under settings, I have checked the box for “send notification if hub offline” and use online/offline status and added my phone number. When I unplug the hub to test, I get nothing… Please help.

Hey Shane, I just did some tests and it seems to be working for me. There are some other configuration options in the app that may need to be set. Like, you need to set a check interval and or check the option to run a check when a device sends an event. If you don’t have any other devices selected, I think you will probably need to use the interval.

If it still isn’t working, report back with all the settings you have configured in the app.


I have the First Alert 2-in-1 Z-Wave Smoke Detector & Carbon Monoxide Alarms - and when I add them to the Device Monitor I always get notifications that they are not reporting. But when I look in Smart things they are online. I’m guessing because they don’t really “check in”??

So I just selected the option “Use Online/Offline status if available”.

Will that stop them from reporting ?


.oops none of my business

It should. The app looks to see if you have that option enabled and then checks to see if the device is reporting ONLINE / OFFLINE. If it is, it uses that status to report whether it is dead or not. It still looks at the last event to calculate when the last check-in was, but that is only used in the status screen.

{EDIT} - i just figured out my API.smarthings.com is out of sync with my mobile account. troubleshooting this. Explains much of my problem, but much of what I ask below, still is valid… thanks in advance!)

OK I must be a complete nimrod. I keep seeing all these apps. I try "installing’ webcore, i followed the instructions, get to a point where there is an app on my phone, but no web service to use etc… I Was able to fork this to my account, log in to smartthings (and WHY is it for the 7th time I had to enable github integration??) I was able to see a much of new items in the list… Um , now what?

I used to write automation scripts, so you would think I could follow along how to get this all to work… but what the hell am I missing here? after I finish the fork, I don;t see any instructions what to do.

do i check all these boxes? Then what? I keep seeing these apps / abilities, but no idea how to use them.

Feeling like a complete fool, lost in this all. It seems like I missed something obvious that everyone else knows??
thanks for the hand holding… I want to get this working, and hopefully will be the first thing I get TO work…

If you integrate my github account in the SmartThings IDE, then the Device Monitor app should show up in the list you showed above.

The other option is to just copy the code from github and paste it as a new app in the SmartThings IDE.

1 Like

Everywhere I looked I saw that this application can report/notify me if a smart device goes offline. While it seems like I receive text messages if a device is not reporting, it takes a while for the message to be sent. The settings don’t seem to allow anything faster than 5 minutes. I have a smart outlet that I would like to know ASAP if it loses power. The SmartThings app seems to know almost right away about it, so this tells me the capability to detect offline status in “real time” is available. Am I missing a setting somewhere?

I don’t think the SmartThings system sends an event when a device goes offline so there is no way for a third party app to get notified instantly.

1 Like

I will have to test again, but i think in the smartthings app the device appears as being disconnected relatively fast, at least faster than 5 minutes… Maybe it is indeed not possible to get something close to immediate alert, it just seems like 5 minutes is a long time. If i lose power, i need to make sure i have a UPS capable to keep my internet connection and smartthings hub active for quite a while. I didn’t want to rely on that so i was hoping there was something that would provide a faster response.

Yeah, the SmartThings app is probably instant, but I don’t think they have provided third party SmartApp developers a way to get an instant event when a device goes offline.

I was wondering if there was an option to change the duration from hours to minutes to consider if an object is inactive?

Great App!

I believe if you change line 466 from:

def hours = (((rightNow.time - lastTime) / 60000) / 60)


def hours = (((rightNow.time - lastTime) / 60000))

It would accomplish that. Your device is going to have to send reports every minute and you are going to have to check the devices every few minutes to get that kind of granularity. To prevent load on the system I don’t recommend changing the “Minimum time between checks” to less than 15 minutes though.

I’ve searched on this, but perhaps I’m not entering the right criteria to find the info I’m seeking. Yesterday, I was surprised to log in the new SmartThings app where SmartThings Home Monitor appears at the top above each of the rooms in my home. It had “one of your sensors is offline”. If this is known in the app obviously a notification can be sent so where am I missing the setting for this? I’m notified for detection on my leak(ST), smoke (ecolink firefighter) and motion (ST) sensors so I have it set up, just missing where to set for device offline notification. This Device Monitor SmartApp doesn’t have any recent posts, but I’m wondering if this is still the best way to be notified of such events as device offline or low battery? I’m still baffled how the battery went from 67% to dead in a day on a leak sensor. Happens more than I’d like on my multipurpose sensors. I’m completely OCD (multiple floods not to mention run of the mill leaks) about checking the battery levels on these leak sensors so will happily use the Device Monitor but am just curious if there is support now in the app I’m completely missing. TIA.

As far as I know, SmartThings doesn’t have anything built in. I still use the app as it is fairly simple and works well.

1 Like