ZHA Thermostat

add these lines to homeassistant/const.py file

TIME_MICROSECONDS = "μs"
TIME_MILLISECONDS = "ms"
TIME_SECONDS = "s"
TIME_MINUTES = "min"
TIME_HOURS = "h"
TIME_DAYS = "d"
TIME_WEEKS = "w"
TIME_MONTHS = "m"
TIME_YEARS = "y"

Just to be sure, is it in the root directory where custom_components/configuration.yaml directory resides?

nope, it is where home assistant core files are located.

let’s fix it other way. in zha/core/channels/smartenergy.py replace every occurence of {TIME_HOURS} with just h and {TIME_SECONDS} with s. So https://github.com/Adminiuga/home-assistant/blob/5b87bde0438fbc0f7842398167e1c24b0b5b4106/homeassistant/components/zha/core/channels/smartenergy.py#L78-L92 should look like

    unit_of_measure_map = {
        0x00: "kW",
        0x01: "m³/h",
        0x02: "ft³/h",
        0x03: "ccf/h",
        0x04: "US gal/h",
        0x05: "IMP gal/h",
        0x06: "BTU/h",
        0x07: "l/h",
        0x08: "kPa",
        0x09: "kPa",
        0x0A: "mcf/h",
        0x0B: "unitless",
        0x0C: "MJ/s",
    }

I had to remove the corresponding imports as well, and after that it works. Thanks a lot.

The branch tracking 0.107.x is https://github.com/Adminiuga/home-assistant/tree/ac/new-zha-climate-0.107.x and dev branch still at https://github.com/Adminiuga/home-assistant/tree/ac/new-zha-climate-1.0-ent-reg

Thanks, the branch ac/new-zha-climate-0.107.x works out of the box with hassio 0.107.x

I’ve been using the old presslab code to get my Stelpro Maestros working and it’s been working fine. Decided to give the new branch a try and it breaks it for me. They are still connected because they report humidity, but all of the climate controls are gone. Doesn’t really matter since I have a working version of the old code, but just curious why the new branch breaks it for me.

ac/new-zha-climate-0.107.x works but it does not seem to be handling the fan portion correctly. It only have modes for on and off and it displays a bunch of fan icons in the card below. Any advice?

Btw, this is a Zen thermostat.

@Adminiuga Are any other developer(s) working on getting this merged into upstream core master?

@iamJoeTaylor posted in PR #24549 on GitHub willing help work on fixing blockers and do a new PR:

https://github.com/home-assistant/core/pull/24549

Fan speed not working yet is a known issue with ZHA thermostat that you can read about here:

Odd. It was working perfectly under a previous release. I only wanted to upgrade to take advantage of other enhancements in ZHA. I will wait.

Thanks to everyone for the hard work on this!

Is any work still being done on this? This thread seems to have died and this thread has been closed:

https://github.com/home-assistant/core/pull/24549

It does look like @Adminiuga is still working on ZHA Climate support for Thermostats in his fork:

zigpy also has some recent commits from Adminiuga which mention HVAC;

issue with the Fan was fixed in https://github.com/Adminiuga/home-assistant/commits/ac/new-zha-climate-0.108.x

Adminiuga now also posted a new-zha-climate branch based on Home Assistant 0.109 here:

Adminiuga has now submitted a first pull request for “ZHA Climate” (beta) with support for thermostats

Now we are soon cooking with radiators :wink:

Super exciting!!! Been using the .109 custom component without issue for the last couple weeks.

After upgrading to .110, I did try to use the zha of the dev branch (Adminiuga last PR for zha climate) but it wasn’t working and zha did stop working properly. I had to restore a previous snapshot.

I am still using the zha folder of the new-zha-climate-0.109.x with version 0.110.x, everything works fine but have a lot of deprecation warnings. Hope the new zha climate will soon be added in a next version.

2020-05-30 20:25:26 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for climate_group which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-05-30 20:25:26 WARNING (MainThread) [homeassistant.components.climate] ClimateDevice is deprecated, modify ClimateGroup to extend ClimateEntity
2020-05-30 20:31:25 WARNING (MainThread) [homeassistant.components.binary_sensor] BinarySensorDevice is deprecated, modify BinarySensor to extend BinarySensorEntity
2020-05-30 20:31:25 WARNING (MainThread) [homeassistant.components.binary_sensor] BinarySensorDevice is deprecated, modify Accelerometer to extend BinarySensorEntity
2020-05-30 20:31:25 WARNING (MainThread) [homeassistant.components.binary_sensor] BinarySensorDevice is deprecated, modify Occupancy to extend BinarySensorEntity
2020-05-30 20:31:25 WARNING (MainThread) [homeassistant.components.binary_sensor] BinarySensorDevice is deprecated, modify Opening to extend BinarySensorEntity
2020-05-30 20:31:25 WARNING (MainThread) [homeassistant.components.binary_sensor] BinarySensorDevice is deprecated, modify IASZone to extend BinarySensorEntity
2020-05-30 20:31:25 WARNING (MainThread) [homeassistant.components.climate] ClimateDevice is deprecated, modify Thermostat to extend ClimateEntity
2020-05-30 20:31:25 WARNING (MainThread) [homeassistant.components.climate] ClimateDevice is deprecated, modify SinopeTechnologiesThermostat to extend ClimateEntity
2020-05-30 20:31:25 WARNING (MainThread) [homeassistant.components.cover] CoverDevice is deprecated, modify ZhaCover to extend CoverEntity
2020-05-30 20:31:25 WARNING (MainThread) [homeassistant.components.light] Light is deprecated, modify BaseLight to extend LightEntity
2020-05-30 20:31:25 WARNING (MainThread) [homeassistant.components.light] Light is deprecated, modify Light to extend LightEntity
2020-05-30 20:31:25 WARNING (MainThread) [homeassistant.components.light] Light is deprecated, modify HueLight to extend LightEntity
2020-05-30 20:31:25 WARNING (MainThread) [homeassistant.components.light] Light is deprecated, modify LightGroup to extend LightEntity
2020-05-30 20:31:26 WARNING (MainThread) [homeassistant.components.lock] LockDevice is deprecated, modify ZhaDoorLock to extend LockEntity
2020-05-30 20:31:26 WARNING (MainThread) [homeassistant.components.switch] SwitchDevice is deprecated, modify BaseSwitch to extend SwitchEntity
2020-05-30 20:31:26 WARNING (MainThread) [homeassistant.components.switch] SwitchDevice is deprecated, modify Switch to extend SwitchEntity
2020-05-30 20:31:26 WARNING (MainThread) [homeassistant.components.switch] SwitchDevice is deprecated, modify SwitchGroup to extend SwitchEntity

It is a big day for this topic: zha_climate from Adminiuga last PR is now part of last HA core stable release 0.111 !

If like me, you were previously using zha component from rpress or Adminiuga dev branch as custom component to support your zigbee thermostat/climate device, there is high chance it breakes zha after removing the zha custom component and get the following error message:

2020-06-12 23:51:29 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry /dev/ttyUSB1 for zha
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 217, in async_setup
    hass, self
  File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 100, in async_setup_entry
    await zha_gateway.async_initialize()
  File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 138, in async_initialize
    app_config = app_controller_cls.SCHEMA(app_config)
AttributeError: type object 'ControllerApplication' has no attribute 'SCHEMA'

Thanks to Adminiuga for his help, this is how you need to proceed to remove the zha custom_component without breaking zha:

  1. stop your ha core
  2. remove your custom component
  3. rebuild you ha core
  4. upgrade to last version

Detailed steps for the one that are running hassos (ssh dev connection needed):

ha > core stop
ha > login
# cd /mnt/data/supervisor/homeassistant/custom_components/
# rm -Rf zha
# hassos-cli
ha > core rebuild
ha > core update
1 Like