evcc-io / evcc

Sonne tanken ☀️🚘
https://evcc.io
MIT License
3.59k stars 663 forks source link

evcc charges in PV mode after each container restart for 5 minutes regardless of PV production #568

Closed goebelmeier closed 3 years ago

goebelmeier commented 3 years ago

Describe the bug evcc charges in PV mode after each container restart for 5 minutes regardless of PV production

To Reproduce Steps to reproduce the behavior:

  1. Stop all containers
  2. Start a new evcc container or let watchtower spawn a new one after updating
  3. Have a look out of your window into the darkness
  4. Get telegram message "Started charging in "pv" mode"
  5. Wait 5 minutes
  6. Get telegram message about finished charging because site power is over disable threshold

Expected behavior evcc should not even start charging in pv mode if site power exceeds production.

EVCC details: Show output of evcc -v:

[13:02:01] openhabian@openHABianPi:~$ docker-compose exec evcc evcc -v
evcc version 0.38 (a0df9b4)
Show output of evcc dump -c configfile:
config
======

grid: e3dc-grid
---------------
Power: -4W

pv: e3dc-pv
-----------
Power: -452W

battery: e3dc-battery
---------------------
Power: -24W
SoC:   11%

loadpoint 1
===========

charger: wallbe
---------------
Power:          0W
Energy:         7614.5kWh
Current L1..L3: 0.0314A 0A 0A
Enabled:        false
Duration:       1h5m58s
Charge status:  A
Diagnostic dump:
Firmware:   SL-01.03.08

Show evcc configuration file evcc.yaml:
[13:04:13] openhabian@openHABianPi:~$ cat evcc.yaml
uri: 0.0.0.0:7070 # uri for ui
interval: 10s # control cycle interval

# log settings
log: error
levels:
  core: debug
  lp-1: debug
  vw: trace
  id: trace

# 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/andig/evcc-config#meters
meters:
- name: e3dc-pv
  type: default
  power:
    type: modbus
    uri: 192.168.4.77:502
    id: 1
    register:
      address: 40067
      type: holding
      decode: int32s
    scale: -1 # reverse direction
- name: e3dc-grid
  type: default
  power:
    type: modbus
    uri: 192.168.4.77:502
    id: 1
    register: # manual register configuration
      address: 40073
      type: holding
      decode: int32s
- name: e3dc-battery
  type: default
  power:
    type: modbus
    uri: 192.168.4.77:502
    id: 1
    register: # manual register configuration
      address: 40069
      type: holding
      decode: int32s
    scale: -1 # reverse direction
  soc:
    type: modbus
    uri: 192.168.4.77:502
    id: 1
    register:
      address: 40082
      type: holding
      decode: uint16

# charger definitions
# name can be freely chosen and is used as reference when assigning charger to vehicle
# for examples see https://github.com/andig/evcc-config#chargers
chargers:
- name: wallbe
  type: wallbe # Wallbe charger
  uri: 192.168.4.98:502 # ModBus address
  legacy: false
  meter:
    power: true
    energy: true
    currents: true
    encoding: sdm

# vehicle definitions
# name can be freely chosen and is used as reference when assigning vehicle to loadpoint
# for examples see https://github.com/andig/evcc-config#vehicles
vehicles:
- name: default
  type: vw
  title: VW e-Up
  capacity: 32.3 # kWh
  user: mailadress@maildomain.de
  password: PASSWORD
  cache: 15m

# site describes the EVU connection, PV and home battery
site:
  title: Home
  meters:
    grid: e3dc-grid
    pv: e3dc-pv
    battery: e3dc-battery
  prioritySoC: 0 # give home battery priority up to this soc (0 to disable)

# loadpoint describes the charger, charge meter and connected vehicle
loadpoints:
- title: Ladepunkt # ui display name
  charger: wallbe # charger
  vehicle: default
  # vehicles: # use if multiple vehicles allowed to charge on this loadpoint
  # - ID.3
  # - e-Up
  mode: pv
  soc:
    # polling defines usage of the vehicle APIs
    # Modifying the default settings it NOT recommended. It MAY deplete your vehicle's battery
    # or lead to vehicle manufacturer banning you from API use. USE AT YOUR OWN RISK.
    poll:
      # poll mode defines under which condition the vehicle API is called:
      #   charging: update vehicle ONLY when charging (this is the recommended default)
      #   connected: update vehicle when connected (not only charging), interval defines how often
      #   always: always update vehicle regardless of connection state, interval defines how often
      mode: charging
      # poll interval defines how often the vehicle API may be polled if NOT charging
      interval: 60m
    min: 33 # immediately charge to 33% regardless of mode unless "off" (disabled)
    target: 100 # always charge to 100%
    estimate: false # set true to interpolate between api updates
    levels: # target soc levels for UI
    - 30
    - 50
    - 80
    - 100
  onDisconnect: # set defaults when vehicle disconnects
    mode: pv # switch back to pv mode
    targetSoC: 100 # charge to 100%
  phases: 1 # ev phases (default 3)
  enable: # pv mode enable behavior
    delay: 1m # threshold must be exceeded for this long
    threshold: 0 # minimum export power (W). If zero, export must exceed minimum chage power to enable
  disable: # pv mode disable behavior
    delay: 5m # threshold must be exceeded for this long
    threshold: 200 # maximum import power (W)
  guardduration: 5m # switch charger contactor not more often than this (default 10m)
  mincurrent: 6 # minimum charge current (default 6A)
  maxcurrent: 16 # maximum charge current (default 16A)

# mqtt message broker
mqtt:
  broker: 192.168.4.4:1883
  topic: evcc # root topic for publishing, set empty to disable
  user: evcc
  password: PASSWORD

# influx database (v1)
influx:
  url: http://externalserver.com:8086
  database: evcc
  user: evcc
  password: PASSWORD

# push messages
messaging:
  events:
    start: # charge start event
      title: Charge started
      msg: Started charging in "${mode}" mode
    stop: # charge stop event
      title: Charge finished
      msg: Finished charging ${chargedEnergy:%.1fk}kWh in ${chargeDuration}.
    connect: # vehicle connect event
      title: Car connected
      msg: "Car connected at ${pvPower:%.1fk}kW PV"
    disconnect: # vehicle connected event
      title: Car disconnected
      msg: Car disconnected after ${connectedDuration}
  services:
  - type: pushover
    app: TOKEN1
    recipients:
    - TOKEN2
  - type: telegram
    token: TOKEN3:TOKEN4
    chats:
    - CHAT

Show evcc log output with --log trace:
Attaching to openhabian_evcc_1
evcc_1           | [vw    ] TRACE 2021/01/02 23:18:53 GET https://identity.vwgroup.io/oidc/v1/authorize?client_id=9496332b-ea03-4091-a224-8c746b885068%40apps_vw-dilab_com&nonce=ny1wgXevSqlAU8623QiYqjR9MYhrQSKmSXOItHndACA&redirect_uri=carnet%3A%2F%2Fidentity-kit%2Flogin&response_type=id_token+token&scope=openid+profile+mbb+cars+birthdate+nickname+address+phone&state=zWiSdXz0pyCoJN0ap47gDFEjcAOWWM1egWM4vjVXQsn
evcc_1           | 302 Found
evcc_1           | [vw    ] TRACE 2021/01/02 23:18:53 GET https://identity.vwgroup.io/signin-service/v1/signin/9496332b-ea03-4091-a224-8c746b885068@apps_vw-dilab_com?relayState=b2e1d7f9b726855adf6c9e3717a5fd26508553f6
evcc_1           | 200 OK
evcc_1           | 
evcc_1           | 
evcc_1           | 
evcc_1           |     
evcc_1           |     
evcc_1           |     
evcc_1           |     
evcc_1           |     
evcc_1           |     
evcc_1           |     
evcc_1           | 
evcc_1           | 
evcc_1           | 
evcc_1           | 
evcc_1           | 
evcc_1           | 
evcc_1           | 
evcc_1           | 
evcc_1           |  Githubissues.
            
  • Githubissues is a development platform for aggregating issues.