evcc-io / evcc

Sonne tanken β˜€οΈπŸš˜
https://evcc.io
MIT License
3.58k stars 660 forks source link

PSA API fails with: oauth2: "invalid_grant" "grant is invalid" #11534

Closed stan23 closed 10 months ago

stan23 commented 10 months ago

Describe the bug

After some days or weeks the connection to PSA API breaks. As a result, the SoC is unknown and planned charging does not work anymore. Restart of cvcc solves the problem.

Is there a way to catch this and force a kind of re-authentication like a cvcc restart does?

Can I add even more details to the log beyond "Peugeot: trace"?

Steps to reproduce

No special steps, just wait and after few days it happens.

  1. Car was connected with 21% SoC and initial query of the API seems to be fine.
  2. 5 minutes later the PSA API seems to report a timeout.
  3. Same logs continue for about 3 hours without actually changing to the configured minimum SoC of 50%.
  4. 7.5 hours later there's a disconnect event without touching the car, but API error remains the same:

All logs are in attached file. logs.txt

Configuration details

<details><summary>Konfiguration (/etc/evcc.yaml)</summary>

# 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
  peugeot: trace

interval: 10s # control cycle interval

sponsortoken: *****

meters:
- name: myPV
  type: template
  template: fronius-solarapi-v1 
  host: fronius.f17a  
  usage: pv
- name: myGrid
  type: custom
  power:
    source: mqtt
    topic: meter/energy/gridPowerCombined
- name: myHK
  type: homematic
  uri: homematic-raspi.f17a:2001
  device: NEQ0115240
  meterchannel: 2
  cache: 30s

chargers:
- name: myWallbox
  type: template
  template: go-e-v3
  host: go-eCharger_112810.f17a  

vehicles:
- name: my208e
  type: template
  template: peugeot 
  title: e-208
  user: *****
  password: *****
  capacity: 50  

loadpoints:
- title: Garage
  charger: myWallbox
  vehicle: my208e
  mode: pv
  phases: 0
  mincurrent: 6
  maxcurrent: 16

site:
  title: F17a
  meters:
    grid: myGrid
    pv: myPV
    aux: myHK

# tariffs are the fixed or variable tariffs
# cheap (tibber/awattar) can be used to define a tariff rate considered cheap enough for charging
tariffs:
  currency: EUR # three letter ISO-4217 currency code (default EUR)
  grid:
    # either static grid price
    type: fixed
    price: 0.3205 # EUR/kWh Nov 2023
  feedin:
    # rate for feeding excess (pv) energy to the grid
    type: fixed
    price: 0.0943 # EUR/kWh
  planner:
    type: grΓΌnstromindex
    zip: *****

influx:
  url: http://influxCT.f17a:8086
  database: evcc # InfluxDB v2.x uses term `bucket` but for compatibility still named `database` here
  token: *****
  org: F17a

# mqtt message broker
mqtt:
  broker: ioBrokerVM.f17a:1883
  topic: evcc # root topic for publishing, set empty to disable publishing

# push messages
messaging:
  events:
    connect: # vehicle connect event
      title: "{{.vehicleTitle}} connected on wallbox {{.title}}"
      msg: |
        {{.vehicleTitle}} connected on wallbox {{.title}} at {{round (divf .pvPower 1000) 2 }} kW PV.
    disconnect: # vehicle connected event
      title: "{{.vehicleTitle}} disconnected of wallbox {{.title}}"
      #msg: Car disconnected after ${connectedDuration}
      msg: |
        {{.vehicleTitle}} disconnected of wallbox {{.title}} after {{.connectedDuration}} with {{round (.vehicleSoc) 0 }} % SoC.
        Charged {{round (divf .chargedEnergy 1000) 2 }} kWh with {{round (.sessionSolarPercentagei) 0}} % collected from the sun :-)
    soc: # vehicle soc update event
      title: SoC updated
      msg: "Battery charged to ${vehicleSoc:%.0f}%"
  services:
  - type: pushover
    app: *****
    recipients: *****
    - CcremovedremovedremovedOR4 # user key for all devices
    devices:
    - iPhone13

</details>

Log details

Restarting cvcc resolves the problem:

[main  ] INFO 2024/01/07 08:03:41 evcc 0.123.5
[main  ] INFO 2024/01/07 08:03:41 using config file: /etc/evcc.yaml
[main  ] INFO 2024/01/07 08:03:41 starting ui and api at :7070
[db    ] INFO 2024/01/07 08:03:42 using sqlite database: /home/marco/.evcc/evcc.db
[mqtt  ] INFO 2024/01/07 08:03:42 connecting evcc-412648543 at tcp://ioBrokerVM.f17a:1883
[mqtt  ] DEBUG 2024/01/07 08:03:42 tcp://ioBrokerVM.f17a:1883 connected
[mqtt  ] DEBUG 2024/01/07 08:03:42 tcp://ioBrokerVM.f17a:1883 subscribe meter/energy/gridPowerCombined
[peugeot] TRACE 2024/01/07 08:03:42 POST https://idpcvs.peugeot.com/am/oauth2/access_token
[peugeot] TRACE 2024/01/07 08:03:42 grant_type=password&password=***&scope=openid+profile&username=***
--
{"access_token":"1561db03-2b5e-419b-bff4-73cb88c199d6","refresh_token":"0de41a03-48cb-4696-ab8d-e907b514a557","scope":"openid profile","id_token":"eyAidHlwIjogIkpXVCIsICJraWQiOiAiU3lsTEM2Tmp0MUtHUWt0RDlNdCswemNlUVNVPSIsICJhbGciOiAiUlMyNTYiIH0.eyAiYXRfaGFzaCI6ICJtb0d0WGoxUExzQ3Nzel91VkxiR1hBIiwgInN1YiI6ICJBUC1BQ05UMjAwMDA3NjE1NzM0IiwgImlzcyI6ICJodHRwczovL2lkcGN2cy5wZXVnZW90LmNvbTo0NDMvYW0vb2F1dGgyIiwgInRva2VuTmFtZSI6ICJpZF90b2tlbiIsICJnaXZlbl9uYW1lIjogIk1hcmNvIiwgImF1ZCI6IFsgIjFlZWJjMmQ1LTVkZjMtNDU5Yi1hNjI0LTIwYWJmY2Y4MjUzMCIgXSwgIm9yZy5mb3JnZXJvY2sub3BlbmlkY29ubmVjdC5vcHMiOiAiZDUyMTg5NGItNzM3Mi00ZjMzLWI1NWEtNTk3OTkwZTBhZjZkIiwgInVwZGF0ZWRfYXQiOiAiMCIsICJhenAiOiAiMWVlYmMyZDUtNWRmMy00NTliLWE2MjQtMjBhYmZjZjgyNTMwIiwgImF1dGhfdGltZSI6IDE3MDQ2MTEwMjIsICJyZWFsbSI6ICIvY2xpZW50c0IyQ1BldWdlb3QiLCAiZXhwIjogMTcwNDYxMTYyMiwgInRva2VuVHlwZSI6ICJKV1RUb2tlbiIsICJpYXQiOiAxNzA0NjExMDIyLCAiZmFtaWx5X25hbWUiOiAiR2Vpc2xlciIgfQ.R9eQRdazeI6KlW4lkPei6Z95WQ93dnopok2tXR_iRitP_F8fhFeOrwDTJDwvzJ4t_v3OHHjVMEFQygkJ242pwV17ZTsLbaeUfIISkeE6hwfvC7HXmMCQApYAt2I4-F6aYObfkAvOSXcrv5ikYdOf509aOY36pVhlh53X3jCjk0w","token_type":"Bearer","expires_in":3599}
[peugeot] TRACE 2024/01/07 08:03:42 GET https://api.groupe-psa.com/connectedcar/v4/user/vehicles?client_id=1eebc2d5-5df3-459b-a624-20abfcf82530
[peugeot] TRACE 2024/01/07 08:03:43 {"_links":{"last":{"href":"https://api.groupe-psa.com/connectedcar/v4/user/vehicles?pageToken=e15590d9a0ceccc82623bccdeb807eedAAAAAQAAAAEAAAABAAAAPAACMC0"},"self":{"href":"https://api.groupe-psa.com/connectedcar/v4/user/vehicles?pageToken=e15590d9a0ceccc82623bccdeb807eedAAAAAQAAAAEAAAABAAAAPAACMC0"},"first":{"href":"https://api.groupe-psa.com/connectedcar/v4/user/vehicles?pageToken=e15590d9a0ceccc82623bccdeb807eedAAAAAQAAAAEAAAABAAAAPAACMC0"}},"total":1,"totalPage":1,"currentPage":1,"_embedded":{"vehicles":[{"_links":{"collisions":{"href":"https://api.groupe-psa.com/connectedcar/v4/user/vehicles/17f6bb30fd59de2fc077716f14303abafebda543c56c8a9929e12ca10e41671449ed72bc562b77af1561d157bef0feb79fd954380d4402fa06f139425b1afe77774eac2567255734cacdf5aaa64a172f8c4c1f3b596dd25345b99c707ba1b6783/collisions"},"alarms":{"href":"https://api.groupe-psa.com/connectedcar/v4/user/vehicles/17f6bb30fd59de2fc077716f14303abafebda543c56c8a9929e12ca10e41671449ed72bc562b77af1561d157bef0feb79fd954380d4402fa06f139425b1afe77774eac2567255734cacdf5aaa64a172f8c4c1f3b596dd25345b99c707ba1b6783/alarms"},"callbacks":{"href":"https://api.groupe-psa.com/connectedcar/v4/user/callbacks"},"alerts":{"href":"https://api.groupe-psa.com/connectedcar/v4/user/vehicles/17f6bb30fd59de2fc077716f14303abafebda543c56c8a9929e12ca10e41671449ed72bc562b77af1561d157bef0feb79fd954380d4402fa06f139425b1afe77774eac2567255734cacdf5aaa64a172f8c4c1f3b596dd25345b99c707ba1b6783/alerts"},"trips":{"href":"https://api.groupe-psa.com/connectedcar/v4/user/vehicles/17f6bb30fd59de2fc077716f14303abafebda543c56c8a9929e12ca10e41671449ed72bc562b77af1561d157bef0feb79fd954380d4402fa06f139425b1afe77774eac2567255734cacdf5aaa64a172f8c4c1f3b596dd25345b99c707ba1b6783/trips"},"self":{"href":"https://api.groupe-psa.com/connectedcar/v4/user/vehicles/17f6bb30fd59de2fc077716f14303abafebda543c56c8a9929e12ca10e41671449ed72bc562b77af1561d157bef0feb79fd954380d4402fa06f139425b1afe77774eac2567255734cacdf5aaa64a172f8c4c1f3b596dd25345b99c707ba1b6783"},"lastPosition":{"href":"https://api.groupe-psa.com/connectedcar/v4/user/vehicles/17f6bb30fd59de2fc077716f14303abafebda543c56c8a9929e12ca10e41671449ed72bc562b77af1561d157bef0feb79fd954380d4402fa06f139425b1afe77774eac2567255734cacdf5aaa64a172f8c4c1f3b596dd25345b99c707ba1b6783/lastPosition"},"remotes":{"href":"https://api.groupe-psa.com/connectedcar/v4/user/vehicles/17f6bb30fd59de2fc077716f14303abafebda543c56c8a9929e12ca10e41671449ed72bc562b77af1561d157bef0feb79fd954380d4402fa06f139425b1afe77774eac2567255734cacdf5aaa64a172f8c4c1f3b596dd25345b99c707ba1b6783/callbacks/{cbid}/remotes","templated":true},"telemetry":{"href":"https://api.groupe-psa.com/connectedcar/v4/user/vehicles/17f6bb30fd59de2fc077716f14303abafebda543c56c8a9929e12ca10e41671449ed72bc562b77af1561d157bef0feb79fd954380d4402fa06f139425b1afe77774eac2567255734cacdf5aaa64a172f8c4c1f3b596dd25345b99c707ba1b6783/telemetry"},"user":{"href":"https://api.groupe-psa.com/connectedcar/v4/user"},"maintenance":{"href":"https://api.groupe-psa.com/connectedcar/v4/user/vehicles/17f6bb30fd59de2fc077716f14303abafebda543c56c8a9929e12ca10e41671449ed72bc562b77af1561d157bef0feb79fd954380d4402fa06f139425b1afe77774eac2567255734cacdf5aaa64a172f8c4c1f3b596dd25345b99c707ba1b6783/maintenance"},"status":{"href":"https://api.groupe-psa.com/connectedcar/v4/user/vehicles/17f6bb30fd59de2fc077716f14303abafebda543c56c8a9929e12ca10e41671449ed72bc562b77af1561d157bef0feb79fd954380d4402fa06f139425b1afe77774eac2567255734cacdf5aaa64a172f8c4c1f3b596dd25345b99c707ba1b6783/status"},"monitors":{"href":"https://api.groupe-psa.com/connectedcar/v4/user/vehicles/17f6bb30fd59de2fc077716f14303abafebda543c56c8a9929e12ca10e41671449ed72bc562b77af1561d157bef0feb79fd954380d4402fa06f139425b1afe77774eac2567255734cacdf5aaa64a172f8c4c1f3b596dd25345b99c707ba1b6783/callbacks/{cbid}/monitors","templated":true}},"id":"17f6bb30fd59de2fc077716f14303abafebda543c56c8a9929e12ca10e41671449ed72bc562b77af1561d157bef0feb79fd954380d4402fa06f139425b1afe77774eac2567255734cacdf5aaa64a172f8c4c1f3b596dd25345b99c707ba1b6783","vin":"VR3UHZKXZNT109814","brand":"Peugeot","pictures":["https://visuel3d-secure.peugeot.com/V3DImage.ashx?client=miseco&back=0&format=png&version=1PP2A5ZESFB0A0D1&color=0MM60NSM&trim=0PD70RFX&OPT1=DLZ0&OPT2=DNA0&OPT3=DWY4&view=001","https://visuel3d-secure.peugeot.com/V3DImage.ashx?client=miseco&back=0&format=png&version=1PP2A5ZESFB0A0D1&color=0MM60NSM&trim=0PD70RFX&OPT1=DLZ0&OPT2=DNA0&OPT3=DWY4&view=002","https://visuel3d-secure.peugeot.com/V3DImage.ashx?client=miseco&back=0&format=png&version=1PP2A5ZESFB0A0D1&color=0MM60NSM&trim=0PD70RFX&OPT1=DLZ0&OPT2=DNA0&OPT3=DWY4&view=003","https://visuel3d-secure.peugeot.com/V3DImage.ashx?client=miseco&back=0&format=png&version=1PP2A5ZESFB0A0D1&color=0MM60NSM&trim=0PD70RFX&OPT1=DLZ0&OPT2=DNA0&OPT3=DWY4&view=004","https://visuel3d-secure.peugeot.com/V3DImage.ashx?client=miseco&back=0&format=png&version=1PP2A5ZESFB0A0D1&color=0MM60NSM&trim=0PD70RFX&OPT1=DLZ0&OPT2=DNA0&OPT3=DWY4&view=005","https://visuel3d-secure.peugeot.com/V3DImage.ashx?client=miseco&back=0&format=png&version=1PP2A5ZESFB0A0D1&color=0MM60NSM&trim=0PD70RFX&OPT1=DLZ0&OPT2=DNA0&OPT3=DWY4&view=006","https://visuel3d-secure.peugeot.com/V3DImage.ashx?client=miseco&back=0&format=png&version=1PP2A5ZESFB0A0D1&color=0MM60NSM&trim=0PD70RFX&OPT1=DLZ0&OPT2=DNA0&OPT3=DWY4&view=007","https://visuel3d-secure.peugeot.com/V3DImage.ashx?client=miseco&back=0&format=png&version=1PP2A5ZESFB0A0D1&color=0MM60NSM&trim=0PD70RFX&OPT1=DLZ0&OPT2=DNA0&OPT3=DWY4&view=008","https://visuel3d-secure.peugeot.com/V3DImage.ashx?client=miseco&back=0&format=png&version=1PP2A5ZESFB0A0D1&color=0MM60NSM&trim=0PD70RFX&OPT1=DLZ0&OPT2=DNA0&OPT3=DWY4&view=009","https://visuel3d-secure.peugeot.com/V3DImage.ashx?client=miseco&back=0&format=png&version=1PP2A5ZESFB0A0D1&color=0MM60NSM&trim=0PD70RFX&OPT1=DLZ0&OPT2=DNA0&OPT3=DWY4&view=010","https://visuel3d-secure.peugeot.com/V3DImage.ashx?client=miseco&back=0&format=png&version=1PP2A5ZESFB0A0D1&color=0MM60NSM&trim=0PD70RFX&OPT1=DLZ0&OPT2=DNA0&OPT3=DWY4&view=011","https://visuel3d-secure.peugeot.com/V3DImage.ashx?client=miseco&back=0&format=png&version=1PP2A5ZESFB0A0D1&color=0MM60NSM&trim=0PD70RFX&OPT1=DLZ0&OPT2=DNA0&OPT3=DWY4&view=012"]}]}}
[lp-1  ] DEBUG 2024/01/07 08:03:43 charge total import: 3772.565kWh
[site  ] INFO 2024/01/07 08:03:43 site config:
[site  ] INFO 2024/01/07 08:03:43   meters:      grid βœ“ pv βœ“ battery βœ—
[site  ] INFO 2024/01/07 08:03:43     grid:      power βœ“ energy βœ— currents βœ—
[site  ] INFO 2024/01/07 08:03:43     pv 1:      power βœ“ energy βœ— currents βœ—
[site  ] INFO 2024/01/07 08:03:43   vehicles:
[site  ] INFO 2024/01/07 08:03:43     vehicle 1: range βœ“ finish βœ“ status βœ“ climate βœ“ wakeup βœ—
[lp-1  ] INFO 2024/01/07 08:03:43 loadpoint 1:
[lp-1  ] INFO 2024/01/07 08:03:43   mode:        pv
[lp-1  ] INFO 2024/01/07 08:03:43   charger:     power βœ“ energy βœ“ currents βœ“ phases βœ“ wakeup βœ—
[lp-1  ] INFO 2024/01/07 08:03:43   meters:      charge βœ“
[lp-1  ] INFO 2024/01/07 08:03:43     charge:    power βœ“ energy βœ“ currents βœ“
[lp-1  ] DEBUG 2024/01/07 08:03:43 phase timer inactive
[lp-1  ] DEBUG 2024/01/07 08:03:43 pv timer inactive
[lp-1  ] DEBUG 2024/01/07 08:03:43 guard timer inactive
[lp-1  ] INFO 2024/01/07 08:03:43 vehicle updated: unknown -> e-208
[site  ] WARN 2024/01/07 08:03:43 interval <30s can lead to unexpected behavior, see https://docs.evcc.io/docs/reference/configuration/interval
[site  ] DEBUG 2024/01/07 08:03:43 ----
[lp-1  ] DEBUG 2024/01/07 08:03:43 charge power: 0W
[site  ] DEBUG 2024/01/07 08:03:43 pv power: 0W
[site  ] DEBUG 2024/01/07 08:03:43 grid power: 529W
[site  ] DEBUG 2024/01/07 08:03:43 aux power 1: 0W
[site  ] DEBUG 2024/01/07 08:03:43 aux power: 0W
[site  ] DEBUG 2024/01/07 08:03:43 site power: 529W
[peugeot] TRACE 2024/01/07 08:03:43 GET https://api.groupe-psa.com/connectedcar/v4/user/vehicles/17f6bb30fd59de2fc077716f14303abafebda543c56c8a9929e12ca10e41671449ed72bc562b77af1561d157bef0feb79fd954380d4402fa06f139425b1afe77774eac2567255734cacdf5aaa64a172f8c4c1f3b596dd25345b99c707ba1b6783/status?client_id=1eebc2d5-5df3-459b-a624-20abfcf82530
[peugeot] TRACE 2024/01/07 08:03:44 {"createdAt":"2024-01-06T17:23:00Z","updatedAt":"2024-01-06T17:23:00Z","lastPosition":{"type":"Feature","geometry":{"type":"Point","coordinates":[11.47108,49.0289,377]},"properties":{"createdAt":"2024-01-06T17:22:55Z","heading":101,"type":"Acquire","signalQuality":4,"fixStatus":"3D"}},"engines":[{"type":"Electric","speed":0,"gmpStatus":"Stopped","createdAt":"2024-01-06T17:23:00Z"}],"powertrain":{"createdAt":"2024-01-06T17:23:00Z","status":"Stopped"},"ignition":{"createdAt":"2024-01-06T17:16:33Z","type":"Stop"},"battery":{"voltage":86.5,"createdAt":"2024-01-06T17:16:33Z"},"privacy":{"createdAt":"2024-01-06T17:23:00Z","state":"None"},"lightingSystem":{"turn":[{"direction":"Right","position":"Front","status":"Off"},{"direction":"Right","position":"Rear","status":"Off"},{"direction":"Left","position":"Front","status":"Off"},{"direction":"Left","position":"Rear","status":"Off"}],"fog":[{"direction":"Left","position":"Front","status":"Off"},{"direction":"Right","position":"Front","status":"Off"},{"direction":"Left","position":"Rear","status":"Off"},{"direction":"Right","position":"Rear","status":"Off"}],"createdAt":"2024-01-06T17:23:00Z"},"service":{"createdAt":"2023-07-01T07:11:48Z","type":"Electric"},"safety":{"createdAt":"2023-07-01T07:11:49Z","beltStatus":[{"belt":"Omission","id":"Driver"},{"belt":"Omission","id":"Passenger"}],"autoECallTriggering":"NotDetected"},"environment":{"luminosity":{"createdAt":"2024-01-06T17:16:33Z","day":false},"air":{"createdAt":"2024-01-06T17:16:33Z","temp":4}},"odometer":{"createdAt":"2024-01-06T17:16:33Z","mileage":22000.2},"kinetic":{"createdAt":"2024-01-06T17:23:00Z","acceleration":0,"speed":0,"moving":false},"_links":{"self":{"href":"https://api.groupe-psa.com/connectedcar/v4/user/vehicles/17f6bb30fd59de2fc077716f14303abafebda543c56c8a9929e12ca10e41671449ed72bc562b77af1561d157bef0feb79fd954380d4402fa06f139425b1afe77774eac2567255734cacdf5aaa64a172f8c4c1f3b596dd25345b99c707ba1b6783/status?profile=endUser"},"vehicle":{"href":"https://api.groupe-psa.com/connectedcar/v4/user/vehicles/17f6bb30fd59de2fc077716f14303abafebda543c56c8a9929e12ca10e41671449ed72bc562b77af1561d157bef0feb79fd954380d4402fa06f139425b1afe77774eac2567255734cacdf5aaa64a172f8c4c1f3b596dd25345b99c707ba1b6783"}},"preconditioning":{"airConditioning":{"createdAt":"2024-01-06T17:16:34Z","updatedAt":"2024-01-06T17:16:34Z","status":"Disabled","programs":[{"enabled":false,"slot":1,"recurrence":"Daily","start":"PT6H30M","occurence":{"day":["Wed"]}},{"enabled":true,"slot":2,"recurrence":"Daily","start":"PT6H30M","occurence":{"day":["Tue"]}}]}},"energies":[{"createdAt":"2024-01-06T17:22:22Z","type":"Electric","subType":"ElectricEnergy","level":21,"autonomy":46,"extension":{"electric":{"battery":{"load":{"createdAt":"2024-01-06T17:22:22Z","capacity":34304,"residual":5344}},"charging":{"plugged":true,"status":"Disconnected","remainingTime":"PT0S","chargingRate":0,"chargingMode":"No","nextDelayedTime":"PT16H"}}}}],"preconditionning":{"airConditioning":{"createdAt":"2024-01-06T17:16:34Z","updatedAt":"2024-01-06T17:16:34Z","status":"Disabled","programs":[{"enabled":false,"slot":1,"recurrence":"Daily","start":"PT6H30M","occurence":{"day":["Wed"]}},{"enabled":true,"slot":2,"recurrence":"Daily","start":"PT6H30M","occurence":{"day":["Tue"]}}]}},"energy":[{"createdAt":"2024-01-06T17:22:22Z","updatedAt":"2024-01-06T17:22:23Z","type":"Electric","level":21,"autonomy":46,"charging":{"plugged":true,"status":"Disconnected","remainingTime":"PT0S","chargingRate":0,"chargingMode":"No","nextDelayedTime":"PT16H"}}]}
[lp-1  ] DEBUG 2024/01/07 08:03:44 vehicle odometer: 22000km
[lp-1  ] DEBUG 2024/01/07 08:03:44 charge currents: [0 0 0]A
[lp-1  ] DEBUG 2024/01/07 08:03:44 charge total import: 3772.565kWh
[lp-1  ] DEBUG 2024/01/07 08:03:44 charger status: B
[lp-1  ] INFO 2024/01/07 08:03:44 car connected
[lp-1  ] DEBUG 2024/01/07 08:03:44 pv timer elapse
[lp-1  ] DEBUG 2024/01/07 08:03:44 pv timer inactive
[lp-1  ] DEBUG 2024/01/07 08:03:44 charger: guard elapse
[lp-1  ] DEBUG 2024/01/07 08:03:44 guard timer inactive
[lp-1  ] DEBUG 2024/01/07 08:03:44 charge total import: 3772.565kWh
[lp-1  ] DEBUG 2024/01/07 08:03:44 vehicle status: B
[lp-1  ] DEBUG 2024/01/07 08:03:44 vehicle soc: 21%
[lp-1  ] DEBUG 2024/01/07 08:03:44 vehicle range: 46km
[lp-1  ] DEBUG 2024/01/07 08:03:44 set my208e plan soc: 0 @ 0001-01-01 00:53:28 +0053 LMT
[lp-1  ] DEBUG 2024/01/07 08:03:44 available power -529W < 4140W min 3p threshold
[lp-1  ] DEBUG 2024/01/07 08:03:44 phase scale1p in 0s
[pushover] DEBUG 2024/01/07 08:03:44 sending to ***
[lp-1  ] DEBUG 2024/01/07 08:03:44 switched phases: 1p
[lp-1  ] DEBUG 2024/01/07 08:03:44 phase timer inactive
[lp-1  ] DEBUG 2024/01/07 08:03:44 pv charge current: 0A = 0A + -2.3A (529W @ 1p)
[lp-1  ] DEBUG 2024/01/07 08:03:44 pv enable timer reset
[lp-1  ] DEBUG 2024/01/07 08:03:44 pv timer inactive

What type of operating system are you running?

Linux

Version

0.123.5

andig commented 10 months ago

Bitte trace log.

andig commented 10 months ago

I don't think there's anything to do. We have a valid refresh token. Refresh fails with unspecified server timeout. Afterwards refresh totally fails with previously valid refresh token. My guess: PSA had a infrastructure hick-up and invalidated all tokens. Since we're not seeing this regularly wontfix.

stan23 commented 10 months ago

Hmm, I'm seeing it every few weeks and one morning I was stuck with an empty battery. Any idea how I can catch it externally? messaging does not trigger on this kind of error.

I guess I need to check the status reported by evcc API when it appears the next time and see if anything indicates this constellation.

andig commented 10 months ago

Could you try finding a log that does not have a timeout error before? Or does it always happen together with a timeout error?

stan23 commented 10 months ago

I have only the last 3 occurrences due to log rotate, and it is always after that same timeout error.

But I'll keep an eye on it in the future once it happens again.

andig commented 10 months ago

Does it ever refresh successfully? Think it did in the original log. So not sure what is going on at PSA...

stan23 commented 10 months ago

It did refresh a number of times until it broke after the timeout at 18:48.

164:Dec 31 16:09:25 evccCT evcc[581451]: [peugeot] TRACE 2023/12/31 16:09:25 grant_type=refresh_token&refresh_token=e33aab16-9fa8-4ce3-a541-66d2347c94f2
513:Jan  2 08:03:24 evccCT evcc[581451]: [peugeot] TRACE 2024/01/02 08:03:24 grant_type=refresh_token&refresh_token=75b2ed6d-c7bb-4cf2-abaa-e672408ad944
569:Jan  2 12:25:34 evccCT evcc[581451]: [peugeot] TRACE 2024/01/02 12:25:34 grant_type=refresh_token&refresh_token=938db208-5f60-4e5e-9a0b-d759c92ec5d5
589:Jan  2 13:26:14 evccCT evcc[581451]: [peugeot] TRACE 2024/01/02 13:26:14 grant_type=refresh_token&refresh_token=a768f870-794d-48b9-b72e-28b222e97c7a
611:Jan  2 14:26:54 evccCT evcc[581451]: [peugeot] TRACE 2024/01/02 14:26:54 grant_type=refresh_token&refresh_token=f8f4509d-c08a-44e8-bad1-f7ab3cd686fd
630:Jan  2 15:27:34 evccCT evcc[581451]: [peugeot] TRACE 2024/01/02 15:27:34 grant_type=refresh_token&refresh_token=ede69ae1-d561-4bc2-b812-196458426492
707:Jan  2 21:08:54 evccCT evcc[581451]: [peugeot] TRACE 2024/01/02 21:08:54 grant_type=refresh_token&refresh_token=114ddf61-dfa2-48fb-9388-44cdcbc22ae1
823:Jan  3 10:08:25 evccCT evcc[581451]: [peugeot] TRACE 2024/01/03 10:08:25 grant_type=refresh_token&refresh_token=614db5e4-f136-4bd3-8dba-89cb69c4e4a7
1171:Jan  4 07:36:26 evccCT evcc[593399]: [peugeot] TRACE 2024/01/04 07:36:26 grant_type=refresh_token&refresh_token=f913cd59-3f27-4b6e-b8b2-7a29cf6a57d9
1190:Jan  4 08:44:56 evccCT evcc[593399]: [peugeot] TRACE 2024/01/04 08:44:56 grant_type=refresh_token&refresh_token=f52be6f8-df9f-4b79-ac63-8704e90f76fe
1214:Jan  4 09:45:26 evccCT evcc[593399]: [peugeot] TRACE 2024/01/04 09:45:26 grant_type=refresh_token&refresh_token=fc524313-c258-40fc-a2e5-717145083d6f
1294:Jan  4 17:45:36 evccCT evcc[593399]: [peugeot] TRACE 2024/01/04 17:45:36 grant_type=refresh_token&refresh_token=5f825017-74d1-4fce-b414-6b8fccb15a0f
1318:Jan  4 18:48:25 evccCT evcc[593399]: [peugeot] TRACE 2024/01/04 18:48:25 grant_type=refresh_token&refresh_token=f1a7f686-f46a-4e4a-832c-a18d805b9f92
1324:Jan  4 18:48:35 evccCT evcc[593399]: [peugeot] TRACE 2024/01/04 18:48:35 grant_type=refresh_token&refresh_token=f1a7f686-f46a-4e4a-832c-a18d805b9f92
1332:Jan  4 18:48:56 evccCT evcc[593399]: [peugeot] TRACE 2024/01/04 18:48:56 grant_type=refresh_token&refresh_token=f1a7f686-f46a-4e4a-832c-a18d805b9f92
1342:Jan  4 18:49:25 evccCT evcc[593399]: [peugeot] TRACE 2024/01/04 18:49:25 grant_type=refresh_token&refresh_token=f1a7f686-f46a-4e4a-832c-a18d805b9f92
andig commented 10 months ago

This seems to indicate that refresh is working until PSA has a hickup. If this is a new problem let's monitor it for some time. If you're running on docker you could for example restart the container each night to trigger new login. If it persist we'll need to think about logging in again when refresh fails.

stan23 commented 10 months ago

Good idea but this is a Proxmox LXC. I will wait until it happens again and then look at the evcc API to see if anything indicates the problem. If so, I'll send a push message to myself to restart evcc.

If I figure out anything I'll update this ticket. Thanks for your time looking into it πŸ‘