August 5, 2018, 6:06pm
I’m looking to get the reported activity for a particular device from the Smartthings REST API (
Purpose: I have a basement ejector pump that likes to sometimes get stuck. I have a shock sensor attached to a pipe that triggers when the pump engages. I’d like to poll the device and know if it hasn’t triggered for a particular period and create an alert so that I know the float switch might be stuck.
As far as I’m concerned, getting the last activity value for a device from the API would be the easiest way for me to apply this solution. However, I don’t see anything in the documentation that will display a device’s Last Activity (like in the IDE).
Can you not use the simple device viewer smartapp? It’s very popular for similar use cases.
Allows you to easily see a list of information about your devices like battery percentages, temperatures, how long since last event, switch state, etc.
Receive Push and/or SMS notifications based on temperature, battery level, and/or time since last event.
New Dashboard Feature allows you to view all your device information using any web browser. See the
Version 2.0 Release Notes for more information.
It can automatically poll the devices at a specified interval.
Turn Off All Lights and/or Switches with a push of a button.
The first time you open the application, I recommend hitting Done as soon as you see the Setup screen because if you back out of the app instead of hitting Done, the app won’t install and you’ll have to reconfigure everything.
The Setup screen allows you to choose…
You can also use Device monitor.
2017-06-08 - Update: Added support for new Ask Alexa features: Message Queue, message expiration, and message overwriting.
2017-03-11 - Update: Added the ability to be notified if your Hub goes offline / online.
2017-03-08 - Update: Added support for SmartThings “Health Check” capability. If the device supports it, Device Monitor will look at the online/offline status of the device. This can be more accurate than looking at events sent by the device.
2016-09-06 - Update: Added support for
2016-08-22 - Update: I have made a few changes. I am using a more accurate event detection, battery levels can be checked, and you can be notified when devices come back online. Check post 63 for more info.
This app checks the selected devices to determine if they are communicatin…
August 7, 2018, 3:20am
Excellent suggestions, thank you.
While Device Monitor appears it will do the trick in some fashion, I was still hoping I could use the API to view the last update timestamp. The reason being is that I would like to tie the alerts into a real notification system like PagerDuty.
If you don’t have a device forcing an update, the last update timestamp won’t change. You can’t do this all from the API.
August 11, 2018, 12:48am
I don’t want the lastUpdate value to change. I just need to be able to read
something that tells me what the lastUpdate timestamp was for the device.
One would expect this information to be contained in the /devices//status output of the REST API, but I only see the current device state… not lastUpdate or lastActivity…