home-assistant / frontend

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

Energy Dashboard Units Are Incorrect When Converted #11775

Closed kspearrin closed 1 year ago

kspearrin commented 2 years ago

Checklist

Describe the issue you are experiencing

When the energy dashboard converts a sensor to match the localization unit settings for HomeAssistant, the unit is not accurately shown on the energy graphs. It seems like HomeAssistant is doing the unit conversion, but maintains the original unit label on the UI. In my case, a gas meter MQTT sensor is collected in cubic meters, the dashboard converts it to cubic feet based on my localization settings, but the labels still show cubic meters.

More details reported here: https://community.home-assistant.io/t/gas-consumption-on-energy-dashboard-much-higher-than-expected/357029/4?u=kspearrin

Describe the behavior you expected

The units should report as cubic feet, or no conversion should happen.

Steps to reproduce the issue

  1. Configure HomeAssistant for Imperial units.

  2. Configure a sensor to collect gas consumption in cubic meters. Example:

    - platform: mqtt
    name: Gas Meter
    state_topic: "rtlamr/xxxxxxxxxx/state"
    device_class: gas
    state_class: total_increasing
    unit_of_measurement: "m³"
  3. Add the gas sensor to the energy dashboard. See my sensor here that increased by 18 cubic meters over the hour: image

  4. Observe the the graphs display values converted to cubic feet, but the labels still show cubic meters.

image

What version of Home Assistant Core has the issue?

core-2022.2.9

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Chrome/98.0.4758.105

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

ehendrix23 commented 2 years ago

I can confirm. My daily total right now is showing 16.5732 cubic meters but energy page is showing 566.8 cubic meters. If I convert to cubic feet then it pretty matches. Thus the numbers displayed are in cubic feet (baed on Imperial units) but the label still shows cub meters instead of cubic feet.

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

kspearrin commented 2 years ago

Still an issue.

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

kspearrin commented 2 years ago

Still an issue.

nor500 commented 2 years ago

I am facing similar issue. I live in Europe sp the metric system in set in Home assistant. Gas usage shows around 10 times more then the actual true values. I dont make any conversions because the meter reading values are in m3 and also the summarized usage values are also in m3.

My settings for utility meter:

utility_meter: gas_usage_monthly: source: sensor.gas_meter cycle: monthly

kspearrin commented 1 year ago

This issue appears to be resolved now. The energy dashboard is now showing labels as cubic feet.