View unanswered posts | View active topics It is currently Thu May 23, 2013 3:58 am



Reply to topic  [ 20 posts ]  Go to page: Previous  1, 2
 Example Thermostat in IndigoSDK 
Author Message

Joined: May 17, 2012
Posts: 59
Post Custom Thermostat missing hvacCoolerIsOn and hvacHeaterIsOn
I've created a custom thermostat device using the following in my device.xml:

<Device type="thermostat" id="myThermoType">

I took this directly from the example custom thermostat in the sdk. The device.xml file in that plugin indicates that my custom thermostat should inherit, among other states, hvacCoolerIsOn and hvacHeaterIsOn. However, when I try to update either of these states I get errors:
Error device state key hvacCoolerIsOn not defined (ignoring update request)
Error device state key hvacHeaterIsOn not defined (ignoring update request)

After looking through the forum, the only discussion of this I've seen is about these states not appearing in older venstar thermostats, which wouldn't apply to me since my thermostat is a custom one. Is there a similar limitation on custom thermostats?


Thu Jun 21, 2012 5:02 pm
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6659
Location: Austin, Texas
Post Re: Example Thermostat in IndigoSDK
Hmmm. The Radio Thermostat plugin updates those states without issue - it's definitely not a limitation in the API.

Can you paste in the code where you do the update? Also, open your DB file and copy/paste in the entire device XML for the device you created.

_________________
Jay (Indigo Support)
Image


Thu Jun 21, 2012 5:10 pm
Profile WWW
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 11692
Location: Texas
Post Re: Example Thermostat in IndigoSDK
That state is automatically added if (and only if) the device has the property ShowCoolHeatEquipmentStateUI set to True. The example plugin provides, in Devices.xml, a checkbox to set that property.

_________________
Image


Thu Jun 21, 2012 5:15 pm
Profile WWW

Joined: May 17, 2012
Posts: 59
Post Re: Example Thermostat in IndigoSDK
I thought there might be something!

Here is my <device> from device.xml with the new checkbox:

<Device type="thermostat" id="ISYThermostat">
<Name>ISY Thermostat</Name>
<ConfigUI>
<Field type="checkbox" id="ShowCoolHeatEquipmentStateUI" defaultValue="true" hidden="true">
<Label/>
<Description/>
</Field>
</ConfigUI>
</Device>

I still don't get the states. I create the device programatically, so maybe the device.xml doesn't get used in that case? Would it work to set device.pluginProps['ShowCoolHeatEquipmentStateUI'] = True in the device.create method?

update: this seems to work:

pDev = indigo.device.create(protocol=indigo.kProtocol.Plugin,
name=thermoName,
deviceTypeId=thermoType,
description=thermoDesc,
props={"ShowCoolHeatEquipmentStateUI":True},
folder=folderId)

Yeah! Thanks for pointing me in the right direction!


Thu Jun 21, 2012 5:46 pm
Profile
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 11692
Location: Texas
Post Re: Example Thermostat in IndigoSDK
Yep, if you are creating it from code then you'll just want to set that prop value as you discovered.

_________________
Image


Thu Jun 21, 2012 6:45 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 20 posts ]  Go to page: Previous  1, 2

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.   Template designed by STSoftware.