Page 1 of 1

Script to get device name for all device IDs

PostPosted: Wed Feb 07, 2018 5:38 pm
by siclark
Hi, pretty much as the title says, is there an easy way to get a list of all device names and IDs. I am looking to query data from my postgresql db which has a table per device id, and I wanted an easy way to identify what table name was from a more convenient list of device names.

Re: Script to get device name for all device IDs

PostPosted: Wed Feb 07, 2018 6:29 pm
by Colorado4Wheeler
Try this
Code: Select all
for dev in indigo.devices:
   indigo.server.log (str(dev.id) + "\t" + dev.name)

Re: Script to get device name for all device IDs

PostPosted: Wed Feb 07, 2018 9:29 pm
by kw123
Indigo utilities has a menu item for it with some more info including list of states ...


Sent from my iPhone using Tapatalk

Re: Script to get device name for all device IDs

PostPosted: Wed Feb 07, 2018 10:34 pm
by jay (support)
Code: Select all
[(dev.id, dev.name) for dev in indigo.devices]