Reference device by name not id

Posted on
Sat Feb 25, 2023 2:39 am
siclark offline
Posts: 1961
Joined: Jun 13, 2017
Location: UK

Reference device by name not id

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.

Posted on
Sat Feb 25, 2023 8:32 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Reference device by name not id

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

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests