Script to get device name for all device IDs

Posted on
Wed Feb 07, 2018 5:38 pm
siclark offline
Posts: 325
Joined: Jun 13, 2017
Location: UK

Script to get device name for all device IDs

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.

Posted on
Wed Feb 07, 2018 6:29 pm
Colorado4Wheeler offline
User avatar
Posts: 2351
Joined: Jul 20, 2009
Location: Colorado

Re: Script to get device name for all device IDs

Try this
Code: Select all
for dev in indigo.devices:
   indigo.server.log (str(dev.id) + "\t" + dev.name)

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Wed Feb 07, 2018 9:29 pm
kw123 offline
User avatar
Posts: 5397
Joined: May 12, 2013
Location: Dallas, TX

Re: Script to get device name for all device IDs

Indigo utilities has a menu item for it with some more info including list of states ...


Sent from my iPhone using Tapatalk

Posted on
Wed Feb 07, 2018 10:34 pm
jay (support) offline
Site Admin
User avatar
Posts: 14074
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Script to get device name for all device IDs

Code: Select all
[(dev.id, dev.name) for dev in indigo.devices]

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest