[feat] Add a flag to the devices
command to filter devices by which Hub they're joined to
#588
Labels
devices
command to filter devices by which Hub they're joined to
#588
Is your feature request related to a problem? Please describe.
My specific use-case is probably pretty niche, but I think this could be a valuable filter either way.
I have several locations where I have more than one hub, and I will often have the same devices joined to multiple hubs in the same location. This makes it challenging to determine exactly which device record to isolate when using
smartthings devices
.Here are two examples of where this happens:
Describe the solution you'd like
A
-H
flag or something similar to the capital H flag used in other commands to identify a Hub Device UUID that would only return devices that are joined to the given hub.Describe alternatives you've considered
This doesn't work great because it's a lot of friction/moving around in the app that slows me down. Also, with more and more products having ST Hub functionality built-in, there is certainly going to be more occurrences for multiple hubs in the same location across the fleet. So there's potential value in getting ahead of that.
jq
This gets me part way there. For example, I do have a one-liner I sometimes use that looks like this:
st devices -p production -j | jq -r --arg hub $HUB_UUID '.[] | select(.parentDeviceId == $hub)'
Where this falls down, though, is that I work with a lot of parent-child devices. This is only a top-level filter, meaning I'd have to craft a gnarly pipeline if I wanted to get all the devices joined to my hub plus child devices.
The text was updated successfully, but these errors were encountered: