Energy dashboard : how to change the cost value in the database

Hello,

To keep track of the energy cost, I’m working with an entity with the current price :

But I think the price of this entity was not correct in the past. Can this been easily changed in the database ?

I am working with MariaDB and have already phpMyAdmin Add-on installed…

I don’t think changing this value for the past will help. All the costs have already been calculated based on the original cost. You would have to recalculate then with the new values.

They are stored in the database table statistics and statistics_short_term.

It’s a pity, but no problem.

Thank you !

Hello,

I have the same issue, the cost of two entities had wrong (10x) too high values.
Due to that the energy calculation for these entities is wrong for several days.
I tried to edit within Home Assistant, but as far as i found out you can only edit a 5min slots which is a pain. Several clicks are needed just to edit one single 5 min value of a day…
I am searching for the database itself where these values are stored and would like to edit it direct there.
What do i need to have access to this cost database you are writing about “statistics_short_term” and “table statistic” Both i need to edit if energy cost are wrong?
Do i need to have ssh access or can i install something in HA for beeing able to edit the data?
I am pretty new to HA, its very impressive how well this tool works with all of my Smart gadgets.
Just the edit features are kind of hidden for me as a new user.

Thank you for help
KR
Daniel

Hi just for all of you who are having issues with the wrong cost calculation, I found that in developpers tools you have an entity called: sensor_cost. I have entered there and found the value that was messing my calculation. Changed it and now everything is fine.

image

image

This worked for me

1 Like