Would like to check device every XX minutes for offline status

Yes, the general syntax is

https://api.smartthings.com/v1/devices/“my device ID”/command

1 Like

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. :smirk:

1 Like

If you hate JSON as much as I do, you can parse the CLI output:

smartthings devices:status > foo.csv

Open the csv in Excel and do a Text to Columns using │ as the delimiter. It’ll wind up like this:

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.

I’ll have to try that! Parsing the output is often the biggest pain!

They are also available in SharpTools.

  1. Open your User Page
  2. Tap the … next to your location
  3. Scroll down and tap on your device
  4. Flip the advanced toggle on and review the Device ID field*

*One exception here is multicomponent devices which show in the format deviceId:componentId

1 Like

It’s very quick and simple to do in Excel, although if you’re new to parsing JSON this way it might not be entirely intuitive. This video might help.

1 Like

I set this method up for a loop. This seems to be exactly what I was looking for. Thanks!

1 Like