Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draws from grid when house battery not full and 1p charge (maxGridSupplyWhileBatteryCharging) #15252

Open
toleabivol opened this issue Aug 5, 2024 · 14 comments
Labels
bug Something isn't working

Comments

@toleabivol
Copy link

toleabivol commented Aug 5, 2024

Describe the bug

Not totally sure if bug or my situation is really an edge case.

I have : go-e 3P charger, 1p AC charged Nissan Leaf 2018, Deye 3p Hybrid 8kW (3kW AC output per phase), 7,5kWp PV, HA
When PV produces more than the inverter can output on one phase (3kW+) and the house battery is not full and the 1p car is charing then it will pull from the grid the remaining needed charging power.
e.g. PV produces 7kW , then the inverter will supply 3kW to the charger and 4kW into the house battery and will draw 4kW from grid on the charging phase.
I though using maxGridSupplyWhileBatteryCharging: 50 would fix the issue and make the car load with maximum possible power without drawing more than 50W from grid. But the result is that it switches back and forth from a low max current to a higher max current.

When the house battery if full, the inverter will send the excess current not in battery but to the other phase of the grid and "balance" the import on the other phase => 0 costs calculated by the grid meter.

Steps to reproduce

  1. Have house battery not full
  2. Have 1p charging AC car
  3. Have inverter that outputs less on one phase AC than there is total DC available
  4. Set evcc to charge with solar only
  5. set maxGridSupplyWhileBatteryCharging: 50
  6. Have PV that generates more than inverter can output on one phase
  7. Charge the car and watch the house grid meter
  8. The grid meter shows that on the charing phase it draws power from grid to match the current set by evcc -> KO
  9. Charge house battery till full
  10. Now watch the grid meter again - inverter will export current on one phase to balance the import on another phase which results the grid meter to stay at ~0 (no import and no export overall calculated and thus no grid costs) -> OK

Configuration details

# for home assistant
# open evcc at http://evcc.local:7070
network:
  schema: http
  host: evcc.local # .local suffix announces the hostname on MDNS
  port: 7070

log: info
levels:
  cache: error

# unique installation id
plant: xxx

interval: 30s # control cycle interval

mqtt:
  broker: core-mosquitto:1883
  user: xxx
  password: xxx

meters:
- type: custom
  name: grid
  power:
    source: mqtt
    topic: SUNSYNK/status/2210249218/grid_power
  energy:
    source: mqtt
    topic: SUNSYNK/status/2210249218/day_grid_import
#  currents:
#    - source: mqtt
#      topic: deye/ac/l1/current
#   - source: mqtt
#      topic: deye/ac/l2/current
#    - source: mqtt
#      topic: deye/ac/l3/current

- type: custom
  name: pv1
  power:
    source: mqtt
    topic: SUNSYNK/status/2210249218/pv1_power
- type: custom
  name: pv2
  power:
    source: mqtt
    topic: SUNSYNK/status/2210249218/pv2_power

- type: custom
  name: battery
  soc:
    source: mqtt
    topic: SUNSYNK/status/2210249218/battery_soc
  power:
    source: mqtt
    topic: SUNSYNK/status/2210249218/battery_power
  capacity: 9.6

chargers:
- type: template
  template: go-e
  host: 192.168.xx.xx
  name: go-eCharger

vehicles:
- type: template
  template: carwings
  title: Nissan Leaf 2018
  icon: car
  user: xxx
  password: xxx
  vin: xxx
  capacity: 40
  phases: 1
  cache: 60m
#  onIdentify:
#    mode: pv
#    minSoc: 20
#    targetSoc: 80
#    minCurrent: 6
#    maxCurrent: 32
  name: nissan

loadpoints:
- title: Garage
  charger: go-eCharger
  mode: pv
#  resetOnDisconnect: true
  vehicle: nissan

site:
  title: My home
  meters:
    grid: grid
    pv:
      - pv1
      - pv2
    battery:
      - battery
  residualPower: 100
  maxGridSupplyWhileBatteryCharging: 50
#  batteryDischargeControl: true

tariffs:
  currency: EUR # (default EUR)
  grid:
    # static grid price
    #type: fixed
    #price: 0.3246
    #price: 0.2367 # [currency]/kWh tibber 1ste Monat

    type: tibber
    token: xxx
    homeid: "xxx"

  feedin:
    # rate for feeding excess (pv) energy to the grid
    type: fixed
    price: 0.082 # [currency]/kWh
  co2:
    type: grünstromindex
    zip: xxxxx

Log details

Log when house battery not full (draws from grid)

[site ] DEBUG 2024/08/05 12:05:09 ----
[lp-1 ] DEBUG 2024/08/05 12:05:09 charge power: 1840W
[lp-1 ] DEBUG 2024/08/05 12:05:09 charge currents: [8.3 0.1 0.1]A
[site ] DEBUG 2024/08/05 12:05:09 pv power: 4718W
[site ] DEBUG 2024/08/05 12:05:09 battery soc: 91%
[site ] DEBUG 2024/08/05 12:05:09 battery power: -2095W
[site ] DEBUG 2024/08/05 12:05:09 grid meter: 6W
[site ] DEBUG 2024/08/05 12:05:09 site power: -1989W
[lp-1 ] DEBUG 2024/08/05 12:05:09 charge voltages: [219 221 222]V
[lp-1 ] DEBUG 2024/08/05 12:05:09 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/05 12:05:09 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/05 12:05:09 charge total import: 1763.000kWh
[lp-1 ] DEBUG 2024/08/05 12:05:09 charger status: C
[lp-1 ] DEBUG 2024/08/05 12:05:09 soc estimated: 18.00% (vehicle: 18.00%)
[lp-1 ] DEBUG 2024/08/05 12:05:09 vehicle soc: 18%
[lp-1 ] DEBUG 2024/08/05 12:05:09 vehicle range: 42km
[lp-1 ] DEBUG 2024/08/05 12:05:09 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/05 12:05:09 pv charge current: 16.6A = 8A + 8.65A (-1989W @ 1p)
[lp-1 ] DEBUG 2024/08/05 12:05:09 max charge current: 16A
[site ] DEBUG 2024/08/05 12:05:39 ----
[lp-1 ] DEBUG 2024/08/05 12:05:39 charge power: 3670W
[lp-1 ] DEBUG 2024/08/05 12:05:39 charge currents: [16.4 0 0.1]A
[site ] DEBUG 2024/08/05 12:05:39 pv power: 4785W
[site ] DEBUG 2024/08/05 12:05:39 battery soc: 91%
[site ] DEBUG 2024/08/05 12:05:39 battery power: -892W
[site ] DEBUG 2024/08/05 12:05:39 grid meter: 773W
[site ] DEBUG 2024/08/05 12:05:39 site power: 873W
[lp-1 ] DEBUG 2024/08/05 12:05:39 charge voltages: [219 221 222]V
[lp-1 ] DEBUG 2024/08/05 12:05:39 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/05 12:05:39 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/05 12:05:39 charge total import: 1763.000kWh
[lp-1 ] DEBUG 2024/08/05 12:05:39 charger status: C
[lp-1 ] DEBUG 2024/08/05 12:05:39 soc estimated: 18.00% (vehicle: 18.00%)
[lp-1 ] DEBUG 2024/08/05 12:05:39 vehicle soc: 18%
[lp-1 ] DEBUG 2024/08/05 12:05:39 vehicle range: 42km
[lp-1 ] DEBUG 2024/08/05 12:05:39 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/05 12:05:39 pv charge current: 12.2A = 16A + -3.8A (873W @ 1p)
[lp-1 ] DEBUG 2024/08/05 12:05:39 max charge current: 12A
[site ] DEBUG 2024/08/05 12:06:09 ----
[lp-1 ] DEBUG 2024/08/05 12:06:09 charge power: 2690W
[lp-1 ] DEBUG 2024/08/05 12:06:09 charge currents: [11.9 0 0]A
[site ] DEBUG 2024/08/05 12:06:09 pv power: 4728W
[site ] DEBUG 2024/08/05 12:06:09 battery soc: 91%
[site ] DEBUG 2024/08/05 12:06:09 battery power: -1022W
[site ] DEBUG 2024/08/05 12:06:09 grid meter: 17W
[site ] DEBUG 2024/08/05 12:06:09 site power: -905W
[lp-1 ] DEBUG 2024/08/05 12:06:09 charge voltages: [220 221 222]V
[lp-1 ] DEBUG 2024/08/05 12:06:09 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/05 12:06:09 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/05 12:06:09 charge total import: 1763.000kWh
[lp-1 ] DEBUG 2024/08/05 12:06:09 charger status: C
[lp-1 ] DEBUG 2024/08/05 12:06:09 soc estimated: 18.00% (vehicle: 18.00%)
[lp-1 ] DEBUG 2024/08/05 12:06:09 vehicle soc: 18%
[lp-1 ] DEBUG 2024/08/05 12:06:09 vehicle range: 42km
[lp-1 ] DEBUG 2024/08/05 12:06:09 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/05 12:06:09 pv charge current: 15.9A = 12A + 3.93A (-905W @ 1p)
[lp-1 ] DEBUG 2024/08/05 12:06:09 max charge current: 15A
[site ] DEBUG 2024/08/05 12:06:39 ----
[lp-1 ] DEBUG 2024/08/05 12:06:39 charge power: 3390W
[lp-1 ] DEBUG 2024/08/05 12:06:39 charge currents: [15.1 0.1 0]A
[site ] DEBUG 2024/08/05 12:06:39 pv power: 4940W
[site ] DEBUG 2024/08/05 12:06:39 battery soc: 91%
[site ] DEBUG 2024/08/05 12:06:39 battery power: -1096W
[site ] DEBUG 2024/08/05 12:06:39 grid meter: 586W
[site ] DEBUG 2024/08/05 12:06:39 site power: 686W
[lp-1 ] DEBUG 2024/08/05 12:06:39 charge voltages: [219 220 221]V
[lp-1 ] DEBUG 2024/08/05 12:06:39 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/05 12:06:39 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/05 12:06:39 charge total import: 1763.000kWh
[lp-1 ] DEBUG 2024/08/05 12:06:39 charger status: C
[lp-1 ] DEBUG 2024/08/05 12:06:39 soc estimated: 18.00% (vehicle: 18.00%)
[lp-1 ] DEBUG 2024/08/05 12:06:39 vehicle soc: 18%
[lp-1 ] DEBUG 2024/08/05 12:06:39 vehicle range: 42km
[lp-1 ] DEBUG 2024/08/05 12:06:39 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/05 12:06:39 pv charge current: 12A = 15A + -2.98A (686W @ 1p)
[lp-1 ] DEBUG 2024/08/05 12:06:39 max charge current: 12A
[site ] DEBUG 2024/08/05 12:07:09 ----
[lp-1 ] DEBUG 2024/08/05 12:07:09 charge power: 2710W
[lp-1 ] DEBUG 2024/08/05 12:07:09 charge currents: [12.1 0.1 0]A
[site ] DEBUG 2024/08/05 12:07:09 pv power: 5149W
[site ] DEBUG 2024/08/05 12:07:09 battery soc: 91%
[site ] DEBUG 2024/08/05 12:07:09 battery power: -1425W
[site ] DEBUG 2024/08/05 12:07:09 grid meter: 13W
[site ] DEBUG 2024/08/05 12:07:09 site power: -1312W
[lp-1 ] DEBUG 2024/08/05 12:07:09 charge voltages: [219 221 222]V
[lp-1 ] DEBUG 2024/08/05 12:07:09 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/05 12:07:09 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/05 12:07:09 charge total import: 1763.000kWh
[lp-1 ] DEBUG 2024/08/05 12:07:09 charger status: C
[lp-1 ] DEBUG 2024/08/05 12:07:09 soc estimated: 18.00% (vehicle: 18.00%)
[lp-1 ] DEBUG 2024/08/05 12:07:09 vehicle soc: 18%
[lp-1 ] DEBUG 2024/08/05 12:07:09 vehicle range: 42km
[lp-1 ] DEBUG 2024/08/05 12:07:09 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/05 12:07:09 pv charge current: 17.7A = 12A + 5.7A (-1312W @ 1p)
[lp-1 ] DEBUG 2024/08/05 12:07:09 max charge current: 17A
[site ] DEBUG 2024/08/05 12:07:39 ----
[lp-1 ] DEBUG 2024/08/05 12:07:39 charge power: 3830W
[lp-1 ] DEBUG 2024/08/05 12:07:39 charge currents: [17.2 0 0]A
[site ] DEBUG 2024/08/05 12:07:39 pv power: 5143W
[site ] DEBUG 2024/08/05 12:07:39 battery soc: 91%
[site ] DEBUG 2024/08/05 12:07:39 battery power: -1255W
[site ] DEBUG 2024/08/05 12:07:39 grid meter: 993W
[site ] DEBUG 2024/08/05 12:07:39 site power: 1093W
[lp-1 ] DEBUG 2024/08/05 12:07:39 charge voltages: [219 221 221]V
[lp-1 ] DEBUG 2024/08/05 12:07:39 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/05 12:07:39 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/05 12:07:39 charge total import: 1763.000kWh
[lp-1 ] DEBUG 2024/08/05 12:07:39 charger status: C
[lp-1 ] DEBUG 2024/08/05 12:07:39 soc estimated: 18.00% (vehicle: 18.00%)
[lp-1 ] DEBUG 2024/08/05 12:07:39 vehicle soc: 18%
[lp-1 ] DEBUG 2024/08/05 12:07:39 vehicle range: 42km
[lp-1 ] DEBUG 2024/08/05 12:07:39 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/05 12:07:39 pv charge current: 12.2A = 17A + -4.75A (1093W @ 1p)
[lp-1 ] DEBUG 2024/08/05 12:07:39 max charge current: 12A
[site ] DEBUG 2024/08/05 12:08:09 ----
[lp-1 ] DEBUG 2024/08/05 12:08:09 charge power: 2690W
[lp-1 ] DEBUG 2024/08/05 12:08:09 charge currents: [12 0 0.1]A
[site ] DEBUG 2024/08/05 12:08:09 pv power: 5149W
[site ] DEBUG 2024/08/05 12:08:09 battery soc: 91%
[site ] DEBUG 2024/08/05 12:08:09 battery power: -1457W
[site ] DEBUG 2024/08/05 12:08:09 grid meter: 9W
[site ] DEBUG 2024/08/05 12:08:09 site power: -1348W
[lp-1 ] DEBUG 2024/08/05 12:08:09 charge voltages: [219 221 221]V
[lp-1 ] DEBUG 2024/08/05 12:08:09 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/05 12:08:09 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/05 12:08:09 charge total import: 1763.000kWh
[lp-1 ] DEBUG 2024/08/05 12:08:09 charger status: C
[lp-1 ] DEBUG 2024/08/05 12:08:09 soc estimated: 18.00% (vehicle: 18.00%)
[lp-1 ] DEBUG 2024/08/05 12:08:09 vehicle soc: 18%
[lp-1 ] DEBUG 2024/08/05 12:08:09 vehicle range: 42km
[lp-1 ] DEBUG 2024/08/05 12:08:09 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/05 12:08:09 pv charge current: 17.9A = 12A + 5.86A (-1348W @ 1p)
[lp-1 ] DEBUG 2024/08/05 12:08:09 max charge current: 17A
[site ] DEBUG 2024/08/05 12:08:39 ----

Log when house battery full (does not draw from grid)

[site ] DEBUG 2024/08/05 12:50:09 ----
[lp-1 ] DEBUG 2024/08/05 12:50:09 charge power: 4220W
[lp-1 ] DEBUG 2024/08/05 12:50:09 charge currents: [19 0 0]A
[site ] DEBUG 2024/08/05 12:50:09 pv power: 5498W
[site ] DEBUG 2024/08/05 12:50:09 battery soc: 100%
[site ] DEBUG 2024/08/05 12:50:09 battery power: 1W
[site ] DEBUG 2024/08/05 12:50:09 grid meter: -213W
[site ] DEBUG 2024/08/05 12:50:09 site power: -112W
[lp-1 ] DEBUG 2024/08/05 12:50:09 charge voltages: [217 219 221]V
[lp-1 ] DEBUG 2024/08/05 12:50:09 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/05 12:50:09 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/05 12:50:09 !! session: chargeRater.chargedEnergy=2.0 - chargedAtStartup=0.0
[lp-1 ] DEBUG 2024/08/05 12:50:09 charge total import: 1765.000kWh
[lp-1 ] DEBUG 2024/08/05 12:50:09 charger status: C
[lp-1 ] DEBUG 2024/08/05 12:50:09 soc estimated: 23.25% (vehicle: 21.00%)
[lp-1 ] DEBUG 2024/08/05 12:50:09 vehicle soc: 23%
[lp-1 ] DEBUG 2024/08/05 12:50:09 vehicle range: 49km
[lp-1 ] DEBUG 2024/08/05 12:50:09 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/05 12:50:09 pv charge current: 19.5A = 19A + 0.489A (-112W @ 1p)
[site ] DEBUG 2024/08/05 12:50:39 ----
[lp-1 ] DEBUG 2024/08/05 12:50:39 charge power: 4220W
[lp-1 ] DEBUG 2024/08/05 12:50:39 charge currents: [18.9 0.1 0]A
[site ] DEBUG 2024/08/05 12:50:39 pv power: 5498W
[site ] DEBUG 2024/08/05 12:50:39 battery soc: 100%
[site ] DEBUG 2024/08/05 12:50:39 battery power: 1W
[site ] DEBUG 2024/08/05 12:50:39 grid meter: -213W
[site ] DEBUG 2024/08/05 12:50:39 site power: -112W
[lp-1 ] DEBUG 2024/08/05 12:50:39 charge voltages: [218 219 220]V
[lp-1 ] DEBUG 2024/08/05 12:50:39 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/05 12:50:39 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/05 12:50:39 !! session: chargeRater.chargedEnergy=2.0 - chargedAtStartup=0.0
[lp-1 ] DEBUG 2024/08/05 12:50:39 charge total import: 1765.000kWh
[lp-1 ] DEBUG 2024/08/05 12:50:39 charger status: C
[lp-1 ] DEBUG 2024/08/05 12:50:39 soc estimated: 23.25% (vehicle: 21.00%)
[lp-1 ] DEBUG 2024/08/05 12:50:39 vehicle soc: 23%
[lp-1 ] DEBUG 2024/08/05 12:50:39 vehicle range: 49km
[lp-1 ] DEBUG 2024/08/05 12:50:39 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/05 12:50:39 pv charge current: 19.5A = 19A + 0.489A (-112W @ 1p)
[site ] DEBUG 2024/08/05 12:51:09 ----
[lp-1 ] DEBUG 2024/08/05 12:51:09 charge power: 4260W
[lp-1 ] DEBUG 2024/08/05 12:51:09 charge currents: [19.1 0 0]A
[site ] DEBUG 2024/08/05 12:51:09 pv power: 5428W
[site ] DEBUG 2024/08/05 12:51:09 battery soc: 100%
[site ] DEBUG 2024/08/05 12:51:09 battery power: 0W
[site ] DEBUG 2024/08/05 12:51:09 grid meter: -225W
[site ] DEBUG 2024/08/05 12:51:09 site power: -125W
[lp-1 ] DEBUG 2024/08/05 12:51:09 charge voltages: [218 220 220]V
[lp-1 ] DEBUG 2024/08/05 12:51:09 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/05 12:51:09 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/05 12:51:09 !! session: chargeRater.chargedEnergy=2.0 - chargedAtStartup=0.0
[lp-1 ] DEBUG 2024/08/05 12:51:09 charge total import: 1765.000kWh
[lp-1 ] DEBUG 2024/08/05 12:51:09 charger status: C
[lp-1 ] DEBUG 2024/08/05 12:51:09 soc estimated: 23.25% (vehicle: 21.00%)
[lp-1 ] DEBUG 2024/08/05 12:51:09 vehicle soc: 23%
[lp-1 ] DEBUG 2024/08/05 12:51:09 vehicle range: 49km
[lp-1 ] DEBUG 2024/08/05 12:51:09 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/05 12:51:09 pv charge current: 19.5A = 19A + 0.542A (-125W @ 1p)

What type of operating system are you running?

Linux

Version

1.129.0

@premultiply
Copy link
Member

Thank you for the report.

@andig I think we have to investigate a bit deeper what exactly happens here.

@premultiply premultiply added bug Something isn't working backlog Things to do later labels Aug 5, 2024
@andig andig removed the backlog Things to do later label Aug 7, 2024
@andig
Copy link
Member

andig commented Aug 8, 2024

Das Problem ist das nichtlineare Verhalten. Bei Bezug wird die WB-Leistung zurück gefahren. Wird die aber zu klein- und kann die Batterie die zusätzliche Leistung nicht aufnehmen (die ist am Ladeende!)- so kommt es zu Einspeisung. Die wird dann wieder zugunsten der WB umgeshiftet.

Das eigentliche Problem hier scheint mir aber zu sein, dass die Batterie einfach nicht liefert:

[site ] DEBUG 2024/08/05 12:05:39 pv power: 4785W
[site ] DEBUG 2024/08/05 12:05:39 battery soc: 91%
[site ] DEBUG 2024/08/05 12:05:39 battery power: -892W
[site ] DEBUG 2024/08/05 12:05:39 grid meter: 773W
[site ] DEBUG 2024/08/05 12:05:39 site power: 873W

Warum liefert hier der Akku nicht die 870W die aus dem Netz gezogen werden???

Ich sehe da kein Problem bei evcc.

@andig andig added question Rather clarification than issue and removed bug Something isn't working labels Aug 8, 2024
@toleabivol
Copy link
Author

toleabivol commented Aug 9, 2024

Warum liefert hier der Akku nicht die 870W die aus dem Netz gezogen werden???

Because inverter cannot output more on that one phase that is used and draws from grid and the rest of PV generation goes to battery even if battery.

PV produces more than the inverter can output on one phase (3kW+) and the house battery is not full and the 1p car is charing then it will pull from the grid the remaining needed charging power.

Deye 3p Hybrid 8kW (3kW AC output per phase)

When PV produces more than the inverter can output on one phase (3kW+) and the house battery is not full and the 1p car is charing then it will pull from the grid the remaining needed charging power.

And this sounds exactly what maxGridSupplyWhileBatteryCharging should do as it also answer your question :

Normally, the current battery charging power is considered as additional available vehicle charging power (once prioritySoc is reached). In the above example, grid consumption could occur equal to the current battery charging power since the inverter cannot provide this power to the grid (and thus the vehicle). The fully utilized AC path of the hybrid inverter creates an unexpected bottleneck for the standard regulation.

the DC power generated in combination with a directly connected storage system can be greater than the AC output power of the inverter. This can result in grid consumption during vehicle charging, even when the battery is being charged simultaneously.

In this case evcc should do (and from docs it's exactly what it's already thought to do as I read it) :

  • if battery not full : detect grid import and allow only the threshold specified in maxGridSupplyWhileBatteryCharging
  • if battery full : ignore setting of maxGridSupplyWhileBatteryCharging

From my logs you can see it is detecting grid import, lowers the current BUT then it switches back. And then it switches back and forth.

it switches back and forth from a low max current to a higher max current.

And this back and forth switch makes me believe it's a bug

@andig
Copy link
Member

andig commented Aug 9, 2024

Because inverter cannot output more on that one phase that is used and draws from grid and the rest of PV generation goes to battery even if battery.

Maybe I misunderstand. But we've said the inverter has 3kW per phase. Where is that power?

@toleabivol
Copy link
Author

toleabivol commented Aug 9, 2024

Most of it goes into the car charger and some goes to appliances in the house that are on the same phase.
From the part of the log you quoted,
PV outputs 4785
Charger sends to car 3670W
Drawn from grid 773 (this is ~what inverter cannot output on the phase so it draws from grid, and what we want to keep at ~0)
Charging house battery 892W (This is what's left from PV output - max phase output - other house appliances on other phases)

[lp-1 ] DEBUG 2024/08/05 12:05:09 max charge current: 16A
[site ] DEBUG 2024/08/05 12:05:39 ----
[lp-1 ] DEBUG 2024/08/05 12:05:39 charge power: **3670W**  <---Here is most of the output power of AC + grid import
[lp-1 ] DEBUG 2024/08/05 12:05:39 charge currents: [16.4 0 0.1]A
[site ] DEBUG 2024/08/05 12:05:39 pv power: 4785W
[site ] DEBUG 2024/08/05 12:05:39 battery soc: 91%
[site ] DEBUG 2024/08/05 12:05:39 battery power: -892W
[site ] DEBUG 2024/08/05 12:05:39 grid meter: 773W
[site ] DEBUG 2024/08/05 12:05:39 site power: 873W

@toleabivol
Copy link
Author

Not sure if it's the same issue, but it seems to be, because after adding this parameter it behave strange, here is one example when it went to full 32A (6.3kW) when PV has only ~4.5KW generation and battery SOC is not at 95%+ when it should support charging.

[site ] DEBUG 2024/08/09 11:51:43 ----
[lp-1 ] DEBUG 2024/08/09 11:51:43 charge power: 1320W
[lp-1 ] DEBUG 2024/08/09 11:51:43 charge currents: [5.9 0 0]A
[site ] DEBUG 2024/08/09 11:51:43 pv power: 4598W
[site ] DEBUG 2024/08/09 11:51:43 battery soc: 77%
[site ] DEBUG 2024/08/09 11:51:43 battery power: -2497W
[site ] DEBUG 2024/08/09 11:51:43 grid meter: 7W
[site ] DEBUG 2024/08/09 11:51:43 site power: -2390W
[lp-1 ] DEBUG 2024/08/09 11:51:43 charge voltages: [220 221 222]V
[lp-1 ] DEBUG 2024/08/09 11:51:43 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/09 11:51:43 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/09 11:51:43 !! session: chargeRater.chargedEnergy=1.0 - chargedAtStartup=0.0
[lp-1 ] DEBUG 2024/08/09 11:51:43 charge total import: 1794.000kWh
[lp-1 ] DEBUG 2024/08/09 11:51:43 charger status: C
[lp-1 ] DEBUG 2024/08/09 11:51:43 soc estimated: 54.00% (vehicle: 54.00%)
[lp-1 ] DEBUG 2024/08/09 11:51:43 vehicle soc: 54%
[lp-1 ] DEBUG 2024/08/09 11:51:43 vehicle range: 125km
[lp-1 ] DEBUG 2024/08/09 11:51:43 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/09 11:51:43 pv charge current: 16.4A = 6A + 10.4A (-2390W @ 1p)
[lp-1 ] DEBUG 2024/08/09 11:51:44 max charge current: 16A
[site ] DEBUG 2024/08/09 11:52:13 ----
[lp-1 ] DEBUG 2024/08/09 11:52:13 charge power: 3600W
[lp-1 ] DEBUG 2024/08/09 11:52:13 charge currents: [16.1 0 0.1]A
[site ] DEBUG 2024/08/09 11:52:13 pv power: 4598W
[site ] DEBUG 2024/08/09 11:52:13 battery soc: 77%
[site ] DEBUG 2024/08/09 11:52:13 battery power: -2497W
[site ] DEBUG 2024/08/09 11:52:13 grid meter: 7W
[site ] DEBUG 2024/08/09 11:52:13 site power: -2390W
[lp-1 ] DEBUG 2024/08/09 11:52:13 charge voltages: [219 222 222]V
[lp-1 ] DEBUG 2024/08/09 11:52:13 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/09 11:52:13 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/09 11:52:13 !! session: chargeRater.chargedEnergy=2.0 - chargedAtStartup=0.0
[lp-1 ] DEBUG 2024/08/09 11:52:13 charge total import: 1795.000kWh
[lp-1 ] DEBUG 2024/08/09 11:52:13 charger status: C
[lp-1 ] DEBUG 2024/08/09 11:52:13 soc estimated: 56.25% (vehicle: 54.00%)
[lp-1 ] DEBUG 2024/08/09 11:52:13 vehicle soc: 56%
[lp-1 ] DEBUG 2024/08/09 11:52:13 vehicle range: 125km
[lp-1 ] DEBUG 2024/08/09 11:52:13 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/09 11:52:13 pv charge current: 26.4A = 16A + 10.4A (-2390W @ 1p)
[lp-1 ] DEBUG 2024/08/09 11:52:14 max charge current: 26A
[site ] DEBUG 2024/08/09 11:52:43 ----
[lp-1 ] DEBUG 2024/08/09 11:52:44 charge power: 5860W
[lp-1 ] DEBUG 2024/08/09 11:52:44 charge currents: [26.2 0.1 0]A
[site ] DEBUG 2024/08/09 11:52:44 pv power: 4598W
[site ] DEBUG 2024/08/09 11:52:44 battery soc: 77%
[site ] DEBUG 2024/08/09 11:52:44 battery power: -2497W
[site ] DEBUG 2024/08/09 11:52:44 grid meter: 7W
[site ] DEBUG 2024/08/09 11:52:44 site power: -2390W
[lp-1 ] DEBUG 2024/08/09 11:52:44 charge voltages: [218 222 222]V
[lp-1 ] DEBUG 2024/08/09 11:52:44 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/09 11:52:44 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/09 11:52:44 !! session: chargeRater.chargedEnergy=2.0 - chargedAtStartup=0.0
[lp-1 ] DEBUG 2024/08/09 11:52:44 charge total import: 1795.000kWh
[lp-1 ] DEBUG 2024/08/09 11:52:44 charger status: C
[lp-1 ] DEBUG 2024/08/09 11:52:44 soc estimated: 56.25% (vehicle: 54.00%)
[lp-1 ] DEBUG 2024/08/09 11:52:44 vehicle soc: 56%
[lp-1 ] DEBUG 2024/08/09 11:52:44 vehicle range: 125km
[lp-1 ] DEBUG 2024/08/09 11:52:44 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/09 11:52:44 pv charge current: 36.4A = 26A + 10.4A (-2390W @ 1p)
[lp-1 ] DEBUG 2024/08/09 11:52:44 max charge current: 32A
[site ] DEBUG 2024/08/09 11:53:13 ----
[lp-1 ] DEBUG 2024/08/09 11:53:13 charge power: 6370W
[lp-1 ] DEBUG 2024/08/09 11:53:13 charge currents: [28.5 0 0]A
[site ] DEBUG 2024/08/09 11:53:13 pv power: 4598W
[site ] DEBUG 2024/08/09 11:53:13 battery soc: 77%
[site ] DEBUG 2024/08/09 11:53:13 battery power: -2497W
[site ] DEBUG 2024/08/09 11:53:13 grid meter: 7W
[site ] DEBUG 2024/08/09 11:53:13 site power: -2390W
[lp-1 ] DEBUG 2024/08/09 11:53:14 charge voltages: [217 222 223]V
[lp-1 ] DEBUG 2024/08/09 11:53:14 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/09 11:53:14 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/09 11:53:14 !! session: chargeRater.chargedEnergy=2.0 - chargedAtStartup=0.0
[lp-1 ] DEBUG 2024/08/09 11:53:14 charge total import: 1795.000kWh
[lp-1 ] DEBUG 2024/08/09 11:53:14 charger status: C
[lp-1 ] DEBUG 2024/08/09 11:53:14 soc estimated: 56.25% (vehicle: 54.00%)
[lp-1 ] DEBUG 2024/08/09 11:53:14 vehicle soc: 56%
[lp-1 ] DEBUG 2024/08/09 11:53:14 vehicle range: 125km
[lp-1 ] DEBUG 2024/08/09 11:53:14 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/09 11:53:14 pv charge current: 40.9A = 30.5A + 10.4A (-2390W @ 1p)
[site ] DEBUG 2024/08/09 11:53:43 ----
[lp-1 ] DEBUG 2024/08/09 11:53:43 charge power: 6350W
[lp-1 ] DEBUG 2024/08/09 11:53:43 charge currents: [28.4 0.1 0.1]A
[site ] DEBUG 2024/08/09 11:53:43 pv power: 4598W
[site ] DEBUG 2024/08/09 11:53:43 battery soc: 77%
[site ] DEBUG 2024/08/09 11:53:44 battery power: -2497W
[site ] DEBUG 2024/08/09 11:53:44 grid meter: 7W
[site ] DEBUG 2024/08/09 11:53:44 site power: -2390W
[lp-1 ] DEBUG 2024/08/09 11:53:44 charge voltages: [217 222 222]V
[lp-1 ] DEBUG 2024/08/09 11:53:44 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/09 11:53:44 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/09 11:53:44 !! session: chargeRater.chargedEnergy=2.0 - chargedAtStartup=0.0
[lp-1 ] DEBUG 2024/08/09 11:53:44 charge total import: 1795.000kWh
[lp-1 ] DEBUG 2024/08/09 11:53:44 charger status: C
[lp-1 ] DEBUG 2024/08/09 11:53:44 soc estimated: 56.25% (vehicle: 54.00%)
[lp-1 ] DEBUG 2024/08/09 11:53:44 vehicle soc: 56%
[lp-1 ] DEBUG 2024/08/09 11:53:44 vehicle range: 125km
[lp-1 ] DEBUG 2024/08/09 11:53:44 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/09 11:53:44 pv charge current: 40.8A = 30.4A + 10.4A (-2390W @ 1p)
[site ] DEBUG 2024/08/09 11:54:13 ----
[lp-1 ] DEBUG 2024/08/09 11:54:13 charge power: 6350W
[lp-1 ] DEBUG 2024/08/09 11:54:13 charge currents: [28.5 0 0.1]A
[site ] DEBUG 2024/08/09 11:54:13 pv power: 4598W
[site ] DEBUG 2024/08/09 11:54:13 battery soc: 77%
[site ] DEBUG 2024/08/09 11:54:13 battery power: -2497W
[site ] DEBUG 2024/08/09 11:54:13 grid meter: 7W
[site ] DEBUG 2024/08/09 11:54:13 site power: -2390W
[lp-1 ] DEBUG 2024/08/09 11:54:13 charge voltages: [218 222 222]V
[lp-1 ] DEBUG 2024/08/09 11:54:13 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/09 11:54:13 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/09 11:54:13 !! session: chargeRater.chargedEnergy=2.0 - chargedAtStartup=0.0
[lp-1 ] DEBUG 2024/08/09 11:54:13 charge total import: 1795.000kWh
[lp-1 ] DEBUG 2024/08/09 11:54:13 charger status: C
[lp-1 ] DEBUG 2024/08/09 11:54:13 soc estimated: 56.25% (vehicle: 54.00%)
[lp-1 ] DEBUG 2024/08/09 11:54:13 vehicle soc: 56%
[lp-1 ] DEBUG 2024/08/09 11:54:13 vehicle range: 125km
[lp-1 ] DEBUG 2024/08/09 11:54:13 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/09 11:54:13 pv charge current: 40.9A = 30.5A + 10.4A (-2390W @ 1p)
[site ] DEBUG 2024/08/09 11:54:43 ----
[lp-1 ] DEBUG 2024/08/09 11:54:43 charge power: 6350W
[lp-1 ] DEBUG 2024/08/09 11:54:43 charge currents: [28.6 0 0]A
[site ] DEBUG 2024/08/09 11:54:43 pv power: 4672W
[site ] DEBUG 2024/08/09 11:54:43 battery soc: 77%
[site ] DEBUG 2024/08/09 11:54:43 battery power: -941W
[site ] DEBUG 2024/08/09 11:54:44 grid meter: 3653W
[site ] DEBUG 2024/08/09 11:54:44 site power: 3753W
[lp-1 ] DEBUG 2024/08/09 11:54:44 charge voltages: [217 222 222]V
[lp-1 ] DEBUG 2024/08/09 11:54:44 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/09 11:54:44 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/09 11:54:44 !! session: chargeRater.chargedEnergy=2.0 - chargedAtStartup=0.0
[lp-1 ] DEBUG 2024/08/09 11:54:44 charge total import: 1795.000kWh
[lp-1 ] DEBUG 2024/08/09 11:54:44 charger status: C
[lp-1 ] DEBUG 2024/08/09 11:54:44 soc estimated: 56.25% (vehicle: 54.00%)
[lp-1 ] DEBUG 2024/08/09 11:54:44 vehicle soc: 56%
[lp-1 ] DEBUG 2024/08/09 11:54:44 vehicle range: 125km
[lp-1 ] DEBUG 2024/08/09 11:54:44 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/09 11:54:44 pv charge current: 14.3A = 30.6A + -16.3A (3753W @ 1p)
[lp-1 ] DEBUG 2024/08/09 11:54:44 max charge current: 14A
[site ] DEBUG 2024/08/09 11:55:13 ----
[lp-1 ] DEBUG 2024/08/09 11:55:13 charge power: 3150W
[lp-1 ] DEBUG 2024/08/09 11:55:13 charge currents: [14 0 0]A
[site ] DEBUG 2024/08/09 11:55:13 pv power: 4650W
[site ] DEBUG 2024/08/09 11:55:13 battery soc: 78%
[site ] DEBUG 2024/08/09 11:55:13 battery power: -944W
[site ] DEBUG 2024/08/09 11:55:13 grid meter: 349W
[site ] DEBUG 2024/08/09 11:55:13 site power: 449W
[lp-1 ] DEBUG 2024/08/09 11:55:13 charge voltages: [219 222 222]V
[lp-1 ] DEBUG 2024/08/09 11:55:13 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/09 11:55:13 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/09 11:55:13 !! session: chargeRater.chargedEnergy=2.0 - chargedAtStartup=0.0
[lp-1 ] DEBUG 2024/08/09 11:55:13 charge total import: 1795.000kWh
[lp-1 ] DEBUG 2024/08/09 11:55:13 charger status: C
[lp-1 ] DEBUG 2024/08/09 11:55:13 soc estimated: 56.25% (vehicle: 54.00%)
[lp-1 ] DEBUG 2024/08/09 11:55:13 vehicle soc: 56%
[lp-1 ] DEBUG 2024/08/09 11:55:13 vehicle range: 125km
[lp-1 ] DEBUG 2024/08/09 11:55:13 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/09 11:55:13 pv charge current: 12A = 14A + -1.95A (449W @ 1p)
[lp-1 ] DEBUG 2024/08/09 11:55:14 max charge current: 12A
[site ] DEBUG 2024/08/09 11:55:43 ----
[lp-1 ] DEBUG 2024/08/09 11:55:43 charge power: 2700W
[lp-1 ] DEBUG 2024/08/09 11:55:43 charge currents: [12 0.1 0]A
[site ] DEBUG 2024/08/09 11:55:43 pv power: 4650W
[site ] DEBUG 2024/08/09 11:55:43 battery soc: 78%
[site ] DEBUG 2024/08/09 11:55:43 battery power: -1173W
[site ] DEBUG 2024/08/09 11:55:43 grid meter: 17W
[site ] DEBUG 2024/08/09 11:55:43 site power: -1056W
[lp-1 ] DEBUG 2024/08/09 11:55:43 charge voltages: [220 221 222]V
[lp-1 ] DEBUG 2024/08/09 11:55:43 detected connected phases: 3p
[lp-1 ] DEBUG 2024/08/09 11:55:43 detected active phases: 1p
[lp-1 ] DEBUG 2024/08/09 11:55:43 !! session: chargeRater.chargedEnergy=2.0 - chargedAtStartup=0.0
[lp-1 ] DEBUG 2024/08/09 11:55:43 charge total import: 1795.000kWh
[lp-1 ] DEBUG 2024/08/09 11:55:43 charger status: C
[lp-1 ] DEBUG 2024/08/09 11:55:43 soc estimated: 56.25% (vehicle: 54.00%)
[lp-1 ] DEBUG 2024/08/09 11:55:43 vehicle soc: 56%
[lp-1 ] DEBUG 2024/08/09 11:55:43 vehicle range: 125km
[lp-1 ] DEBUG 2024/08/09 11:55:43 !! active phases: 1p = min(1p measured 1p vehicle 3p physical 0p charger)
[lp-1 ] DEBUG 2024/08/09 11:55:43 pv charge current: 16.6A = 12A + 4.59A (-1056W @ 1p)
[lp-1 ] DEBUG 2024/08/09 11:55:44 max charge current: 16A

@andig
Copy link
Member

andig commented Aug 9, 2024

Wie erfolgt denn die Batterieladung? Benötigt die auch den (limitierenden) AC Pfad oder direkt über DC?

@toleabivol
Copy link
Author

House battery is connected to DC port of the inverter. In the case above it will be charged directly from PV via inverter via the DC path.

@andig
Copy link
Member

andig commented Aug 9, 2024

// sitePower returns the available delta power that the charger might additionally consume
// negative value: available power (grid export), positive value: grid import
func sitePower(log *util.Logger, maxGrid, grid, battery, residual float64) float64 {
	// For hybrid inverters, battery can be charged from DC power in excess of
	// inverter AC rating. This battery charge must not be counted as available for AC consumption.
	// https://github.com/evcc-io/evcc/issues/2734, https://github.com/evcc-io/evcc/issues/2986
	if maxGrid > 0 && grid > maxGrid && battery < 0 {
		log.TRACE.Printf("ignoring excess DC charging due to grid consumption: %.0fW > %.0fW", grid, maxGrid)
		battery = 0
	}

	return grid + battery + residual
}

Das produziert bei Über/Unterschreitung der Schwelle einen Sprung um battery. Das ist hier das Problem.

@toleabivol
Copy link
Author

So it's a bug ?

@andig andig added bug Something isn't working and removed question Rather clarification than issue labels Aug 16, 2024
@jmtatsch
Copy link
Sponsor

I am also troubled by this issue, see #15329
Losing about 10 % of solar charging share because of this bug.

@WordsOfMe
Copy link
Sponsor Contributor

Same here. I have a 32 A wallbox and a 12 kW inverter which cannot deliver (convert from PV or battery DC to AC) more than 5 kW per phase. The automated phase switching is enabled, and occasionally evcc remains at 1 phase and approaches 22 A (5 kW) instead of switching to three phase mode. The inverter reaches its limit on one phase, and the remaining power is drawn from the grid:
Bildschirmfoto vom 2024-08-25 14-23-58
As a workaround I now manually limit to 16 A when charging in PV mode.

@Peter54879

This comment was marked as off-topic.

@jmtatsch
Copy link
Sponsor

jmtatsch commented Sep 8, 2024

Today I lost around 2 kwh (20%) while only slow charging (3,5kw) with a charging brick on one phase.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants