evcc-io / evcc

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

Tronity / vehicle recognition after plugin #15503

Closed sebnaf closed 2 months ago

sebnaf commented 2 months ago

Describe the bug

After plugging my Tesla back in, evcc does not recognize the tesla and uses the "gastfahrzeug". Selecting my vehicle manually or restarting evcc pulls the right vehicle.

Steps to reproduce

  1. unplug tesla and drive
  2. park and plug tesla in
  3. "gastfahrzeug" stays active until selected different or evcc restart ...

Configuration details

network:
  schema: http
  host: evcc.local
  port: 7070

interval: 20s # control cycle interval. Interval <30s can lead to unexpected behavior, see https://docs.evcc.io/docs/reference/configuration/interval

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

plant: 2d22<snip>

# sponsor token enables optional features (request at https://sponsor.evcc.io)
# sponsortoken:
sponsortoken: eyJh<snip>

telemetry: true

# log settings
log: error
levels:
  site: info
  lp-1: info
  lp-2: info
  cache: error
  db: warn
  vehicle: info
  tesla: info
  elektronenpumpe: info

# 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 # use `deny` to raise modbus errors

# 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: grid
    type: movingaverage
    decay: 0.2
    meter:
      type: custom
      power:
        source: sunspec
        #model: sunspec
        uri: 10.10.20.7:502
        id: 1
        subdevice: 1
        value: 203:W
        scale: -1.09
        # decay: 0.7
        #timeout: 2000
  - name: pv
    type: custom
    power:
      source: sunspec
      #model: sunspec
      uri: 10.10.20.7:502
      id: 1
      value: 101:W
      #timeout: 2000

# 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:
  - name: elektronenpumpe
    type: go-e
    uri: http://10.10.20.22

# 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:
  - type: template
    template: tronity 
    title: EM-IL 55E
    clientid: 96a<snip>
    clientsecret: 8b7<snip>
    vin: LRW3<snip>
    capacity: 72  
    name: tesla
    icon: tractor
    mode: pv
    # minSoc: 20
    # removed with 0.123.7 targetSoc: 60
    minCurrent: 6
    maxCurrent: 16

# site describes the EVU connection, PV and home battery
site:
  title: ohw3 # display name for UI
  meters:
    grid: grid # grid meter
    pv:
      - pv # list of pv inverters/ meters
  residualPower: 0 # additional household usage margin
  maxGridSupplyWhileBatteryCharging: 0 # ignore battery charging if AC consumption is above this value

# loadpoint describes the charger, charge meter and connected vehicle
loadpoints:
  - title: Elektronenpumpe # display name for UI
    charger: elektronenpumpe # charger
    #meter: charge # charge meter
    mode: "pv" # default charge mode to apply when vehicle is disconnected; use "off" to disable by default if charger is publicly available
    #phases: 3 # electrical connection (normal charger: default 3 for 3 phase, 1p3p charger: 0 for "auto" or 1/3 for fixed phases)
    #minCurrent: 6 # minimum charge current (default 6A)
    #maxCurrent: 16 # maximum charge current (default 16A)

    # 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: 20m
      estimate: true # set false to disable interpolating between api updates (not recommended)
    enable: # pv mode enable behavior
      delay: 10m # 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: 5m # threshold must be exceeded for this long
      threshold: 0 # maximum import power (W)
    guardDuration: 5 # switch charger contactor not more often than this (default 5m)

# tariffs are the fixed or variable tariffs
tariffs:
  currency: EUR # (default EUR)
  grid:
    # either
    type: tibber
    #cheap: 0.25 # [currency]/kWh
    token: "6-Kw8<snip>" # access token
    # homeid: "cc8<snip>" # optional if multiple homes associated to account
  feedin:
    type: fixed
    price: 0.065 # [currency]/kWh

    # type: awattar
    # region: de # optional, choose at for Austria
    # charges: # optional, additional charges per kWh
    # tax: # optional, additional tax (0.1 for 10%)

    # type: octopusenergy
    # tariff: AGILE-FLEX-22-11-25 # Tariff code
    # region: A # optional

    # type: elering # Nordpool
    # region: ee # or lt, lv, fi
    # charges: # optional, additional charges per kWh
    # tax: # optional, additional tax (0.1 for 10%)

    # type: energinet # Energinet using the price in DKK
    # region: dk1 # or dk2
    # charges: # optional, additional charges per kWh
    # tax: # optional, additional tax (0.1 for 10%)

    # type: entsoe # Entso-E european market data
    # domain: BZN|DE-LU # https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html#_areas
    # securitytoken: # api token
    # charges: # optional, additional charges per kWh
    # tax: # optional, additional tax (0.1 for 10%)

    # type: custom # price from a plugin source; see https://docs.evcc.io/docs/reference/plugins
    # price:
    #   source: http
    #   uri: https://example.org/price.json
    #   jq: .price.current

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

    # type: octopusenergy
    # tariff: AGILE-FLEX-22-11-25 # Tariff code
    # region: A # optional
  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

    # type: ngeso # National Grid Electricity System Operator data (United Kingdom only) https://carbonintensity.org.uk/
    # provides national data if both region and postcode are omitted - do not supply both at the same time!
    # region: 1 # optional, coarser than using a postcode - see https://api.carbonintensity.org.uk/ for full list
    # postcode: SW1A1AA # optional

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

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

# 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 of {{.vehicleTitle}} started
      msg: |
        Wallbox {{.title}} started charging {{.vehicleTitle}} in {{ toString .mode | upper }} mode.
        --------------------------
        evcc Status {{printf `(%d-%02d-%02d %02d:%02d:%02d)` now.Year now.Month now.Day now.Hour now.Minute now.Second}}
        Netz-Leistung: {{round (divf .gridPower 1000) 3 }} kW
        Solar-Leistung: {{round (divf .pvPower 1000) 3 }} kW
        Eigenverbrauch: {{round (divf .homePower 1000) 3 }} kW
        {{if .batteryConfigured}}Batteriespeicher-Status: {{round (divf .batteryPower 1000) 3 }} kW ({{.batterySoc }} %){{end}}
    stop: # charge stop event
      title: Charge of {{.vehicleTitle}} finished
      msg: |
        Wallbox {{.title}} finished charging {{.vehicleTitle}} 
        with {{round (divf .chargedEnergy 1000) 2 }} kWh in {{.chargeDuration}}.
        --------------------------
        evcc Status {{printf `(%d-%02d-%02d %02d:%02d:%02d)` now.Year now.Month now.Day now.Hour now.Minute now.Second}}
        Netz-Leistung: {{round (divf .gridPower 1000) 3 }} kW
        Solar-Leistung: {{round (divf .pvPower 1000) 3 }} kW
        Eigenverbrauch: {{round (divf .homePower 1000) 3 }} kW
        {{if .batteryConfigured}}Batteriespeicher-Status: {{round (divf .batteryPower 1000) 3 }} kW ({{.batterySoc }} %){{end}}
    connect: # vehicle connect event
      title: "{{.vehicleTitle}} connected on wallbox {{.title}}"
      msg: |
        {{.vehicleTitle}} connected on wallbox {{.title}} at {{round (divf .pvPower 1000) 2 }} kW PV.
        --------------------------
        evcc Status {{printf `(%d-%02d-%02d %02d:%02d:%02d)` now.Year now.Month now.Day now.Hour now.Minute now.Second}}
        Netz-Leistung: {{round (divf .gridPower 1000) 3 }} kW
        Solar-Leistung: {{round (divf .pvPower 1000) 3 }} kW
        Eigenverbrauch: {{round (divf .homePower 1000) 3 }} kW
        {{if .batteryConfigured}}Batteriespeicher-Status: {{round (divf .batteryPower 1000) 3 }} kW ({{.batterySoc }} %){{end}}
    disconnect: # vehicle connected event
      title: "{{.vehicleTitle}} disconnected of wallbox {{.title}}"
      msg: |
        {{.vehicleTitle}} disconnected of wallbox {{.title}} after {{.connectedDuration}}.
        --------------------------
        evcc Status {{printf `(%d-%02d-%02d %02d:%02d:%02d)` now.Year now.Month now.Day now.Hour now.Minute now.Second}}
        Netz-Leistung: {{round (divf .gridPower 1000) 3 }} kW
        Solar-Leistung: {{round (divf .pvPower 1000) 3 }} kW
        Eigenverbrauch: {{round (divf .homePower 1000) 3 }} kW
        {{if .batteryConfigured}}Batteriespeicher-Status: {{round (divf .batteryPower 1000) 3 }} kW ({{.batterySoc }} %){{end}}
    guest: # vehicle could not be identified
      title: Unknown vehicle
      msg: Unknown vehicle, guest connected?
  services:
    - type: pushover
      app: aq5<snip>
      recipients:
        - uan5<snip>
  # - 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

[tronity] TRACE 2024/08/19 17:37:46 GET https://api.tronity.tech/tronity/vehicles/668aedd2d9d3250012584ce4/last_record
[tronity] TRACE 2024/08/19 17:37:46 {"odometer":33493.7,"range":202.1,"level":45.496,"charging":"Charging","plugged":true,"chargerPower":0,"chargeRemainingTime":null,"latitude":48.124071,"longitude":7.844353,"status":null,"timestamp":1724081698000,"lastUpdate":1724081698000}
[tronity] TRACE 2024/08/19 18:01:46 POST https://api.tronity.tech/authentication
[tronity] TRACE 2024/08/19 18:01:47 GET https://api.tronity.tech/tronity/vehicles/668aedd2d9d3250012584ce4/last_record
[tronity] TRACE 2024/08/19 18:01:47 {"odometer":33500.2,"range":193,"level":43.45,"charging":"Disconnected","plugged":false,"chargerPower":0,"chargeRemainingTime":null,"latitude":48.124068,"longitude":7.844355,"status":null,"timestamp":1724083291000,"lastUpdate":1724083291000}
[tronity] TRACE 2024/08/19 18:03:06 GET https://api.tronity.tech/tronity/vehicles/668aedd2d9d3250012584ce4/last_record
[tronity] TRACE 2024/08/19 18:03:06 {"odometer":33500.2,"range":193,"level":43.45,"charging":"Disconnected","plugged":false,"chargerPower":0,"chargeRemainingTime":null,"latitude":48.124068,"longitude":7.844362,"status":null,"timestamp":1724083341000,"lastUpdate":1724083341000}
[tronity] TRACE 2024/08/19 18:04:08 GET https://api.tronity.tech/tronity/vehicles/668aedd2d9d3250012584ce4/last_record
[tronity] TRACE 2024/08/19 18:04:08 {"odometer":33500.2,"range":193,"level":43.45,"charging":"Disconnected","plugged":false,"chargerPower":0,"chargeRemainingTime":null,"latitude":48.124068,"longitude":7.844362,"status":null,"timestamp":1724083341000,"lastUpdate":1724083341000}
[tronity] TRACE 2024/08/19 18:05:06 GET https://api.tronity.tech/tronity/vehicles/668aedd2d9d3250012584ce4/last_record
[tronity] TRACE 2024/08/19 18:05:06 {"odometer":33500.2,"range":193,"level":43.45,"charging":"Disconnected","plugged":false,"chargerPower":0,"chargeRemainingTime":null,"latitude":48.124068,"longitude":7.844362,"status":null,"timestamp":1724083341000,"lastUpdate":1724083341000}
[tronity] TRACE 2024/08/19 18:06:06 GET https://api.tronity.tech/tronity/vehicles/668aedd2d9d3250012584ce4/last_record
[tronity] TRACE 2024/08/19 18:06:06 {"odometer":33500.2,"range":193,"level":43.45,"charging":"Disconnected","plugged":false,"chargerPower":0,"chargeRemainingTime":null,"latitude":48.124068,"longitude":7.844362,"status":null,"timestamp":1724083341000,"lastUpdate":1724083341000}
[tronity] TRACE 2024/08/19 18:07:06 GET https://api.tronity.tech/tronity/vehicles/668aedd2d9d3250012584ce4/last_record
[tronity] TRACE 2024/08/19 18:07:06 {"odometer":33500.2,"range":193,"level":43.45,"charging":"Disconnected","plugged":false,"chargerPower":0,"chargeRemainingTime":null,"latitude":48.124068,"longitude":7.844362,"status":null,"timestamp":1724083341000,"lastUpdate":1724083341000}
[tronity] TRACE 2024/08/19 18:08:06 GET https://api.tronity.tech/tronity/vehicles/668aedd2d9d3250012584ce4/last_record
[tronity] TRACE 2024/08/19 18:08:06 {"odometer":33500.2,"range":193,"level":43.45,"charging":"Disconnected","plugged":false,"chargerPower":0,"chargeRemainingTime":null,"latitude":48.124068,"longitude":7.844362,"status":null,"timestamp":1724083341000,"lastUpdate":1724083341000}
[tronity] TRACE 2024/08/19 18:09:06 GET https://api.tronity.tech/tronity/vehicles/668aedd2d9d3250012584ce4/last_record
[tronity] TRACE 2024/08/19 18:09:06 {"odometer":33500.2,"range":193,"level":43.45,"charging":"Disconnected","plugged":false,"chargerPower":0,"chargeRemainingTime":null,"latitude":48.124068,"longitude":7.844362,"status":null,"timestamp":1724083341000,"lastUpdate":1724083341000}
[tronity] TRACE 2024/08/19 18:09:46 GET https://api.tronity.tech/tronity/vehicles/668aedd2d9d3250012584ce4/last_record
[tronity] TRACE 2024/08/19 18:09:46 {"odometer":33500.2,"range":193,"level":43.45,"charging":"Disconnected","plugged":false,"chargerPower":0,"chargeRemainingTime":null,"latitude":48.124068,"longitude":7.844362,"status":null,"timestamp":1724083341000,"lastUpdate":1724083341000}
[tronity] TRACE 2024/08/19 18:11:06 GET https://api.tronity.tech/tronity/vehicles/668aedd2d9d3250012584ce4/last_record
[tronity] TRACE 2024/08/19 18:11:06 {"odometer":33500.2,"range":193,"level":43.45,"charging":"Disconnected","plugged":false,"chargerPower":0,"chargeRemainingTime":null,"latitude":48.124068,"longitude":7.844362,"status":null,"timestamp":1724083341000,"lastUpdate":1724083341000}
[tronity] TRACE 2024/08/19 18:50:06 GET https://api.tronity.tech/tronity/vehicles/668aedd2d9d3250012584ce4/last_record
[tronity] TRACE 2024/08/19 18:50:06 {"odometer":33500.2,"range":192.2,"level":43.279,"charging":"Disconnected","plugged":false,"chargerPower":0,"chargeRemainingTime":null,"latitude":48.124068,"longitude":7.844362,"status":null,"timestamp":1724085884000,"lastUpdate":1724085884000}

What type of operating system are you running?

Docker container

Version

0.130.0

sebnaf commented 2 months ago

evcc-20240819-185919-trace.log sent via email to info@evcc.io

andig commented 2 months ago

evcc does not recognize the tesla and uses the "gastfahrzeug".

Machen denn die Tronity Updates Sinn?

Selecting my vehicle manually or restarting evcc pulls the right vehicle.

Das suggeriert, als würde da anderenfalls etwas nicht "gepulled"- was ist damit gemeint?

sebnaf commented 2 months ago

evcc does not recognize the tesla and uses the "gastfahrzeug".

Machen denn die Tronity Updates Sinn?

Ja, in Tronity wird der Status selber korrekt angezeigt.

Selecting my vehicle manually or restarting evcc pulls the right vehicle.

Das suggeriert, als würde da anderenfalls etwas nicht "gepulled"- was ist damit gemeint?

Wenn ich den Tesla ans Ladekabel anschließe, wird er in Tronity selber als "eingesteckt" angezeigt, sowie auch in der Tesla-App. evcc erkennt diesen Zustand nicht und bleibt auf "Gastfahrzeug" stehen. Wechsle ich manuell auf meinen Tesla, wird alles sofort richtig erkannt. Starte ich in obigem Zustand evcc neu, wird nach dem Neustart sofort alles richtig erkannt.

andig commented 2 months ago

Und was zeigt das Log als Tronity Status?

sebnaf commented 2 months ago

Hast Du einen Pointer, wonach ich im Log suchen kann? Ist es: [main ] DEBUG 2024/08/19 18:03:06 vehicle status: A (EM-IL 55E) ?

sebnaf commented 2 months ago

Der Charger erkennt das Anschließen:

[lp-1 ] DEBUG 2024/08/19 18:00:26 charger status: A [lp-1 ] DEBUG 2024/08/19 18:00:46 charger status: A [lp-1 ] DEBUG 2024/08/19 18:01:06 charger status: A [lp-1 ] DEBUG 2024/08/19 18:01:26 charger status: A [lp-1 ] DEBUG 2024/08/19 18:01:46 charger status: B [lp-1 ] DEBUG 2024/08/19 18:02:06 charger status: B

evcc erkennt B und fragt Tronity, die antworten, in evcc bleibt es aber "Gastfahrzeug"

[tronity] TRACE 2024/08/19 18:01:46 POST https://api.tronity.tech/authentication
[influx] TRACE 2024/08/19 18:01:46 write chargeCurrent=map[value:0] (map[loadpoint:Elektronenpumpe])
[influx] TRACE 2024/08/19 18:01:46 write sessionEnergy=map[value:2136.000000000422] (map[loadpoint:Elektronenpumpe])
[influx] TRACE 2024/08/19 18:01:46 write sessionSolarPercentage=map[value:70.25184337171713] (map[loadpoint:Elektronenpumpe])
[influx] TRACE 2024/08/19 18:01:46 write sessionPricePerKWh=map[value:0.1330140859809751] (map[loadpoint:Elektronenpumpe])
[influx] TRACE 2024/08/19 18:01:46 write sessionPrice=map[value:0.28411808765541896] (map[loadpoint:Elektronenpumpe])
[influx] TRACE 2024/08/19 18:01:46 write chargeTotalImport=map[value:7155.987] (map[loadpoint:Elektronenpumpe])
[pushover] DEBUG 2024/08/19 18:01:46 sending to ***
[influx] TRACE 2024/08/19 18:01:46 write effectivePriority=map[value:0] (map[loadpoint:Elektronenpumpe])
[influx] TRACE 2024/08/19 18:01:46 write effectivePlanSoc=map[value:0] (map[loadpoint:Elektronenpumpe])
[influx] TRACE 2024/08/19 18:01:46 write effectiveMinCurrent=map[value:5] (map[loadpoint:Elektronenpumpe])
[influx] TRACE 2024/08/19 18:01:46 write effectiveMaxCurrent=map[value:16] (map[loadpoint:Elektronenpumpe])
[influx] TRACE 2024/08/19 18:01:46 write effectiveLimitSoc=map[value:100] (map[loadpoint:Elektronenpumpe])
[influx] TRACE 2024/08/19 18:01:46 write sessionEnergy=map[value:0] (map[loadpoint:Elektronenpumpe])
[influx] TRACE 2024/08/19 18:01:46 write sessionSolarPercentage=map[value:0] (map[loadpoint:Elektronenpumpe])
[influx] TRACE 2024/08/19 18:01:46 write chargedEnergy=map[value:0] (map[loadpoint:Elektronenpumpe])
[influx] TRACE 2024/08/19 18:01:46 write chargeCurrent=map[value:0] (map[loadpoint:Elektronenpumpe])
[tronity] TRACE 2024/08/19 18:01:47 GET https://api.tronity.tech/tronity/vehicles/668aed<snip>4ce4/last_record
[tronity] TRACE 2024/08/19 18:01:47 **{"odometer":33500.2,"range":193,"level":43.45,"charging":"Disconnected","plugged":false,"chargerPower":0,"chargeRemainingTime":null,"latitude":48.124068,"longitude":7.844355,"status":null,"timestamp":1724083291000,"lastUpdate":1724083291000}**
[main  ] DEBUG 2024/08/19 18:01:47 vehicle status: A (EM-IL 55E)
[lp-1  ] DEBUG 2024/08/19 18:01:47 pv charge current: 1.1A = 0A + 1.1A (-253W @ 1p)
[lp-1  ] DEBUG 2024/08/19 18:01:47 pv enable timer reset
[lp-1  ] DEBUG 2024/08/19 18:01:47 pv timer inactive
[influx] TRACE 2024/08/19 18:01:47 write greenShareHome=map[value:1] (map[])
[influx] TRACE 2024/08/19 18:01:47 write greenShareLoadpoints=map[value:1] (map[])
[influx] TRACE 2024/08/19 18:01:47 write tariffPriceHome=map[value:0.065] (map[])
[influx] TRACE 2024/08/19 18:01:47 write tariffPriceLoadpoints=map[value:0.065] (map[])
andig commented 2 months ago

Soweit ich sehe schickt Tronity da disconnected?

sebnaf commented 2 months ago

Danke hier für den Pointer, "lastUpdate":1724085884000 erzählt es: die Tesla-API war (mal wieder…) mehrfach offline. Ich glaube ich bau mir mal nen Statusboard für die…

Ich werde mal schauen, ob evcc den Wechsel zu ´connected´ dann richtig erkennt.