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:
- Stop HA
- Open the DB using sqlite3:
sqlite3 home-assistant_v2.db
-
SELECT * FROM statistics_meta GROUP BY id
(check the sensor which doesnt appear in energy-settings) -
UPDATE statistics_meta SET unit_of_measurement="kWh" WHERE id=xx
(<-- the id of the sensor) - Start HA
Then I also had to update the case for the sensors unit, which is declared through MQTT discovery.