Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Странное поведение в кастомной карточке custom:clock-weather-card #112

Closed
alexanderznamensky opened this issue Apr 4, 2024 · 15 comments · Fixed by #114
Labels
Home Assistant Home Assistant related issues UI UI related work in progress We a working on it

Comments

@alexanderznamensky
Copy link

The problem

После обновления компонента на v3.2.0 и НА 2024.4.0 не показывает правильно прогноз:
image

При этом эта же карточка другие источники погоды показывает правильно.

What version of the integration has the issue?

v3.2.0

What version of Home Assistant Core has the issue?

2024.4.0

What type of installation are you running?

Home Assistant Supervised

Anything in the logs that might be useful for us?

No response

Additional information

No response

@IATkachenko
Copy link
Owner

А в дефолтной карточке прогноз правильный?

@IATkachenko IATkachenko added need more info Further information is requested Home Assistant Home Assistant related issues labels Apr 5, 2024
@alexanderznamensky
Copy link
Author

Доброе утро, Игорь.
В дефолтной все корректно отображается.
Но, вот что не понятно, так это то, что в кастомной карточке другие сущности погоды (gismeteo, Meteorological institute, AccuWeather, Open Meteo, OpenWeatherMap) отображаются так же правильно как и в дефолтной.
image
image
а у нас вот так:
image
image

@IATkachenko
Copy link
Owner

Похоже что карточка рассчитана на недельный прогноз, а Яндекс отдает прогноз на два 6 часовых интервала, который я прокидываю в HA как "прогноз 2 раза в сутки".
Так что выглядит все правильно.
ps. вангую что можно найти момент когда в карточке будет виден прогноз на два дня (когда 6 часовые интервалы будут попадать на разные дни)

@IATkachenko IATkachenko added wontfix This will not be worked on and removed need more info Further information is requested labels Apr 6, 2024
@alexanderznamensky
Copy link
Author

Странно, что раньше на НА 2024.3.* и v3.1.3 интеграции эта карточка корректно работала с двухдневным прогнозом Яндекса....

@IATkachenko
Copy link
Owner

IATkachenko commented Apr 6, 2024

У меня она вообще прогноз не показывает в дефолтной конфигурации...
Оно смотрит на атрибут forecast из weather: воспроизвел у себя ваше поведение, посмотрю можно ли улучшить , но думаю что нет.
Все оказалось просто: включаем hourly_forecast и получаем прогнозные данные.

@IATkachenko
Copy link
Owner

IATkachenko commented Apr 7, 2024

Странно, что раньше на НА 2024.3.* и v3.1.3 интеграции эта карточка корректно работала с двухдневным прогнозом Яндекса....

изображение

type: custom:clock-weather-card
entity: weather.yandex_weather
hourly_forecast: true

правда они какие-то странные и отличаются от дефолтной карточки.

Он хочет странное: templow и temperature в прогнозных данных, в то время как HA (и мы вместе с ним) перешел на на параметры с префиксом native_ и занимается конвертацией значений.

Можете прислать как выглядит один элемент forecast для Meteorological institute у вас (панель разработчика -> состояние)?
Для сравнения у Яндекса так

forecast: 
- datetime: '2024-04-07T15:43:06.096378'
  wind_bearing: 270
  native_temperature: 12
  native_templow: 10
  native_pressure: 998
  native_wind_speed: 1.9
  native_precipitation: 0
  precipitation_probability: 0
  condition: cloudy
  is_daytime: false

@IATkachenko IATkachenko added UI UI related need more info Further information is requested and removed wontfix This will not be worked on labels Apr 7, 2024
@alexanderznamensky
Copy link
Author

собственно, у меня так и было )))
это не может быть из-за того, что атритбуты прогноза в новой версии интеграции поменяли название (дополнились префиксом native_*)?

@alexanderznamensky
Copy link
Author

чудеса.... но прогноз в (панель разработчика -> состояние) не показывает:
image
у weather.yandex_weather он есть:
image

@IATkachenko
Copy link
Owner

Да, это именно из-за этого.
Как пишет HA -- https://github.com/home-assistant/core/blob/f2fe2c45109b01d779f479a9e866f3c11ec868f7/homeassistant/components/weather/__init__.py#L177

All attributes are in native units and old attributes kept 
    for backwards compatibility.

Начиная с нашей версии 3.1.0 в части атрибутов ничего не менялось -- вот тут вся магия делается https://github.com/IATkachenko/HA-YandexWeather/blame/main/custom_components/yandex_weather/updater.py#L111, так что думаю в HA умолчания поправили.
Но с этим можно работать.
Сейчас немного поэкспериментирую и сегодня-завтра выложу фикс.

@IATkachenko
Copy link
Owner

чудеса.... но прогноз в (панель разработчика -> состояние) не показывает:

Это нормально: в 2024.4 HA разделил получение прогноза и текущей погоды. Яндекс так не умеет, а 2 API запроса мы слать (у нас их всего 50 в день) не хотим, поэтому живем с прогнозом внутри объекта погоды.

@IATkachenko IATkachenko added work in progress We a working on it and removed need more info Further information is requested labels Apr 7, 2024
@alexanderznamensky
Copy link
Author

тогда все более-мене понятно )))

@IATkachenko
Copy link
Owner

@alexanderznamensky,

вот в таком виде собрал в итоге:
изображение

все правильно выглядит?

IATkachenko added a commit that referenced this issue Apr 7, 2024
…er-card

https://github.com/pkissling/clock-weather-card with
```yaml
type: custom:clock-weather-card
entity: weather.yandex_weather
hourly_forecast: true
```
now will show pretty forecast from the integration.

Fix #112
@alexanderznamensky
Copy link
Author

выглядит отлично! ждем обновление!
Спасибо большое за вашу работу!

IATkachenko added a commit that referenced this issue Apr 7, 2024
…er-card

https://github.com/pkissling/clock-weather-card with
```yaml
type: custom:clock-weather-card
entity: weather.yandex_weather
hourly_forecast: true
```
now will show pretty forecast from the integration.

Fix #112
IATkachenko added a commit that referenced this issue Apr 7, 2024
…er-card (#114)

* fix[weather::forecasts]: add additional forecast data for clock-weather-card

https://github.com/pkissling/clock-weather-card with
```yaml
type: custom:clock-weather-card
entity: weather.yandex_weather
hourly_forecast: true
```
now will show pretty forecast from the integration.

Fix #112
@IATkachenko
Copy link
Owner

Исправлено в v3.2.1

@alexanderznamensky
Copy link
Author

image
Спасибо, Игорь!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Home Assistant Home Assistant related issues UI UI related work in progress We a working on it
Projects
None yet
2 participants