KartoffelToby / better_thermostat

This custom component for Home Assistant will add crucial features to your climate-controlling TRV (Thermostatic Radiator Valves) to save you the work of creating automations to make it smart. It combines a room-temperature sensor, window/door sensors, weather forecasts, or an ambient temperature probe to decide when it should call for heat and automatically calibrate your TRVs to fix the imprecise measurements taken in the radiator's vicinity.
https://better-thermostat.org
GNU Affero General Public License v3.0
714 stars 124 forks source link

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

Open iDazai opened 4 months ago

iDazai commented 4 months ago

Prerequisites

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

benna1990 commented 4 months ago

Same here

kuduacz commented 4 months ago

Same Here.

UweTo commented 4 months ago

same here

auanasgheps commented 4 months ago

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

Microfi commented 4 months ago

Same problem over here.

LeoCal commented 3 months ago

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