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

Maintain fixed today's min-max bars during the day #410

Open
Chaoscontrol opened this issue Jul 5, 2024 · 3 comments
Open

Maintain fixed today's min-max bars during the day #410

Chaoscontrol opened this issue Jul 5, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@Chaoscontrol
Copy link

Is your feature request related to a problem? Please describe.
I'm displaying this card on a small display under my TV, and most of the time we look at it in the evening. At that time, the temperature extremes have already been reduced a lot over the day, and especially max temperatures have mostly disappeared. This makes comparing current day with next days hard or complex, as you cannot see what the day actually was (you're seeing the remaining day hours, and comparing them with full days forecast).

Describe the solution you'd like
I appreciate not everyone might want this. So an option in the card to retain min and max values of the current day until the end of the day, instead of updating them as time passes.

@pkissling
Copy link
Owner

pkissling commented Jul 31, 2024

hi @Chaoscontrol,

First of all sorry for the late response. i have been pretty busy with other projects lately. however, i appreciate you taking time to create this feature request and describing the idea behind it. i was thinking about a feature like the one you described as well, but there are some drawbacks to this approach that made me - so far - not implement this feature:

the javascript code of the card is only loaded when the dashboard is displayed, so there is no way to guarantee that the min/max temperature is properly captured and recorded throughout a day. for some people, who open the dashboard multiple times a day, this might work - for other's it wont.
additional, since the min/max temp would only be stored in a local browser storage, min/max temps could differ on two distinct HA dashboard (e.g. mobile & desktop) of the same HA instance

due to the issues i described above and the half-baked nature of the approach i foresee already a significant amount of bug ticket, which would (for me) even crate more downstream work (maintaining tickets, responding to bugs, admitting that the feature does not work reliable etc).

the only option i see to make sure that we properly capture min/max temp of a given day would be by creating a proxy weather service in HA, which polls and stores the min/max temperature in a periodic fashion and makes it avaialble through the entire HA instance.

what do you think?

Best,
Patrick

@Chaoscontrol
Copy link
Author

Chaoscontrol commented Jul 31, 2024

Hi @pkissling ,
I clearly see your point and it makes total sense. I don't think using browser storage would be a good option either.

I checked and it's true the weather.* entities show only values from current time onwards, which is effectively what the card displays. So it's actually a limitation of those entities and not the card itself.

I was now wondering if it wouldn't be possible to access the history of the sensor value though, given that its history does have the stored values from the day. You wouldn't need to store it elsewhere, just call it. No clue if what I'm saying it's possible though. All I was thinking is that the values are actually stored somewhere in the db. Be it accessible via the sensor, or some kind of history call, I don't know.

If that's not doable, the only other choice would be if there's some weather sensor provider where the sensor actually shows the full day inside its value for the entirety of the day. No clue if this is a provider's decision, or something by design in HA.

Any idea about these 2 potential ways?

Thanks for getting back and give a detailed response.

@Breatnach
Copy link

Thanks for an amazing card and thanks also for your detailed answer. I understand the card doesn't store the high and lows of the day and that it is probably a limitation of the weather.* integration.

I have thought of three possible workarounds that might work, listed in terms of simplicity in my mind:

  • I think maybe the simplest workaround would be an option to simply hide the high and low, and display only the forecasted temp. Especially if I use the hourly forecast (which I do) the min and max within a single hour has basically no variance in it at all.

  • Alternatively, perhaps we could use static values (e.g. 0 - 30°) or whatever is suitable given the climate and time of year. It might not be perfect, but it would allow a visual representation of where the forecast will lie within that range.

  • The most sophisticated, which I think you are alluding to, is to create a sensor template that checks and and stores the min and max temperatures for any given day and for the Clock weather card to read these values instead of the ones provided by the weather.* integration.

Does my line of thinking make sense?

@pkissling pkissling added the enhancement New feature or request label Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants