For Each Loop on Array

I am curious, has anyone found a method in Rule to perform a For/Each loop?

Effort…

I have 100 devices, which, thanks to the input here, I have been able to make an API web call to SmartThings and gather the ONLINE/OFFLINE state. For now, I have checked a handful of devices (particularly the battery operated ones).

It would have been a whole lot easier to put all the device GUIDs into a Array and then perform a loop on the API URL, inserting each GUID vs doing each call, one at a time.

I wasn’t even aware of using HTTP to call the SmartThings API, so maybe I missed a similar discussion elsewhere.

Hey Cory! I wasn’t sure if you saw the Labs: SmartThings Health and Battery Reports post but it does exactly this for offline status (or battery level) in SmartThings! :sunglasses:

Thank you very much for the follow up!

I haven’t had a chance to dig in yet, as I’m going through another round of capacitor plagued GE switches. Once I get them back online and replaced, I plan on checking this out!

1 Like