evcc reads wrong data from Hoymiles & Co.
Description
Describe the bug Some balcony power plant (Balkonkraftwerk) APIs do not provide a continuously increasing lifetime energy counter.
Instead, the API returns:
Valid total energy values during the day A value of 0 during the night This causes problems with the Optimizer because evcc expects a continuously increasing total energy counter.
The actual power and energy values are otherwise correct and available. Only the nighttime reset to 0 causes the Optimizer data to become unusable.
Expected behavior evcc should be able to handle energy meters that temporarily report 0 during nighttime and continue processing the previously known total energy value.
Possible approaches:
Ignore temporary nighttime resets to 0 Keep the last valid total energy value until a new valid value is received Add an optional configuration parameter for devices that do not provide a monotonic total energy counter Actual behavior The meter reports valid values during the day but resets to 0 at night.
As a result, the Optimizer cannot correctly build a continuous energy profile.
Steps to reproduce Configure a Balkonkraftwerk / inverter API that reports total energy. Observe that the API returns valid cumulative values during daytime. During nighttime, the API returns 0. Optimizer data becomes incomplete or invalid because the total energy counter is no longer monotonic. Additional context The device works correctly otherwise.
The issue is specifically caused by APIs that do not provide a continuously increasing lifetime energy counter and instead return 0 when no production is available.
Example behavior:
Daytime:
Total Energy: 1234.5 kWh Night:
Total Energy: 0 kWh Next Day:
Total Energy: 1235.2 kWh It would be helpful if evcc could tolerate this behavior, as it appears to be common for some balcony power plant APIs.
Steps to Reproduce
Steps to Reproduce Configure a Hoymiles (or similar balcony power plant) inverter as a PV source in evcc. Wait until the inverter stops producing energy after sunset. Check the value reported by the inverter API for total/lifetime energy. Observe that the API returns 0 instead of the last cumulative energy value. Open the Optimizer and review the generated production data. Notice that the energy history is no longer continuous because the cumulative energy counter is reset to 0 during the night. β οΈ RETURN TO EVCC TAB β COPY STEP 2 β PASTE HERE
Version v0.309.1
System linux/amd64, CEST +02:00
#29764
β οΈ RETURN TO EVCC TAB β COPY STEP 2 β PASTE HERE
Version
v0.309.1
System
linux/amd64, CEST +02:00
Unfortunately your report is missing a detailed log file. Without log, we donβt have the information for diagnosing the issue described. See https://docs.evcc.io/docs/faq#wie-kann-ich-ein-logfile-zur-fehleranalyse-erstellen.
evcc should be able to handle energy meters that temporarily report 0 during nighttime and continue processing the previously known total energy value.
These are not suitable as "meters" and simply must be removed. Feel free to open PR.
Log seems to show 1234.5 β 0 β 1235.2 which is garbage. We'll just need to remove this.
is there anything you need from me that helps ??