After upgrading from 2026.5.4 to 2026.7.0 my energy dash board shows cumulative electricity values for import and export instead of today's values after I reboot my machine. This happened twice and I dare not reboot my machine a third day.
The underlying cumulative totals show up correctly when I click on them in Sources in the dashboard.
What could cause this? Can I still correct the numbers (the error make the graphs unusable if you want to see the values over a period of more than one day)?
These were reboots of my raspberry 4B (both via a 'sudo reboot' command). Yesterday after I did my monthly full-upgrade of the raspberry followed by a pull of all containers and today I had to do a reboot as the raspberry became unresponsive overnight. I run my HA instance in a docker container.
What I did discover now is that all my total energy values for electricity give an error message when HA starts which didn't lead to the same behaviour in 2026.5.4 (showing only the first entity):
Logger: homeassistant.components.template.validators
Source: components/template/validators.py:39
Integration: Template (documentation, issues)
First occurred: 10:24:07 (5 occurrences)
Last logged: 10:24:07
Received invalid sensor state: for entity sensor.electricity_meter_energy_import_total, expected a number
...
This is the template that calculated this value:
- name: "Electricity Meter Energy Import Total"
unique_id: "electricity_meter_energy_import_total"
state_class: total_increasing
device_class: energy
unit_of_measurement: "kWh"
state: >
{% set dsmr_tariff_1 = states('sensor.electricity_meter_energy_consumption_tarif_1') | float(0.0) %}
{% set dsmr_tariff_2 = states('sensor.electricity_meter_energy_consumption_tarif_2') | float(0.0) %}
{% if (dsmr_tariff_1 != 0.0 or dsmr_tariff_2 != 0.0) %}
{{ dsmr_tariff_1 + dsmr_tariff_2 | float(0.0) }}
{% endif %}
What's wrong with this setup to cause my energy dashboard values to go 'ballistic' after each start of HA?
Thank you Tom. What annoys me is that a setup which worked perfectly well for a long time suddenly shows different behaviour. A colleague of mine used to call this 'irreversible improvement'.
I'll try to recover from the erroneus data with yesterdays backup accepting that I will miss more than a day of data.