[ANSWERED]Finding object names for devices within Python

Posted on
Thu Aug 14, 2014 1:01 pm
skenly offline
Posts: 13
Joined: May 07, 2009
Location: New Hampshire

[ANSWERED]Finding object names for devices within Python

I am trying to access the device state Current Conditions - Temperature from the Wunderground plugin from within a python script. Specifically, what is this field called within python and in more general terms, how do I find this information for any plugin?

Thanks!

Posted on
Thu Aug 14, 2014 1:22 pm
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Finding object names for devices within Python

The most direct route is this:

Code: Select all
dev = indigo.devices[DEVICE ID].states['temp']
You can get an entire list of device states with this:

Code: Select all
dev = indigo.devices[DEVICE ID]
(Send it to the log and look for the states dict)

Code: Select all
Indigo.server.log(unicode(dev))
Last edited by DaveL17 on Sat Aug 16, 2014 5:13 am, edited 1 time in total.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Aug 14, 2014 2:27 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: Finding object names for devices within Python


Posted on
Thu Aug 14, 2014 3:01 pm
jay (support) offline
Site Admin
User avatar
Posts: 18219
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Finding object names for devices within Python

Or, just look at the device states list under the device list in the Home Window when you have a device selected.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Aug 27, 2014 6:51 am
skenly offline
Posts: 13
Joined: May 07, 2009
Location: New Hampshire

Re: Finding object names for devices within Python

Excellent, thanks very much!

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests

cron