evcc-io / evcc

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

When automatic phase change is activated the "Fast Charge" option stays in the current Phase 1 instead of switich to 3 and going to max charge #13806

Closed felsnerino closed 2 months ago

felsnerino commented 2 months ago

Describe the bug

When it was on PV Charge with automatic phase change and was charging in 1 phase the switch to fast charge is not working properly. When switching to fast charge it only make it fast within the currently running phases (1<->3). Even though it could switched to 3 phases and fast charge. There is now way currently to switch to 3 phases and fast charge. Configuration: image

Charging on fast: image

Steps to reproduce

1. 2. 3. ...

Configuration details

network:
  # schema is the HTTP schema
  # setting to `https` does not enable https, it only changes the way URLs are generated
  schema: http
  # host is the hostname or IP address
  # if the host name contains a `.local` suffix, the name will be announced on MDNS
  # docker: MDNS announcements don't work. host must be set to the docker host's name.
  host: homeassistantprox.knx
  # port is the listening port for UI and api
  # evcc will listen on all available interfaces
  port: 7070

interval: 30s # control cycle interval

#plant: FH2
# database configuration for persisting charge sessions and settings
# database:
#   type: sqlite
#   dsn: <path-to-db-file>

# sponsor token enables optional features (request at https://sponsor.evcc.io)
sponsortoken: xx

# telemetry enables aggregated statistics
#
# Telemetry allows collecting usage data (grid and green energy, charge power).
# Data is aggregated, no individual charging sessions are tracked. The collected,
# anonymous data can be retrieved using https://api.evcc.io.
#
# See https://github.com/evcc-io/evcc/pull/4343 or details.
#
# For time being, this is only available to sponsors, hence data is associated with
# the sponsor token's identity.
#
# telemetry: true

# log settings
log: warn
levels:
  site: warn
  lp-1: warn
  lp-2: warn
  cache: warn
  db: warn

# modbus proxy for allowing external programs to reuse the evcc modbus connection
# each entry will start a proxy instance at the given port speaking Modbus TCP and
# relaying to the given modbus downstream device (either TCP or RTU, RS485 or TCP)
#modbusproxy:
  #  - port: 5200
  #    uri: solar-edge:502
  #    # rtu: true
  #    # readonly: true

# meter definitions
# name can be freely chosen and is used as reference when assigning meters to site and loadpoints
# for documentation see https://docs.evcc.io/docs/devices/meters
meters:
  - name: FroniusGEN24PlusGRID
    type: template
    template: fronius-solarapi-v1
    usage: grid
    host: fronius.knx # IP-Adresse oder Hostname     pv:
  - name: FroniusGEN24PlusPV
    type: template
    template: fronius-solarapi-v1
    usage: pv
    host: fronius.knx # IP-Adresse oder Hostname     pv:
  - name: FroniusGEN24PlusBATTERY
    type: template
    template: fronius-solarapi-v1
    usage: battery
    host: fronius.knx # IP-Adresse oder Hostname     pv:  - name: aux

# charger definitions
# name can be freely chosen and is used as reference when assigning charger to vehicle
# for documentation see https://docs.evcc.io/docs/devices/chargers
chargers:
  - type: template
    template: alfen
    name: AlfenLinks
    modbus: tcpip
    id: 1
    host: xx # Hostname
    port: 502 # Port 

  - type: template
    template: alfen
    name: AlfenRechts
    modbus: tcpip
    id: 1
    host: xx # Hostname
    port: 502 # Port 

    # vehicle definitions
# name can be freely chosen and is used as reference when assigning vehicle to loadpoint
# for documentation see https://docs.evcc.io/docs/devices/vehicles
vehicles:
  - name: Zoe
    type: renault
    title: Zoe
    icon: car
    capacity: 50 # kWh
    user: xx # user
    password: xx # password
    vin: xxx
    onIdentify: # set defaults when vehicle is identified
      mode: minpv # enable PV-charging when vehicle is identified
#      minSoc: 20 # immediately charge to 20% regardless of mode unless "off" (disabled)
#      targetSoc: 90 # limit charge to 90%

# site describes the EVU connection, PV and home battery
site:
  title: FH2 # display name for UI
  meters:
    grid: FroniusGEN24PlusGRID
    pv: FroniusGEN24PlusPV
    battery: FroniusGEN24PlusBATTERY
#    aux:
#      - aux # list of auxiliary meters for adjusting grid operating point
  residualPower: 200 # additional household usage margin
#  prioritySoc: 30 # give home battery priority up to this soc (empty to disable)
#  bufferSoc: 0 # continue charging on battery above soc (0 to disable)
#  bufferStartSoc: 0 # start charging on battery above soc (0 to disable)
  maxGridSupplyWhileBatteryCharging: 0 # ignore battery charging if AC consumption is above this value
#  smartCostLimit: 0 # set cost limit for automatic charging in PV mode

# loadpoint describes the charger, charge meter and connected vehicle
loadpoints:
  - title: GarageLinks # display name for UI
    charger: AlfenLinks # charger
#    meter: charge # charge meter
    mode: minpv # set default charge mode, use "off" to disable by default if charger is publicly available
    # vehicle: car1 # set default vehicle (disables vehicle detection)

    # remaining settings are experts-only and best left at default values
    priority: 0 # relative priority for concurrent charging in PV mode with multiple loadpoints (higher values have higher priority)
    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 (only supported for single vehicle)
        mode: connected
        # poll interval defines how often the vehicle API may be polled if NOT charging
        interval: 30m
    enable: # pv mode enable behavior
      delay: 1m # threshold must be exceeded for this long
      threshold: 0 # grid power threshold (in Watts, negative=export). If zero, export must exceed minimum charge power to enable
    disable: # pv mode disable behavior
      delay: 3m # threshold must be exceeded for this long
      threshold: 0 # maximum import power (W)
    guardDuration: 5m # switch charger contactor not more often than this (default 5m)

  - title: GarageRechts # display name for UI
    charger: AlfenRechts # charger
#    meter: charge # charge meter
    mode: now # set default charge mode, use "off" to disable by default if charger is publicly available
    # vehicle: car1 # set default vehicle (disables vehicle detection)

    # remaining settings are experts-only and best left at default values
    priority: 0 # relative priority for concurrent charging in PV mode with multiple loadpoints (higher values have higher priority)
    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 (only supported for single vehicle)
        mode: connected
        # poll interval defines how often the vehicle API may be polled if NOT charging
        interval: 30m
    enable: # pv mode enable behavior
      delay: 1m # threshold must be exceeded for this long
      threshold: 0 # grid power threshold (in Watts, negative=export). If zero, export must exceed minimum charge power to enable
    disable: # pv mode disable behavior
      delay: 3m # threshold must be exceeded for this long
      threshold: 0 # maximum import power (W)
    guardDuration: 5m # switch charger contactor not more often than this (default 5m)

# tariffs are the fixed or variable tariffs
tariffs:
  currency: EUR # three letter ISO-4217 currency code (default EUR)
  grid:
    # either static grid price (or price zones)
    type: fixed
    price: 0.294 # EUR/kWh
    zones:
      - days: Mo-Fr
        hours: 2-5
        price: 0.294 # EUR/kWh
      - days: Sa,So
        price: 0.294 # EUR/kWh

  feedin:
    # rate for feeding excess (pv) energy to the grid
    type: fixed
    price: 0.08 # EUR/kWh

  co2:
    # co2 tariff provides co2 intensity forecast and is for co2-optimized target charging if no variable grid tariff is specified
    # type: grünstromindex # GrünStromIndex (Germany only)
    # zip: <zip>

    # type: electricitymaps # https://app.electricitymaps.com/map
    # uri: <uri>
    # token: <token>
    # zone: DE

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

# influx database
influx:
  # url: http://localhost:8086
  # database: evcc
  # user:
  # password:

# eebus credentials
eebus:
  # uri: # :4712
  # interfaces: # limit eebus to specific network interfaces
  # - en0
  # certificate: # local signed certificate, required, can be generated via `evcc eebus-cert`
  #   public: # public key
  #   private: # private key

# 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}
    soc: # vehicle soc update event
      title: Soc updated
      msg: Battery charged to ${vehicleSoc:%.0f}%
    guest: # vehicle could not be identified
      title: Unknown vehicle
      msg: Unknown vehicle, guest connected?
  services:
  # - type: pushover
  #   app: # app id
  #   recipients:
  #   - # list of recipient ids
  # - type: telegram
  #   token: # bot id
  #   chats:
  #   - # list of chat ids
  # - type: email
  #   uri: smtp://<user>:<password>@<host>:<port>/?fromAddress=<from>&toAddresses=<to>
  # - type: ntfy
  #   uri: https://<host>/<topics>
  #   priority: <priority>
  #   tags: <tags>

Log details

[lp-1  ] WARN 2024/05/08 07:06:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:08:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:10:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:12:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:14:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:16:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:18:56 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:20:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:22:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:24:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:26:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:28:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:30:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:32:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:34:56 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:36:56 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:38:56 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:40:56 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:42:56 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:44:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:45:56 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:47:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:48:56 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:49:57 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:51:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:53:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:55:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:57:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 07:59:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:01:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:03:56 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:05:57 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:07:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:09:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:11:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:13:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:15:56 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:17:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:18:56 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:20:56 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:21:56 vehicle soc: unexpected status: 429 (Too Many Requests) (ignored by estimator)
[lp-1  ] ERROR 2024/05/08 08:21:56 vehicle range: unexpected status: 429 (Too Many Requests)
[lp-1  ] WARN 2024/05/08 08:21:57 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:22:57 vehicle soc: unexpected status: 429 (Too Many Requests) (ignored by estimator)
[lp-1  ] ERROR 2024/05/08 08:22:57 vehicle range: unexpected status: 429 (Too Many Requests)
[lp-1  ] WARN 2024/05/08 08:22:57 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:23:56 vehicle soc: unexpected status: 429 (Too Many Requests) (ignored by estimator)
[lp-1  ] ERROR 2024/05/08 08:23:56 vehicle range: unexpected status: 429 (Too Many Requests)
[lp-1  ] WARN 2024/05/08 08:24:56 vehicle soc: unexpected status: 429 (Too Many Requests) (ignored by estimator)
[lp-1  ] ERROR 2024/05/08 08:24:56 vehicle range: unexpected status: 429 (Too Many Requests)
[lp-1  ] WARN 2024/05/08 08:24:57 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:25:56 vehicle soc: unexpected status: 429 (Too Many Requests) (ignored by estimator)
[lp-1  ] ERROR 2024/05/08 08:25:56 vehicle range: unexpected status: 429 (Too Many Requests)
[lp-1  ] WARN 2024/05/08 08:26:56 vehicle soc: unexpected status: 429 (Too Many Requests) (ignored by estimator)
[lp-1  ] ERROR 2024/05/08 08:26:56 vehicle range: unexpected status: 429 (Too Many Requests)
[lp-1  ] WARN 2024/05/08 08:26:56 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:27:55 vehicle soc: unexpected status: 429 (Too Many Requests) (ignored by estimator)
[lp-1  ] ERROR 2024/05/08 08:27:55 vehicle range: unexpected status: 429 (Too Many Requests)
[lp-1  ] WARN 2024/05/08 08:28:55 vehicle soc: unexpected status: 429 (Too Many Requests) (ignored by estimator)
[lp-1  ] ERROR 2024/05/08 08:28:55 vehicle range: unexpected status: 429 (Too Many Requests)
[lp-1  ] WARN 2024/05/08 08:28:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:29:56 vehicle soc: unexpected status: 429 (Too Many Requests) (ignored by estimator)
[lp-1  ] ERROR 2024/05/08 08:29:56 vehicle range: unexpected status: 429 (Too Many Requests)
[lp-1  ] WARN 2024/05/08 08:29:56 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:30:56 vehicle soc: unexpected status: 429 (Too Many Requests) (ignored by estimator)
[lp-1  ] ERROR 2024/05/08 08:30:56 vehicle range: unexpected status: 429 (Too Many Requests)
[lp-1  ] WARN 2024/05/08 08:31:55 vehicle soc: unexpected status: 429 (Too Many Requests) (ignored by estimator)
[lp-1  ] ERROR 2024/05/08 08:31:55 vehicle range: unexpected status: 429 (Too Many Requests)
[lp-1  ] WARN 2024/05/08 08:31:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:32:55 vehicle soc: unexpected status: 429 (Too Many Requests) (ignored by estimator)
[lp-1  ] ERROR 2024/05/08 08:32:55 vehicle range: unexpected status: 429 (Too Many Requests)
[lp-1  ] WARN 2024/05/08 08:33:55 vehicle soc: unexpected status: 429 (Too Many Requests) (ignored by estimator)
[lp-1  ] ERROR 2024/05/08 08:33:55 vehicle range: unexpected status: 429 (Too Many Requests)
[lp-1  ] WARN 2024/05/08 08:33:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:34:55 vehicle soc: unexpected status: 429 (Too Many Requests) (ignored by estimator)
[lp-1  ] ERROR 2024/05/08 08:34:55 vehicle range: unexpected status: 429 (Too Many Requests)
[lp-1  ] WARN 2024/05/08 08:35:55 vehicle soc: unexpected status: 429 (Too Many Requests) (ignored by estimator)
[lp-1  ] ERROR 2024/05/08 08:35:55 vehicle range: unexpected status: 429 (Too Many Requests)
[lp-1  ] WARN 2024/05/08 08:35:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:36:56 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:38:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:40:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:42:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:44:55 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:46:56 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:48:56 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:50:56 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] WARN 2024/05/08 08:52:56 charger logic error: phases mismatch (got 1, expected 3)

What type of operating system are you running?

HomeAssistant Add-on

Version

0.126.2

felsnerino commented 2 months ago

One addition - maybe 2 buttons would be the best - Fast charge 1 phase - Fast charge 3 phases?

mdkeil commented 2 months ago

pls provide a log, because there some timers in the background, which could prevent phase shifting

https://docs.evcc.io/docs/faq#wie-kann-ich-ein-logfile-zur-fehleranalyse-erstellen

guardDuration: 5m is deprecated

felsnerino commented 2 months ago

Added the log from the add-on menu in Home Assistant.

mdkeil commented 2 months ago

Does your config works with past evcc-versions?

felsnerino commented 2 months ago

Usually I only use it in PV mode or PV min mode. Only recently I started using 1 phase automatic change and yesterday due to bad weather/little PV excess wanted to charge in Fast Charge mode... so unfortunately I cannot tell. This config I am using for about 1 year through all kinds versions...

andig commented 2 months ago

Wallbox shows F which is an error state. Fix these errors first, then retry.

felsnerino commented 2 months ago

Sorry, that is misleading - my wife left today at ~9:00 but did not remove the cable on the wallbox - only on the car - which provokes this error. but as you can see in the log - the error was not happening before.

andig commented 2 months ago

The log doesn't show anything. We'll need the entire log, not just the resulting error message.

felsnerino commented 2 months ago

how can I generate the logs in Home Assistant AddOn - here I only see one page - also within the System ->Logs.... If I read another issue correctly there is currently no way to get more logs?!

felsnerino commented 2 months ago

@andig could you please reopen it? The error you mentioned is not related. If you need more info - please let me know how - I will provide them.

andig commented 2 months ago

The log doesn't show anything. We'll need the entire log, not just the resulting error message.

felsnerino commented 1 month ago

evcc-20240612-161644-debug.log

@andig now with the attached debug protocol. Now the evcc was not able itself to switch - so it was loading with 1p and then wanted to switch to 3p - but got the error. can you please reopen?

andig commented 1 month ago

Now the evcc was not able itself to switch

Which timestamp are you looking at?

felsnerino commented 1 month ago

yes of course: First time: [lp-1 ] WARN 2024/06/12 16:09:29 charger logic error: phases mismatch (got 1, expected 3) Second time: [lp-1 ] WARN 2024/06/12 16:09:29 charger logic error: phases mismatch (got 1, expected 3) And yes it was (and stayed) in automatic (PV) Mode. I just saw it by coincidence and took the opportunity... The sun was coming and going so that it started with 1phase and then as it got brighter it wanted to change to 3phase as there was enough excess energy...

andig commented 1 month ago

Kurz vorher hat eine Phasenumschaltung stattgefunden:

[lp-1  ] DEBUG 2024/06/12 16:07:29 phase scale3p in 0s
[lp-1  ] DEBUG 2024/06/12 16:07:29 switched phases: 3p
[lp-1  ] DEBUG 2024/06/12 16:07:29 phase timer inactive
[lp-1  ] DEBUG 2024/06/12 16:07:29 pv charge current: 12.9A = 10.6A + 2.27A (-1564W @ 3p)
[lp-1  ] DEBUG 2024/06/12 16:07:29 max charge current: 12.9A

[lp-1  ] WARN 2024/06/12 16:09:29 charger logic error: phases mismatch (got 1, expected 3)
[lp-1  ] DEBUG 2024/06/12 16:09:29 pv charge current: 32.4A = 21.9A + 10.5A (-2426W @ 1p)

Diese scheint nicht zu funktionieren da der Charger auf 1p bleibt. Warum auch immer. Bitte Alfen anfragen warum das scheitern kann/sollte.

rudybroersma commented 1 month ago

I have the same issue. 1p/3p switching works fine while using Solar charging, but doesn't switch to 3p when selecting 'Fast'

evcc.log

Relevant entries: [lp-1 ] WARN 2024/06/13 20:11:30 charger logic error: phases mismatch (got 1, expected 3) <------------ Phase mismatch [lp-1 ] DEBUG 2024/06/13 20:11:30 switched phases: 3p <------- IT DIDNT! REMAINS AT 1p [site ] DEBUG 2024/06/13 20:11:59 ---- [lp-1 ] DEBUG 2024/06/13 20:11:59 charge power: 5097W [lp-1 ] DEBUG 2024/06/13 20:11:59 charge currents: [23.6 0 0]A <-- Still 1 phase.

Using EM24 grid meter, Alfen Pro Single S charger and Victron Energy home battery

andig commented 1 month ago

@rudybroersma

Diese scheint nicht zu funktionieren da der Charger auf 1p bleibt. Warum auch immer. Bitte Alfen anfragen warum das scheitern kann/sollte.

You'll need to investigate with Alfen why the phase switching is no longer working. Seems it did in an older version?

rudybroersma commented 1 month ago

@rudybroersma

You'll need to investigate with Alfen why the phase switching is no longer working. Seems it did in an older version?

I'm new to EVCC since about a week or two. I do not have any experiences with older versions. I'm running 0.126.5 Phase switching is working. It works fine when using 'Solar'.

My guess is that when I select 'Fast' and the previous phase setting of the charger was '1p' things go wrong. When EVCC starts to run in 'Fast mode' it assumes the charger is in 3p state. It throws an error that there's a phase mismatch.

EVCC never recovers from this. Even when I select 'Solar' again, it will never start 3p charging. I need to powercycle the Alfen charger to get things working again. After that switching to 1p and 3p using 'Solar mode' works like a breeze. It's only the 'Fast mode' that breaks things.

Today I noticed that EVCC suddenly thought 2 phases were active for a short while, while my car was charging on 1p. I haven't deep-dived into EVCC yet as I find all the .go files a little overwhelming for now, but this made me believe that EVCC does the phase check based on consumption per phase? eg. if a phase is using >10W or some arbitrary value it defines that phase as active? If for some reason there is some current flowing on an unused phase (eg. incorrect measurements) EVCC gets confused about the phase switching in the charger?

Whatever it is.. it isn't the Alfen that's at fault here. Phase switching works fine in Solar mode but goes haywire in Fast mode. The only difference between those modes is the EVCC internals.

andig commented 4 weeks ago

When EVCC starts to run in 'Fast mode' it assumes the charger is in 3p state. It throws an error that there's a phase mismatch.

Switching to FAST switches to 3p. Seems that doesn‘t (always) work. Why is unclear. You can verify in the log that switch is triggered. Only Alfen would be able to tell us why box doesn‘t follow.

andig commented 4 weeks ago

Whatever it is.. it isn't the Alfen that's at fault here. Phase switching works fine in Solar mode but goes haywire in Fast mode. The only difference between those modes is the EVCC internals.

@rudybroersma any proof for this claim? We switch to 3p on fast mode and have been doing so for ages.

My best guess: Alfen is unreliable. In PV mode it will sooner of later like to go to 1p again and then restart. In Fast mode it stays on 3p.

I can only repeat: you‘ll need to open a ticket with Alfen why switching apparently sometimes doesn‘t work. Trcae log will show you that evcc invokes the right register.

rudybroersma commented 2 weeks ago

Not really sure if it's proof, but here is what I noticed.. I made photos and screenshots. This doesn't always happen, but sometimes EVCC WebUI shows 2 or 3 phases when only 1 is actually in use.

EVCC shows 2 phases: evcc1

And here is a bigger image with a couple of cropped photos. First you see the 3 phases of my Modbus meter that's connected to the EV charger Then a pic of the Tesla App showing it's charging at 1 phase, 23A. And a pic of the Victron App showing there's little to no load on phases 2 and 3.

evcc7

Yet.. EVCC shows the car is charging at 2 phases. On the photo above you also see a yellow exclamation mark showing an error: "Alfen: ignoring inconsistent phases: 1p < 2p observed active"

premultiply commented 2 weeks ago

evcc detects phase usage on phase currents and phase voltages.

andig commented 2 weeks ago

Instead of screenshots, look at /api/state, it will show the currents. Probably p2 shows a current above our detection threshold and hence we treat it as active. If that's the case that is actually a very good explanation for why evcc might not switch to 3p in cases it thinks that it already is on 2p (or 3p). The question then really is- where does that p2 consumption come from when the charger really is at 1p???

rudybroersma commented 2 weeks ago

Alright, will post when I have another occurrence

felsnerino commented 2 weeks ago

But why use such a (complicated/unreliable) logic to derive how many phase are active with alfen? There is a modbus register for that... 41216 Charge_phases

andig commented 2 weeks ago

evcc detects phase usage on phase currents and phase voltages.

But why use such a (complicated/unreliable) logic to derive how many phase are active with alfen? There is a modbus register for that... 41216 Charge_phases

Which is what we're doing (Reg 1215). Seems that value is sometimes wrong, i.e. Alfen lies. To verify we'll need a modbus trace log.

felsnerino commented 1 week ago

I don't really understand. I have modbus log all values also the phase change, and the interesting part is, that the change from 3 -> 1 works. But the change back doesn't (I thought, I remember that in the past that worked already). But then it says switching back - it even thinks it is 3 phases, but on Modbus I still see "1"... so not sure where it gets the values from, when it says "active phases: 3"... Please Ignore this one spike - I tried to change once the phases through modbus directly to 3 which worked, I then set it back to 1. the one strange thing is, that the initial switch from 3 to 1 actually worked... image DEBUG Log File: evcc-20240705-102154-debug.log

andig commented 1 week ago

I have modbus log all values also the phase change, and the interesting part is, that the change from 3 -> 1 works. But the change back doesn't (I thought, I remember that in the past that worked already). But then it says switching back - it even thinks it is 3 phases, but on Modbus I still see "1"... so not sure where it gets the values from, when it says "active phases: 3"...

Could you extract the relevant part of the log? Include trace for Alfen so we can see the modbus. Unrelated screenshots that might show anything or nothing aren't diagnosable.