jason0x43 / hacs-hubitat

A Hubitat integration for Home Assistant
MIT License
196 stars 48 forks source link

Honeywell T6 Pro Z-wave shows reversed cool/heat setpoints in HA Thermostat #73

Closed clboles closed 3 years ago

clboles commented 3 years ago

I've just moved from Nest to Honeywell T6 Pro Z-wave thermostats. The states are reported properly in Hubitat, but when I try to use the Thermostat card in Home Assistant, the cool and heat setpoints are reversed, causing the card to not work very well.

Here is the state info from Hubitat:

battery : 95
coolingSetpoint : 73.0
heatingSetpoint : 70.0
humidity : 55
temperature : 73.0
thermostatFanMode : auto
thermostatMode : auto
thermostatOperatingState : idle
thermostatSetpoint : 73.0

And here are the state attributes from Home Assistant:

hvac_modes:
  - heat
  - heat_cool
  - cool
  - 'off'
min_temp: 45
max_temp: 95
fan_modes:
  - 'on'
  - auto
preset_modes:
  - home
  - away
current_temperature: 73
temperature: null
target_temp_high: 70
target_temp_low: 73
current_humidity: 55
fan_mode: auto
hvac_action: idle
preset_mode: home
friendly_name: Master Bedroom Thermostat
supported_features: 27

Notice target_temp_high is the heat value, and target_temp_low is the cool value.

Is there any additional info I can provide to help debug this?

Thanks!

clboles commented 3 years ago

In climate.py, perhaps this is where the swap is happening. Notice if mode is cool, it's returning the heating setpoint (and vice versa).

    @property
    def target_temperature_high(self) -> Optional[float]:
        """Return the highbound target temperature we try to reach."""
        if self.hvac_mode == HVAC_MODE_HEAT_COOL or self.hvac_mode == HVAC_MODE_AUTO:
            return self.get_float_attr(ATTR_HEATING_SETPOINT)
        return None

    @property
    def target_temperature_low(self) -> Optional[float]:
        """Return the lowbound target temperature we try to reach."""
        if self.hvac_mode == HVAC_MODE_HEAT_COOL or self.hvac_mode == HVAC_MODE_AUTO:
            return self.get_float_attr(ATTR_COOLING_SETPOINT)
        return None

When I correct these lines in my custom_components dir, the target temperatures are displayed correctly in HA.

jason0x43 commented 3 years ago

Resolved by #74