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

Hourly forecasts: mismatch between real entity and entity to configure in v-weather-card? #1

Open
2 tasks done
ksmolder opened this issue Nov 2, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@ksmolder
Copy link

ksmolder commented Nov 2, 2023

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue:

  • Home Assistant Core 2023.11.0
  • Commit eae1d69

Last working release (if known):

  • First time user

Browser and Operating System:

  • Linux with Firefox 119.0
  • Linux with Chrome 119.0

Description of problem:

Context

  • I've setup two integrations with OpenWeatherMap (using the OneCall API). The first one retrieves hourly forecasts and is known as entity.openweathermap. The second one fetches daily forecasts and is known as entity.openweathermap_daily.
  • sensors are named accordingly. Those associated with the hourly forecast are named sensor.openweathermap_cloud_coverage. The same sensor associated with the daily forecasts is named sensor.openweathermap_cloud_coverage_daily

Note

I first created the subscription to the hourly forecast. Next, I added a second integration using the daily forecast. The latter was originally named entity.openweathermap_2, but I renamed it to entity.openweathermap_daily (and all of its sensors).

Issue

  • Create v-weather-card card in Lovelace with the following configuration:
    type: custom:v-weather-card
    entity: weather.openweathermap_daily
    name: Daily
    current: true
    forecast: true
    details: true
    hourly_forecast: false
    
    Here, everything works as expected. v-weather-card correctly takes the date from the weather.openweathermap_daily entity.
  • Create another v-weather-card card in Lovelace from:
    type: custom:v-weather-card
    entity: weather.openweathermap
    name: Hourly
    current: true
    forecast: true
    details: true
    hourly_forecast: true
    
    Here, things are broken as the card is simply not displayed (note that I'm using the correct entity for hourly forecasts). If I set hourly_forecast to false without changing anything else, the card is rendered. It is however not using the time as a reference for each of the forecasts, but repeats the day names:
    v-weather-card

Additional information:
Looking at the code, I suspect line 321 in card.ts to be the source of the issue. It seems when hourly_forecast is enabled, the suffix _hourly is appended to the entity's name. In reality, this entity does not need to have that name. You just need to know you configured an entity to fetch hourly predictions. SO my guess is that you don't need to append anything to the entity's name. A user just need to make sure that the correct entity is used when suggesting it provides hourly forecasts.

@ksmolder ksmolder added the bug Something isn't working label Nov 2, 2023
@ksmolder
Copy link
Author

ksmolder commented Nov 2, 2023

Tried to dig a bit deeper into the issue by creating an entity weather.openweathermap for the daily forecasts and one named weather.openweathermap_hourly for the hourly forecasts. Assumed that pointing v-weather-card to the one without the _hourly suffix would make the card behave as intended when hourly_forecast is enabled. Didn't do the trick however... So, not sure if the above assessment makes any sense...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant