Hello @jared.rackliff,
There are different ways to achieve what you want.
-
Make requests to the Devices Endpoint of the SmartThings API
You could make a request to the URLhttps://api.smartthings.com/v1/devices?capability=battery
using your Personal Access Token to get the list of all the devices that have the capability “Battery”.
Once you have all the device IDs, make a request tohttps://api.smartthings.com/v1/devices/device-id/status
replacing the device ID for each one of them, and get the current value of the capability. -
Develop a SmartApp
Using a SmartApp, you could subscribe to the events of the “battery” capability for each device or the capability in general, and every time that an event of this capability is generated, you can compare if the value is 20% or lower and know which device has that level.
The difference between them is that with option 1, you can get all the devices installed in your SmartThings account, and with option 2, you can only get the devices in the location where the SmartApp is installed.
Let me know if you have any doubts or if I can help you with something else.