Adding compatibility layer for VeraThermostat to allow thermostats with Heat and Cool setpoints working with Home Assistant.
(At least) my Honeywell thermostat manages cool and heat temperatures independently.
Setting a new value is done via urn:upnp-org:serviceId:TemperatureSetpoint1_Cool and urn:upnp-org:serviceId:TemperatureSetpoint1_Heat, not urn:upnp-org:serviceId:TemperatureSetpoint1. This pair already declared but not used in pyvera.
Actual values are returned in dev_info as coolsp and heatsp, not setpoint.
My change looks at the presence of "setpoint" in device_info, if it's there then there is no change in how pyvera behaves.
If no, but there are "coolsp" and "heatsp", then it use these values to retrieve setpoints, and urn:upnp-org:serviceId:TemperatureSetpoint1_Cool and urn:upnp-org:serviceId:TemperatureSetpoint1_Heat to update it. Which one is chosen depends on the mode the thermostat is running in (I admit, it has its week sides, though it allows properly controlling of thermostat without changing Home Assistant and existing controls). Though of course I am open for suggestions!
I tested it with my own thermostat, just replacing in stock pyvera with my changed one made Thermostat control perfectly functioning!
Adding compatibility layer for VeraThermostat to allow thermostats with Heat and Cool setpoints working with Home Assistant.
(At least) my Honeywell thermostat manages cool and heat temperatures independently.
Setting a new value is done via urn:upnp-org:serviceId:TemperatureSetpoint1_Cool and urn:upnp-org:serviceId:TemperatureSetpoint1_Heat, not urn:upnp-org:serviceId:TemperatureSetpoint1. This pair already declared but not used in pyvera.
Actual values are returned in dev_info as coolsp and heatsp, not setpoint.
My change looks at the presence of "setpoint" in device_info, if it's there then there is no change in how pyvera behaves. If no, but there are "coolsp" and "heatsp", then it use these values to retrieve setpoints, and urn:upnp-org:serviceId:TemperatureSetpoint1_Cool and urn:upnp-org:serviceId:TemperatureSetpoint1_Heat to update it. Which one is chosen depends on the mode the thermostat is running in (I admit, it has its week sides, though it allows properly controlling of thermostat without changing Home Assistant and existing controls). Though of course I am open for suggestions!
I tested it with my own thermostat, just replacing in stock pyvera with my changed one made Thermostat control perfectly functioning!