evcc: Sometimes the black visualization bargraph overflows to the right
Describe the bug
See attached picture, I think the upper brace (sun+grid) is shown correct,
but the green bar is too long. Green bar shows 1.8kW sun, but the legend on the left says only 1.5kW.

To Reproduce Steps to reproduce the behavior:
- I have attached below an dummy config file with static meter values which produce this bar situation for easy reproduction
Expected behavior I assume the green and the black grid power bars should be inside the braces, not one attached to the right.
EVCC details:
Show output of evcc -v:
evcc version 0.66 (a5fb9d4)
Show evcc configuration file evcc.yaml:
uri: 0.0.0.0:7070 # uri for ui interval: 10s # control cycle interval
sponsor token enables optional features (request at https://cloud.evcc.io)
sponsortoken:
log settings
log: error levels: core: debug lp-1: debug lp-2: debug
meter definitions
name can be freely chosen and is used as reference when assigning meters to site and loadpoints
for examples see https://github.com/evcc-io/config#meters
meters:
- name: grid type: custom power: source: script cmd: > /bin/bash -c “echo 300”
- name: battery type: custom power: source: script cmd: > /bin/bash -c “echo -700” soc: source: script cmd: > /bin/bash -c “88”
- name: pv type: custom power: source: script cmd: > /bin/bash -c “echo 1500”
site describes the EVU connection, PV and home battery
site: title: TestInstall # display name for UI meters: grid: grid # grid meter pvs: - pv # list of pv inverters/ meters battery: battery # battery meter prioritySoC: # give home battery priority up to this soc (empty to disable) bufferSoC: # ignore home battery discharge above soc (empty to disable)
chargers:
- name: testCharger type: go-e uri: http://127.0.0.1
loadpoints:
- title: Nowhere charger: testCharger
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 29 (17 by maintainers)
Ahhhhhhh, mir schwant was. Das Log hilft, danke!
passend dazu zum selben Zeitpunkt der Log:
…
der Fehler im oberen Post war, dass ich 0W Hausverbrauch habe ? … wieso sollte das System sonst Strom aus dem Netz beziehen, zudem steht im Balken 200W obwohl aber über 700W erzeugt werden …
jetzt das selbe: es kommen 146 Watt vom Wechselrichter und ich beziehe 1274 Watt aus dem Netz, bei einem Hausverbrauch von (146+1274=) 1420 Watt (stimmt mit dem was ich am S10 ablese überein ! EVCC sagt aber ich habe “nur” einen Hausverbrauch von 1128 Watt …
The “fix” is wrong, see this image. “PV” is correct, “export” as well, “Verbrauch” not. The code is missing substracting export:
homePower := gridImport + site.pvPower + site.batteryPoweris wrong.site.gridPower und site.batteryPower waren vorher mit min(0, _) versehen.
https://github.com/evcc-io/evcc/pull/1718/files#diff-7aa5baae0bd3243f85bfc6db64612f7450eb0170fa310ca2c93dc3968fc02e02R393
Aber die Kombination von Akku-Laden bei gleichzeitigem Netzbezug bringt auch die Eigenverbrauch/Netzbezugsberechnung in der UI durcheinander.