Skip to content

Solarmax: History drops to 0.0 kWh when a meter's energy register is removed — no fallback to power integration for existing entities #33091

Description

@thebrainkafka

Description

Title: History drops to 0.0 kWh when a meter's energy register is removed — no fallback to power integration for existing entities

Follow-up to #32324 / #32497.

#32497 fixed the whole-kWh-resolution problem for solarmax-inverter-smt.yaml by dropping the energy register and relying on power integration for the history instead. The same fix later landed for solarmax-maxstorage.yaml (pv usage, register 150) as well.

However, after this change, my PV Dach meter (SolarMax Ultimate, solarmax-maxstorage.yaml, pv usage) stopped accumulating any history at all — the daily chart showed a flat 0.0 kWh all day, even though live power was completely normal and non-zero throughout the day. A second pv meter (different device) on the same instance continued to work correctly in parallel.

Root cause (from inspecting the sqlite DB, entities table):

id | group | name  | title    | is_temp | energy_meter | return_energy_meter
4  | pv    | db:6  | PV Dach  |         | 54716.0      |
8  | pv    | db:21 | PV West  | 0       | 123.894082   | 0.00942500000000291

energy_meter for PV Dach is a flat whole number (54716.0) — clearly a stale leftover from when the meter still had a working energy register, not something produced by power integration (compare PV West: fine-grained decimals, actively updated). After the register was removed from the template, this entity's energy_meter appears to simply stop being updated at all, instead of falling back to power integration.

As a workaround I re-added the energy register (150, int32s, no scale) via a custom meter, which restores history accumulation (with the original whole-kWh-resolution gaps from #32324, but at least a moving/plausible total — preferable to a flat 0.0 kWh).

Expected: once a meter's energy capability is removed from its template, existing entities for that meter should transparently start being computed via power integration, the same way a newly configured meter without an energy register would.
Actual: the entity's energy_meter in the DB stays frozen at its last known value, and daily history shows 0.0 kWh despite normal live power.

Happy to provide further sqlite dumps or logs if useful.

Steps to Reproduce

Custom Meter

⚠️ RETURN TO EVCC TAB → COPY STEP 2 → PASTE HERE

Version

v0.315.0-dev+a578893ed

System

linux/arm64, CEST +02:00

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions