I'm Being Thick But....

Posted on
Thu Nov 09, 2017 2:59 pm
trevorsmith offline
Posts: 86
Joined: Oct 08, 2016

I'm Being Thick But....

I have just added a Fibaro FGMS-001 multi sensor to my Zwave network. Its seen by Indigo and all is well. However, how do I access the temperature of the device from within a script?

eg

i = int(indigo.devices[12345].what property name goes here))


Its late and I'm probably being thick, but someone please clue me in.

TIA

Come to think of it, how would I access the Lux level it can report, too?

Posted on
Thu Nov 09, 2017 5:06 pm
DaveL17 offline
User avatar
Posts: 6751
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: I'm Being Thick But....

If you run this script against ANY Indigo device, you'll see a print out of all the information the device has to offer.

Code: Select all
dev = indigo.devices[DEVICE_ID]
indigo.server.log(unicode(dev))
In this case, look at the list of states, and access that value thusly:

Code: Select all
dev = indigo.devices[DEVICE_ID]
indigo.server.log(unicode(dev.states[STATE_NAME]))
STATE_NAME is a string, so be sure to enclose it in quotes. Also, while I used Unicode here, you can access the state value directly (string, float, bool, etc.) Please post back if you have questions.

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

[My Plugins] - [My Forums]

Posted on
Fri Nov 10, 2017 2:07 am
trevorsmith offline
Posts: 86
Joined: Oct 08, 2016

Re: I'm Being Thick But....

Thank you very much.

For those who come later, you need to access the "sensorValue" value to get the temperature from the temp sensor ie:

dev = indigo.devices[DEVICE_ID]
indigo.server.log(unicode(dev.states["sensorValue"]))

Posted on
Fri Nov 10, 2017 5:36 am
DaveL17 offline
User avatar
Posts: 6751
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: I'm Being Thick But....

If you want to do math on the value, replace Unicode with int or float.


Sent from my iPhone using Tapatalk

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

[My Plugins] - [My Forums]

Posted on
Fri Nov 10, 2017 9:52 am
trevorsmith offline
Posts: 86
Joined: Oct 08, 2016

Re: I'm Being Thick But....

Cheers.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests

cron