Energy Dashboard cost/compensation calculation stopped working when I upgraded to 2021.9

Hi,

I noticed my cost calculation in Energy Dashboard stopped working as soon as I upgraded to 2021.9 as shown in the image below:

image

This feature was previously working fine in 2021.8.
I did some troubleshooting and found out why.
This is a post mortem of how the issue was caused and how I fixed the issue.

How the issue was caused:
When Energy dashboard launched in 2021.8, I had not yet changed my currency from the default EUR under Configuration / General / Currency.
My local currency is AUD.
When long term statistics was initialized in 2021.8, Home Assistant assigned the current currency value to Energy Dashboard which was EUR at the time.
Once I noticed the EUR symbol in Energy Dashboard, only then did I take steps to change the currency to AUD.
Changing the setting was easy enough and had an immediate impact on the currency smybol displayed in the Energy Dashboard.

image

Once 2021.9 came out, Energy Dashboard noticed that the EUR unit was not the same as my current currency of AUD and decided to stop recording costs all together.
I can understand why, because the units need to match in order for calculations to continue.

How I verified the issue:
Installed this

How I installed it
Supervisor / Add-on Store / SQLite Web / Install / Run / Open Web UI

Once running, I did this:
statistics_meta / Query

SELECT *
FROM "statistics_meta" where unit_of_measurement = 'EUR'

These EUR units need to be changed to AUD so that Energy Dashboard resumes cost caculations.

How I fixed the issue:

update "statistics_meta" 
set unit_of_measurement = 'AUD'
where unit_of_measurement = 'EUR'

After that my energy dashboard started recording costs correctly again after 1.2 hours (1h 12m).

4 Likes

Seems this solution can also be used to fix NULL unit_of_measurement preventing integration energy sensors from being selected in energy dashboard.

See

And

Thanks for this post, I had exactly the issue you described and have been trying many things to resolve it, updating the entry as you described sorted it.

One addendum that I did was to remove all the stats generated to date on that stat ID, because it’s been nearly two months since this stopped working I suspect that the yearly cost stats would be completely wrong so may as well start again.

1 Like

I just noticed a new feature in developer tools that shows any issues with the long term statistics database which is what energy dashboard uses

It even offers a “fix issue” button.

1 Like

well… i went to the developer tool log and pressed FIX ISSUE.
errors are gone after restart of service.

Does the Energy calculation comes back? I assume it must gather new data to show movement on the board?

Please say am right :slight_smile:
thank you!

Hard to say as it depends on exactly what issue the fix issues button fixes?
Did you take notice before pressing it?

In my picture example above, my issue was that I was excluding certain entities from the recorder. Pressing the fix issue in that case would not fix the energy dashboard for me