There is a new API and subscription type for health status of devices (‘offline’ status) in the next-gen SmartThings platform. I suspect this would be the best way to query for this data going forward with SmartThings killing off Groovy and its associated way of checking health status.
I believe you could query the API endpoint directly in an HTTP Action, but of course that would require polling the endpoint. If there’s enough interest in it, I believe we could build the event driven version of it natively into SharpTools.
Not sure if others need it or not. I just have a flaky Z-Wave water valve (Watercop version) that drops off. I even tried to get a new faceplate, but “supply chain issues” they can’t help right now.
I think this would be helpful. A lot of us use the Notify Me When(?) SmartThings app to check if something is offline and since it’s Groovy it’s probably going away. It would be nice to have a way to check offline status. If some of my devices go offline, it usually means that the breaker switch tripped in the garage and I need to check ASAP because otherwise the stuff in the freezer will melt!
That’s an option. However, it requires that another app be running all the time on a computer connected to the internet, something for which I can’t guarantee.
Yes, the inability of ST to send requests to non-local endpoints is frustrating and somewhat mystifying, and is the reason that driver requires the intermediate “edgebridge” running on a RPi or such.
For now, here’s a simple SharpTools flow to get the status of an individual device. You only need the DeviceID (which you can get from my.smarthings.com by clicking on an individual device in that window and an access token which you can get from https://account.smartthings.com/tokens
This flow can easily be looped to repeat at regular intervals.
ETA: I included the “Set Variable” action only to show the specific value for the $context.response.data variable. You don’t necessarily need to do this.
Thanks for this info!
Is there a way to pull a list of DevID’s or is it simply a manual (look at IDE / write it down / add to ST Rule’s GET) process, repeated for each device in the network?
You can make a GET request to https://api.smartthings.com/v1/devices (along with an Authorization header and Bearer token), which will give you detailed information about all of your devices, including the the deviceId and name for each of them (in JSON format).
You can then parse the JSON response however you choose to create a comprehensive list of IDs and names. I have way too many devices and am too lazy to get the IDs one at a time.
That’s a good idea. I haven’t messed with the CLI too much, as I’ve been primarily focused on being sure I was in good shape for the groovy deprecation. Just as an aside, I parsed the JSON output from the GET request in Excel as well using Data | Get Data | From File | From JSON. It made the process simple.
It sounds like those are your two events. Or at least one event with delays in the rule.
trigger - circ pump turns off
flow - wait 20 minutes, turn circ pump on, wait 5 minutes, turn circ pump off
Sounds kind of important though, so I might add a separate rule as a backup. Maybe triggers on the circ pump staying on or off longer than you expect as a failsafe. Or use a daily check at a certain time with an if condition to see if it’s stayed on or off for too long and restart things.