better_thermostat icon indicating copy to clipboard operation
better_thermostat copied to clipboard

Can't turn on Heating after upgrade to 1.5.0-beta6 or higher

Open iDazai opened this issue 1 year ago • 6 comments

Prerequisites

  • TZ601 _TZE200_hue3yfsn
  • hvac_modes: off, heat min_temp: 5 max_temp: 30 preset_modes: none, holiday, Schedule, frost protect current_temperature: 16 temperature: 16 hvac_action: idle preset_mode: none system_mode: [4]/heat occupied_heating_setpoint: 1600 unoccupied_heating_setpoint: 1700 friendly_name: Bad_Thermostat Thermostat supported_features: 401

Description

I use mushroom cards on my dashboard to control BT. Turning off the thermostat works, but turning it on throws an error. On 1.5.0-beta5 it works fine, but after an upgrade to 1.5.0-beta6 or higher this error appears.

 Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:240
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 18:00:37 (1 occurrences)
Last logged: 18:00:37

[139774147023936] type object 'HVACMode' has no attribute 'HEATING'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 240, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2279, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2316, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 892, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 962, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/better_thermostat/climate.py", line 1270, in async_turn_on
    await self.async_set_hvac_mode(HVACMode.HEATING)
                                   ^^^^^^^^^^^^^^^^
AttributeError: type object 'HVACMode' has no attribute 'HEATING' 

Steps to Reproduce

  1. Install version 1.5.0-beta5
  2. Turn off thermostat in mushroom heating card, turn on and see the error

Expected behavior:

The thermostat should be turned on again, without an error

Actual behavior:

The thermostat doesn't turn on again

Versions

HA Core 2024.2.2 HA Supervisor 2024.02.0 HA Frontend 20240207.1 BT 1.5.0-beta6 and higher

iDazai avatar Feb 22 '24 17:02 iDazai

Same here

benna1990 avatar Feb 24 '24 11:02 benna1990

Same Here.

kuduacz avatar Feb 24 '24 12:02 kuduacz

same here

UweTo avatar Feb 26 '24 10:02 UweTo

I have the same issue, I'm forced to roll-back

auanasgheps avatar Feb 29 '24 11:02 auanasgheps

Same problem over here.

Microfi avatar Mar 07 '24 13:03 Microfi

I have noticed the same problem on my setup today.

From a quick code inspection, it seems the issue has been introduced by a recent commit (b53b564) which was bundled into BT version 1.5.0beta6.

I have found the root cause and successfully tested it on my HA instance. I've also raised a PR to fix the issue: https://github.com/KartoffelToby/better_thermostat/pull/1323

@KartoffelToby , do you mind approving and merging it? It's a very short one.

My 2 cents

LeoCal avatar Mar 22 '24 12:03 LeoCal