Plugin State

Posted on
Wed Sep 25, 2013 10:53 am
jd10884 offline
Posts: 39
Joined: Feb 18, 2012

Plugin State

Good day,

Can you tell me, if it is possible, how to get the state of a plugin device? For example if you have a plugin device that displays temperature in the state column in devices, how would you get that temp to use in a script? I know if you have a device such as a lamp you would just get it's on state but I can't find a reference to what I am looking for.

thanks in advance!

Jeff

Posted on
Wed Sep 25, 2013 11:26 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Plugin State

It actually depends on what the device type is. For instance, if it's a custom plugin device, you get it from the device's states (which are shown in the UI when you select the device in the control area in a tile called "Custom States"):

Code: Select all
d = indigo.devices[123]
myTemp = d.states["tempStateIdHere"] # in the states dictionary, get the value for the tempStateIdHere key


Plugins will control what's shown in the State column in the device list if it's a custom device.

If it's a sensor type device, then you can get it from the sensorValue property:

Code: Select all
d = indigo.devices[456]
myTemp = d.sensorValue


Check the IOM reference for details on all device types, their properties and states, etc.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Sep 25, 2013 2:14 pm
jd10884 offline
Posts: 39
Joined: Feb 18, 2012

Re: Plugin State

Thanks Jay for your Help it is greatly appreciated.

Jeff

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests