home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
4.05k stars 2.77k forks source link

Incorrent units displayed for energy dashboard #17185

Closed digdilem closed 1 year ago

digdilem commented 1 year ago

Checklist

Describe the issue you are experiencing

Changing the range in this dashboard (Top right: Day | Week | Month | Year) correctly changes the units below the graphs to reflect the chosen period, but every single value is shown as "Units used Today" regardless of whether the range is day, week, month.

Example - my dashboard with the range set at "Day"

image

The same tab, but with the range set at "Week"

image

Note that the values have changed, but it is misleading and confusing to describe the usage as "Today" when it's not.

Last example - same tab, with range set at "Month"

image

Describe the behavior you expected

For the "Today" string to be replaced by the period chosen. Day, Week, Month, Year or Custom. (Or, simpler and equally as valid; "for the period selected")

Steps to reproduce the issue

  1. Open sidebar link for energy dashboard: https://{server}/energy
  2. Note units "Today" for default 'Day' period.
  3. Change period at top-right and see the units have changed, but they are still marked as 'Today' ...

What version of Home Assistant Core has the issue?

2023.7.0

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Latest Chrome and latest Firefox

Which operating system are you using to run this browser?

Windows 10

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

karwosts commented 1 year ago

every single value is shown as "Units used Today"

That's because that's the name of the sensor you've added to the dashboard configuration. The energy dashboard does not add "Today" (or any other string) to the end of the name.

digdilem commented 1 year ago

Thanks for explaining that - I see it's not a core issue now.

In case anyone else encounters this - "Today" is actually being generated by the Solar generating plugin I use, GivEnergy. I'll drop the developer a polite note.

karwosts commented 1 year ago

Its a bit tricky how this works, because "Today" might be a reasonable name for the sensor in a non-energy-dashboard context, if it resets to 0 every night. But it doesn't make sense once energy dashboard turns that sensor into a long term reading.