|
|
|
Page 2 of 2
|
[ 20 posts ] |
Go to page: Previous 1, 2 |
Example Thermostat in IndigoSDK
| Author |
Message |
|
bcall
Joined: May 17, 2012 Posts: 59
|
 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 |
|
 |
|
jay (support)
Site Admin
Joined: Mar 19, 2008 Posts: 6659 Location: Austin, Texas
|
 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)
|
| Thu Jun 21, 2012 5:10 pm |
|
 |
|
matt (support)
Site Admin
Joined: Jan 27, 2003 Posts: 11692 Location: Texas
|
 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.
_________________
|
| Thu Jun 21, 2012 5:15 pm |
|
 |
|
bcall
Joined: May 17, 2012 Posts: 59
|
 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 |
|
 |
|
matt (support)
Site Admin
Joined: Jan 27, 2003 Posts: 11692 Location: Texas
|
 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.
_________________
|
| Thu Jun 21, 2012 6:45 pm |
|
|
|
Page 2 of 2
|
[ 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
|
|