Reference device by name not id

Share your macOS, iOS, and iPadOS shortcuts here. Post your shortcut in a new topic and be sure to describe thoroughly (screenshots, full text of any scripts, apps used, etc).
siclark
Posts: 2282
Joined: Tue Jun 13, 2017 5:08 am
Location: UK

Reference device by name not id

Post by siclark »

Is there a way with the new API to reference devices by name not ID. For instance the way I’m using ChatGPT I get a name of a device and use that to pass to indigo for action.
I can have a generic code that works for all devices of a type without having to code each specific device.
Having to use ID I would now have to handle each device individually.
Is there a way to include a lookup table in Shortcuts?
Otherwise I think I would need to migrate to python.
User avatar
jay (support)
Site Admin
Posts: 19202
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Reference device by name not id

Post by jay (support) »

Using names in programmatic APIs is usually a bad idea since the name can change over time, and it's often hard to track down issues that arise from a name change.

Can you be more explicit about what you are currently doing? Maybe some screenshots of your shortcut to we can see what it is currently doing? More context around your solution would help us better understand the need.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
Post Reply

Return to “Apple Shortcuts”