[ANSWERED]: API for device power load, temperature, etc

Posted on
Sun Nov 16, 2014 12:16 pm
KostasV offline
Posts: 39
Joined: Nov 16, 2014
Location: London, UK

[ANSWERED]: API for device power load, temperature, etc

Hello everyone,

I'm new to indigo, migrated recently from another controller (Fibaro HCL) and love the flexibility of indigo and want to experiment a bit with the API a bit...

I have read through the API documentation and I can get the"basic" device functionality, turn it on/off or view if it is on/off (crucial for motion sensors, window sensors, etc).

What I can't see is the "extra" information, for example I have a TZ88E power module and I want to get the power consumption via the API, is that possible? The same with the temperature read from the thermometer inside the Fibaro Window Sensors. Do I need to do something extra to get this 'active' (e.g. script and expose these parameters within the indigo server?

Many thanks!

Kostas

Posted on
Sun Nov 16, 2014 1:09 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: API for device information like power load, temperature,

From the Indigo scripting shell (Plugins->Open Scripting Shell menu item) you can introspect the entire device object.

After you copy the device ID to the clipboard (right-click on it and choose Copy ID menu item), from the shell try:

Code: Select all
dev = indigo.devices[1315923554]    # your device ID in brackets
print(unicode(dev))

From there you can see that the energy information is accessible via:

Code: Select all
dev.energyAccumTotal
dev.energyCurLevel

And temperature should be in the states dict:
Code: Select all
dev.states["sensorValue"]
dev.states["sensorValue.ui"]

Image

Posted on
Sun Nov 16, 2014 1:44 pm
KostasV offline
Posts: 39
Joined: Nov 16, 2014
Location: London, UK

Re: [ANSWERED]: API for device power load, temperature, etc

Thanks Matt for quick response!

Is there a way to expose this information through the REST API?

Posted on
Sun Nov 16, 2014 1:47 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: [ANSWERED]: API for device power load, temperature, etc

Not directly, but adding it is definitely on our feature request list.

A workaround would be to create an Indigo trigger which executes an action or script that mirrors the values into Indigo variable values (you create beforehand), which would be accessible via the RESTful API.

Image

Posted on
Sun Nov 16, 2014 1:50 pm
KostasV offline
Posts: 39
Joined: Nov 16, 2014
Location: London, UK

Re: [ANSWERED]: API for device power load, temperature, etc

Much appreciated Matt! You guys are so solid in supporting your users!

Once I get some time I will write about the migration from HCL to indigo 6...!!!!

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest