Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

HASS CT32 thermostat C vs F [bug] #731

Closed
ve6rah opened this issue Sep 16, 2020 · 10 comments · Fixed by #732
Closed

HASS CT32 thermostat C vs F [bug] #731

ve6rah opened this issue Sep 16, 2020 · 10 comments · Fixed by #732
Assignees
Labels
bug Something isn't working

Comments

@ve6rah
Copy link

ve6rah commented Sep 16, 2020

Version

Zwave2Mqtt version: 3.2.2
Openzwave Version: 1.6.974

Describe the bug
This thermostat zwave communication works completely in Fahrenheit regardless of it's display setting, and regardless of the unit used in HASS. As a result, the MQTT parameter "temperature_unit": "F" must be set for this thermostat to work properly within a celsius setup, however by default that parameter is not set and must be configured manually.

Additional context
As this is an MQTT parameter that needs setting, I put this here, however if this is something that needs to be set in OpenZwave rather than in Zwave2Mqtt let me know and I'll move this bug.

@ve6rah ve6rah added the bug Something isn't working label Sep 16, 2020
@chilicheech
Copy link
Contributor

From what I understand the temperature unit is reported in 49-1-256 and 49-2-256 for the CT32, and the only value it supports is Fahrenheit.
Screen Shot 2020-09-16 at 1 12 17 PM
Here's my mqtt value for 49-1-256

{
  "value_id": "31-49-1-256",
  "node_id": 31,
  "class_id": 49,
  "type": "list",
  "genre": "system",
  "instance": 1,
  "index": 256,
  "label": "Instance 1: Air Temperature Units",
  "units": "",
  "help": "Air Temperature Sensor Available Units",
  "read_only": false,
  "write_only": false,
  "min": 0,
  "max": 0,
  "is_polled": false,
  "values": [
    "Fahrenheit"
  ],
  "value": "Fahrenheit",
  "lastUpdate": 1599579139341
}

And it sets the units correctly for 49-1-1 as far as I can tell:

{
  "value_id": "31-49-1-1",
  "node_id": 31,
  "class_id": 49,
  "type": "decimal",
  "genre": "user",
  "instance": 1,
  "index": 1,
  "label": "Instance 1: Air Temperature",
  "units": "F",
  "help": "Air Temperature Sensor Value",
  "read_only": true,
  "write_only": false,
  "min": 0,
  "max": 0,
  "is_polled": false,
  "value": 76,
  "lastUpdate": 1600285031819
}

Where do you see a temperature_unit parameter in MQTT?

@chilicheech
Copy link
Contributor

Having said the above, this is what my hass discovery payload looks like:

{
  "min_temp": 50,
  "max_temp": 85,
  "modes": [
    "off",
    "heat",
    "cool"
  ],
  "fan_modes": [
    "auto",
    "on"
  ],
  "action_topic": "z2m/31/66/1/0",
  "action_template": "{{ value_json.value | lower }}",
  "current_temperature_topic": "z2m/31/49/1/1",
  "current_temperature_template": "{{ value_json.value }}",
  "fan_mode_state_topic": "z2m/31/68/1/0",
  "fan_mode_command_topic": "z2m/31/68/1/0/set",
  "mode_state_topic": "z2m/31/64/1/0",
  "mode_command_topic": "z2m/31/64/1/0/set",
  "temperature_state_template": "{{ value_json.value }}",
  "temperature_command_topic": "z2m/31/67/1/2/set",
  "mode_state_template": "{{ {\"Off\":\"off\",\"Heat\":\"heat\",\"Cool\":\"cool\"}[value_json.value] | default(off) }}",
  "temperature_state_topic": "z2m/31/67/1/2",
  "fan_mode_state_template": "{{ {\"Auto Low\":\"auto\",\"On Low\":\"on\"}[value_json.value] | default(auto) }}",
  "precision": 0.1,
  "device": {
    "identifiers": [
      "zwave2mqtt_0xc5b5c9e5_node31"
    ],
    "manufacturer": "2GIG Technologies",
    "model": "CT32 Thermostat (0x0100)",
    "name": "thermostat",
    "sw_version": "10.00"
  },
  "name": "thermostat_thermostat",
  "unique_id": "zwave2mqtt_0xc5b5c9e5_Node31_thermostat"
}

It looks like earlier this year home assistant added a temperature_unit field that we can use to indicate the temperature unit. So, maybe some code can be modified to add this temperature_unit based on the value of 49-1-256.

home-assistant/home-assistant.io@2ace9da#diff-625e9ea00be05683afe954db07a3afe3

@ve6rah
Copy link
Author

ve6rah commented Sep 16, 2020

You are correct that it only supports Fahrenheit, the problem is that HASS doesn't know this unless we explicitly tell it so using the temperature_unit parameter. without that, it takes the values that are sent (unitless) and expects them to be whatever your system unit is set to (in my case C). The end result is that HASS thinks the thermostat is set to 70C instead of 21C which is incorrect.

@chilicheech
Copy link
Contributor

chilicheech commented Sep 16, 2020

Here's what's in the home assistant UI:
Screen Shot 2020-09-16 at 1 38 16 PM
Here's some docs:
https://www.home-assistant.io/integrations/climate.mqtt/
https://www.home-assistant.io/docs/mqtt/discovery/

@ve6rah
Copy link
Author

ve6rah commented Sep 16, 2020

Adding "temperature_unit": "F" fixes the issue and HASS reports the values in C correctly, despite the zwave communication being in F

@chilicheech
Copy link
Contributor

Can you update your description to indicate that this is an issue related to HASS and not OZW?

@ve6rah ve6rah changed the title CT32 thermostat C vs F [bug] HASS CT32 thermostat C vs F [bug] Sep 16, 2020
@chilicheech
Copy link
Contributor

We should make this a more generic feature, not specifically tied to the CT32 thermostat. Let's see what @robertsLando thinks.

@ve6rah
Copy link
Author

ve6rah commented Sep 16, 2020

Agree. I guess I just assumed that other ones already were doing this (but I didn't check).

@robertsLando
Copy link
Member

So, maybe some code can be modified to add this temperature_unit based on the value of 49-1-256.

I think that's the correct way to do that. Let me make a PR for this

@robertsLando
Copy link
Member

@chilicheech Could we also use temperature valueid units to do this? Or should we use the valueid 49-1-256? Because AFAIK not all devices support that valueid and using the units of the temperature could be easier in this case

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants