Example Thermostat in IndigoSDK

Forum rules

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo

Posted on
Mon Jun 11, 2012 10:42 am
bschollnick2 offline
Posts: 1355
Joined: Oct 17, 2004
Location: Rochester, Ny

Example Thermostat in IndigoSDK

Matt, and Jay,

I am looking at updating the Thermostat Enhancement plugin, into a "single" device. Currently it monitors for an Thermostat Adapter (e.g. Venstar adapter), and monitors it for changes, and stores it's data in the Thermostat Monitor device...

But with the IndigoSDK, it looks like I can modify and inherit the standard thermostat device....

But, there's one issue. There no way to view the non-standard states? Am I missing something?

I have the standard temperature controls, etc... But I can't find any way to display the other state information...

- Ben

------
My Plugins for Indigo (v4, v5, and v6) - http://bit.ly/U8XxPG

Security Script for v4 - http://bit.ly/QTgclf
for v5 - http://bit.ly/T6WBKu

Support Forum(s) - http://www.perceptiveautomation.com/userforum/viewforum.php?f=33

Posted on
Mon Jun 11, 2012 11:21 am
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Example Thermostat in IndigoSDK

State information is available everywhere devices states are exposed (triggers, conditions, control pages, etc). The exception is that the control area of the home window contains the built-in controls for the device rather than the state list like custom devices show.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Jun 11, 2012 11:39 am
bschollnick2 offline
Posts: 1355
Joined: Oct 17, 2004
Location: Rochester, Ny

Re: Example Thermostat in IndigoSDK

jay (support) wrote:
State information is available everywhere devices states are exposed (triggers, conditions, control pages, etc). The exception is that the control area of the home window contains the built-in controls for the device rather than the state list like custom devices show.


Exactly.

I didn't say that the states weren't available, just that they weren't visible in the device's UI.

My issue is, how am I suppose to be able to show this information to the user?

That state information, needs to be visible to the user...

------
My Plugins for Indigo (v4, v5, and v6) - http://bit.ly/U8XxPG

Security Script for v4 - http://bit.ly/QTgclf
for v5 - http://bit.ly/T6WBKu

Support Forum(s) - http://www.perceptiveautomation.com/userforum/viewforum.php?f=33

Posted on
Mon Jun 11, 2012 12:12 pm
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Example Thermostat in IndigoSDK

And it can be - on a control page. Most users don't use the Mac Client as part of their daily operation - they use Indigo Touch or IWS control pages (or just have their automation run automatically).

We'll consider it for future versions but we're gonna need to see a lot more demand for it.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Jun 11, 2012 1:15 pm
bschollnick2 offline
Posts: 1355
Joined: Oct 17, 2004
Location: Rochester, Ny

Re: Example Thermostat in IndigoSDK

jay (support) wrote:
And it can be - on a control page. Most users don't use the Mac Client as part of their daily operation - they use Indigo Touch or IWS control pages (or just have their automation run automatically).

We'll consider it for future versions but we're gonna need to see a lot more demand for it.


Unless something has changed with IWS, I don't think that will be a viable option, simply because it can't be pre-bundled. The Indigo user would have to create the Control page, since it can't be imported or pre-bundled with the plugin.

At this point, I don't see any advantage in updating this to a single device...

------
My Plugins for Indigo (v4, v5, and v6) - http://bit.ly/U8XxPG

Security Script for v4 - http://bit.ly/QTgclf
for v5 - http://bit.ly/T6WBKu

Support Forum(s) - http://www.perceptiveautomation.com/userforum/viewforum.php?f=33

Posted on
Mon Jun 11, 2012 1:59 pm
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Example Thermostat in IndigoSDK

Up to you of course - the real question is whether requiring users to build control pages to control your custom device is more cumbersome than building control pages to show the extra state data.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Jun 11, 2012 5:09 pm
matt (support) offline
Site Admin
User avatar
Posts: 21429
Joined: Jan 27, 2003
Location: Texas

Re: Example Thermostat in IndigoSDK

Keep in mind we definitely do have plans on making plugin device UI (both custom devices and subclassed devices) available from Indigo Touch. But that is still pretty far out, likely Indigo 6+.

Image

Posted on
Mon Jun 11, 2012 7:50 pm
Swancoat offline
Posts: 503
Joined: Nov 20, 2009
Location: Houston

Re: Example Thermostat in IndigoSDK

FWIW, I built a couple of plugins and they give you the option to creat your device as type "custom" (with my custome states visible), or as "Relay", (Where the custom states are not visible, but with the added advantage of being able to use the native controls in Indigo Touch).

For me, this second choice has turned into an acceptable compromise. I usually use the custom states just to control the device, or make a rule, and don't need to 'see' them in the main Indigo window.

YMMV

http://nerdhome.jimdo.com

Posted on
Fri Jun 15, 2012 3:11 pm
bcall offline
Posts: 59
Joined: May 17, 2012

Re: Example Thermostat in IndigoSDK

Are the states for the standard devices enumerated somewhere?

My plugin is creating relays, dimmers and thermostats and I'd like to use the indigo devices so I get the indigo UI for them. I've found "onOffState" as a state for relays by looking through Berkinet's meta plugin, but I'm hoping all of the states for each device type are enumerated in one place.

Also, I've seen mention of a standard irrigation device type. Is this still in the works?

Note: I've seen in the plugin Dev guide that the relay as one state(on/off) and the dimmer has two (on/off and brightness). But it doesn't give the exact state names, which it appears are 'onOffState' for both and 'brightness' for dimmer (though the custom device tutorial indicates that the 'brightness' state is not writeable)? The device tutorial also lists states for the thermostat but indicates they are not writeable as well.

Update:
It looks like the meta plugin also has the dimmer state brightnessLevel. It does not appear to update the dimmer's on/off state. Is it necessary to update the on/off state for a dimmer or does indigo handle that automatically when brightnessLevel is updated?

Also, it looks like the thermostat states can be retrieved from the filtrete plugin.

Posted on
Fri Jun 15, 2012 3:50 pm
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Example Thermostat in IndigoSDK

The IOM Reference contains all object definitions including devices such as dimmers, relays, and thermostats. Be sure not to skip the device base class as it has the common properties to all devices.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Jun 15, 2012 4:09 pm
bcall offline
Posts: 59
Joined: May 17, 2012

Re: Example Thermostat in IndigoSDK

I may be confused, or not stating my question clearly, but the documents you're referencing don't seem to give the information I need. Those docs give the properties of the devices and methods for changing those properties when indigo is actually in direct control of the respective devices.

What I'm looking for are the states that I need to update (using dev.updateOnServer) when my plugin is in direct control of the device.

For example, the thermostat property 'hvacMode' is referred to in the documents you reference. But, if my plugin wants to update the applicable state (without having indigo send a command), I use updateOnServer for the state 'hvacOperationMode'. I retrieved this state from the filtrete plugin. It's these states (the ones my plugin can update via updateOnServer) that I'm looking for.

Posted on
Fri Jun 15, 2012 4:10 pm
matt (support) offline
Site Admin
User avatar
Posts: 21429
Joined: Jan 27, 2003
Location: Texas

Re: Example Thermostat in IndigoSDK

Additionally, look at the Devices.xml files for all of the Example plugins -- they have comments that show all of the states defined along with some other useful notes. I thought that changing the brightnessLevel would also change the onState appropriately, but if that isn't what you are seeing then just handle it manually in the plugin.

The irrigation/sprinkler device type is not yet available for plugins, but will be eventually. I'm not quite sure when yet though...

Image

Posted on
Fri Jun 15, 2012 4:19 pm
bcall offline
Posts: 59
Joined: May 17, 2012

Re: Example Thermostat in IndigoSDK

Thanks. I'll check out the device.xml files. I haven't yet implemented the dimmer state changes, I wanted to understand it a little better first. I'm sure the dimmer on state gets updated though because the meta plugin works well.

I'm looking forward to accessing the irrigation device type UI from my plugin. Though I have to say, the extensive nature of what you guys have created already is truly amazing. :)

Posted on
Fri Jun 15, 2012 4:34 pm
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Example Thermostat in IndigoSDK

Yep, you're right. You'll need to look at the Devices.xml files in each of the example plugins in the SDK. They are well documented and should contain all of the states you need to use in updateStateOnServer().

We're lagging a bit in documenting some functionality in the API but the examples should always be the fallback. ;)

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Jun 15, 2012 4:51 pm
bcall offline
Posts: 59
Joined: May 17, 2012

Re: Example Thermostat in IndigoSDK

There's so much in the way of functionality here, it's no surprise that the documentation is a little behind. :)

If you're a fan of the original Star Trek...this process makes me feel very much like Dr. McCoy in the episode "Spock's Brain." Moments of great clarity followed by a feeling of utter confusion!

Who is online

Users browsing this forum: No registered users and 2 guests