Energy dashboard empty after upgrade

Hello,

My Energy dashboard is empty (Energy and gas) for some reason since yesterday 11:00am. But the entities used for energy and gas are still working and increasing, but it does not show in the energy dashboard.


Does this sound familiar for some people here? And does somebody know how to fix this?
Im running HA in docker, version 2022.8.6

If i check days before yesterday/today it is still showing information as expected.

Thanks!

1 Like

I’ve got the same problem

1 Like

Things to check (in order):

Settings → Logs. Look for database errors.

Developer Tools → Statistics. Look for issues to fix buttons.

Settings → Dashboards → Energy. Is this still set up correctly (e.g. using the correct entity ids)?

1 Like

Hello tom_I,

Thansk for your reply:

I check things you mentioned:
Settings → Logs: Empty
Developer tools → Statistics:
Only checked the entities related to Energy, no issues:

Settings → Dashboards → Energy:
It’s still the same configured as before:

In the docker logging are database errors, but they are related to another sensor.

2022-08-26 08:45:10.110 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (MySQLdb.OperationalError) (1366, "Incorrect string value: '\\xE2\\x8B\\x85m\\xC2\\xB2' for column `homeassistant`.`statistics_meta`.`unit_of_measurement` at row 1")

[SQL: INSERT INTO statistics_meta (statistic_id, source, unit_of_measurement, has_mean, has_sum, name) VALUES (%s, %s, %s, %s, %s, %s)]

[parameters: ('sensor.plant_keuken_anthurium_andraeanum_ppfd_mol', 'recorder', 'mol/s⋅m²', 1, 0, None)]

(Background on this error at: https://sqlalche.me/e/14/e3q8)

2022-08-26 08:45:10.116 WARNING (Recorder) [homeassistant.components.recorder.util] Error executing statistics: (MySQLdb.OperationalError) (1366, "Incorrect string value: '\\xE2\\x8B\\x85m\\xC2\\xB2' for column `homeassistant`.`statistics_meta`.`unit_of_measurement` at row 1")

[SQL: INSERT INTO statistics_meta (statistic_id, source, unit_of_measurement, has_mean, has_sum, name) VALUES (%s, %s, %s, %s, %s, %s)]

[parameters: ('sensor.plant_keuken_anthurium_andraeanum_ppfd_mol', 'recorder', 'mol/s⋅m²', 1, 0, None)]

(Background on this error at: https://sqlalche.me/e/14/e3q8)

I just upgraded to 2022.8.7, but still the same.

I’d still be suspecting a database issue.

A screenshot from the Energy consumption tarif1 and energy consumtion tarif 2 entitiy graphs:


They are increasing like expected, but the energy dashboard is not showing it.
How could i check database errors for the energy dashboard?

Hmm. Maybe not a database issue.

Can you post the attributes of the sensors missing from the energy dashboard?

Sure!

The following entities are missing from the dashboard:
state_class: total_increasing
unit_of_measurement: kWh
device_class: energy
friendly_name: Electricity Meter Energy consumption (tarif 1)

state_class: total_increasing
unit_of_measurement: kWh
device_class: energy
friendly_name: Electricity Meter Energy consumption (tarif 2)

state_class: total_increasing
unit_of_measurement: m³
device_class: gas
friendly_name: Gas Meter Gas consumption

state_class: total_increasing
current: null
device_temperature: 30
energy: 26.49
last_seen: 2022-08-29T14:13:03.155Z
linkquality: 99
power: 3.9
power_outage_memory: null
update:
state: idle
update_available: false
voltage: null
unit_of_measurement: kWh
device_class: energy
friendly_name: Schakelaar Camera Woonkamer Energy

state_class: total_increasing
current: null
device_temperature: 23
energy: 11.37
last_seen: 2022-08-29T14:13:24.623Z
linkquality: 87
power: 0
power_outage_memory: null
update:
state: idle
update_available: false
voltage: null
unit_of_measurement: kWh
device_class: energy
friendly_name: Schakelaar Opladers Slaapkamer Energie

state_class: total_increasing
current: 0
energy: 51.51
indicator_mode: off/on
last_seen: 2022-08-29T14:13:25.011Z
linkquality: 99
power: 0
power_outage_memory: restore
voltage: 236
unit_of_measurement: kWh
device_class: energy
friendly_name: Schakelaar TV Meubel Energie

state_class: total_increasing
current: 0.83
energy: 958.62
indicator_mode: off/on
last_seen: 2022-08-29T14:13:25.026Z
linkquality: 174
power: 160
power_outage_memory: on
voltage: 236
unit_of_measurement: kWh
device_class: energy
friendly_name: Schakelaar UPS Energie

Or is there a way to get more logging from the energy dashboard so that this issue can be resolved quicker? I was looking into the logger component but i don’t see anything specific for energy as example.

You might be able to repair your database with the SQL query posted in this issue:

My database tables are almost all in latin1 encoding/charset.
I have changed only the statistics_meta tables now as the SQL query suggested.

Let’s wait to see if it helps.

Hi Tom,

That worked! The SQL error for the plant sensor is gone, and the energy dashboard is also working again!
Thanks!

Do you know what the correct database schema should be? Maybe other tables need to get fixed as well?

I’m getting this too since some months, but I’m just using sqlite db here so such query doesn’t help…

did you fix this ? I got the same problem (I use maraDB)- my sensor working , but not type: energy-usage-graph dash board