Example Thermostat SDK

Posted on
Thu Oct 18, 2018 8:15 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Example Thermostat SDK

I discovered via the Example device - Thermostat SDK plugin example that to be able to define multiple sensors, you have to set the property: NumTemperatureInputs.
Likewise, for number of humidity sensors, you have to set the property: NumHumidityInputs.

These properties aren't documented in the ThermostatDevice documentation AFAICS. :)

A minor coding correction method _changeHumiditySensorValue, on line 83 of the plugin:
Code: Select all
      keyValueList.append({'key':stateKey, 'value':value, 'uiValue':"%d °F" % (value)})
should be
Code: Select all
      keyValueList.append({'key':stateKey, 'value':value, 'uiValue':"%d%" % (value)})
However, I am not sure the humidity gets displayed as when you define zero temperature sensors, a default initial temperature value of 66.5 °F is shown when I suspect the humidity value should be shown when (assuming there is at least one humidity sensor defined. :)

Posted on
Thu Oct 18, 2018 9:25 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Example Thermostat SDK

Thanks for the _changeHumiditySensorValue() buglet report. I fixed it but used "%d%%" instead of "%d%" to avoid an error.

You are correct that thermostats always show the temperature input/sensor values as the main state UI, unfortunately even if there are no temperature sensors. I believe the 66.5 you are seeing is a left over state or caching issue and for a newly created device that has NumTemperatureInputs set to 0 it will probably show "unknown."

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 7 guests