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
763 stars 122 forks source link

Catch Error if Termostat is unavailable #1390

Open StormCh opened 2 weeks ago

StormCh commented 2 weeks ago
2024-09-13 06:20:28.571 ERROR (MainThread) [custom_components.better_thermostat.utils.controlling] better_thermostat None: ERROR controlling: climate.heizung_bad_gross
Traceback (most recent call last):
  File "/config/custom_components/better_thermostat/utils/controlling.py", line 53, in control_queue
    _temp = await control_trv(self, trv)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/better_thermostat/utils/controlling.py", line 231, in control_trv
    _current_calibration_s = await get_current_offset(self, heater_entity_id)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/better_thermostat/adapters/delegate.py", line 55, in get_current_offset
    return await self.real_trvs[entity_id]["adapter"].get_current_offset(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/better_thermostat/adapters/mqtt.py", line 84, in get_current_offset
    return float(
           ^^^^^^
ValueError: could not convert string to float: 'unavailable'

Description

Please catch to type of error, this should be mandatory. Due to this log information, HA restarting every time the log file is to big

Versions

HA Version 2024.9.1 BT Version 1.6.0