Energy dashboard displays "No statistics" despite working utility meters

Hi,

I am trying to use the new Engergy dahsboard but I can not configure it as the Consumed energy dropdown list displays You don't have any statistics.
I configured my utility_meter components a while ago and they are working fine since then. ex:

utility_meter:
  daily_hchc:
    source: sensor.noterf_electricity_hchc
    cycle: daily
  monthly_hchc:
    source: sensor.noterf_electricity_hchc
    cycle: monthly

Did I missed a configuration step? Is it because my meter is in Wh and not kWh ?

Thanks

So thanks to this Github issue I have been able to solved it: the unit is case sensitive, and I has using wh instead of Wh. From Zyta2002’s comment the db has to be updated:

  1. Stop HA
  2. Open the DB using sqlite3: sqlite3 home-assistant_v2.db
  3. SELECT * FROM statistics_meta GROUP BY id (check the sensor which doesnt appear in energy-settings)
  4. UPDATE statistics_meta SET unit_of_measurement="kWh" WHERE id=xx (<-- the id of the sensor)
  5. Start HA

Then I also had to update the case for the sensors unit, which is declared through MQTT discovery.

7 Likes

Hi @Oliv, please advise how to reach home-assistant_v2.db on RPI when turn off homeassistant Core. After I turned it off, I cannot reach file using samba share.

Hello @dkovacic, sorry but I am using Home Assistant thanks to a docker container so I can easily edit the persistent files.
If you are using an rPi you might try to remove the SD Card and do the Sqlite operations on a Linux computer.

I managed this with HA addon SQLlite. I changed unit of measurement for some sensors, and in db there is visible change. After restart, again in Development tools, there are still KWath. Any clue why?


Great, this is indeed the solution! I had a similar issue for a water consumption sensor: unit of measurement was defined as “m3” but should be “m³”. Problem was fixed for me after updating this in the sensor config yaml, statistics_meta table was automatically updated so no db fix needed. More info on correct units can be found here: Sensor Entity | Home Assistant Developer Docs