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
746 stars 123 forks source link

config with Openweather as external weather entity is broken since 1.5.1 #1344

Open PetziAt opened 4 months ago

PetziAt commented 4 months ago

Description

Since 1.5.1 the Openweather isn't working for the external weather entity.

Steps to Reproduce

  1. Configure OpenWeatherMap as external weather entity.

Expected behavior:

A working configuration as 1.5.0 or ealier.

Actual behavior:

Traceback (most recent call last): File "/config/custom_components/better_thermostat/climate.py", line 856, in startup await self._trigger_check_weather(None) File "/config/custom_components/better_thermostat/climate.py", line 399, in _trigger_check_weather await check_weather(self) File "/config/custom_components/better_thermostat/utils/weather.py", line 40, in check_weather _call_for_heat_weather = await check_weather_prediction(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/better_thermostat/utils/weather.py", line 87, in check_weather_prediction forecasts = await self.hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2543, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2580, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 971, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1043, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/weather/__init__.py", line 1061, in async_get_forecasts_service raise_unsupported_forecast(weather.entity_id, forecast_type) File "/usr/src/homeassistant/homeassistant/components/weather/__init__.py", line 1022, in raise_unsupported_forecast raise HomeAssistantError( homeassistant.exceptions.HomeAssistantError: Weather entity 'weather.openweathermap' does not support 'daily' forecast

Versions

BT 1.5.1 HA

Additional Information

-

KartoffelToby commented 4 months ago

@dasadi can help here :)

I'll take a look too, if there are different service calls

dengi76 commented 4 months ago

I confirm!!! Doesn't work for me either!!! I had to roll back!

dasadi commented 4 months ago

When selecting hourly forecast type for openweathermap, only the FORECAST_HOURLY WeatherEntityFeature will be provided, which means we can only request an hourly forecast and no daily. I will work on it to dynamically call the service with the correct options.

@KartoffelToby What is the idea for the forecast if we have multiple datapoints per day? Should we look at the forecast for ex. 5am in the morning or max temp for the day? If not, which other strategy should we use for selecting the temperature?