evcc-io / evcc

Solar Charging ☀️🚘
https://evcc.io
MIT License
3.67k stars 687 forks source link

Renault: Provide a meaningful error when not paired #3535

Closed ickeundso closed 2 years ago

ickeundso commented 2 years ago

Describe the bug

For some reasons the the my renault account is not connected with the configured car in evcc. Known reasons:

This will produce a http 403 if evcc tries to get the vehicle status values. The vehicle will then not be available in evcc.

The kemeron API provides an additional attribute to determine the car is already connected to the active account.

For the /vehicles request the response contains the "Connected Driver" object.

"connectedDriver": { "role": "MAIN_DRIVER", "createdDate": "2022-04-20T14:39:40.557672Z", "lastModifiedDate": "2022-05-29T12:36:47.520413Z" },

For the case the car is not connected to the my renault account the response lokks like this:

"connectedDriver": { "createdDate": "2022-04-20T14:39:40.557672Z", "lastModifiedDate": "2022-05-29T12:36:47.520413Z" },

The implementation can ask for this attribute and can produce a meaningful error message.

Steps to reproduce

Go to you my renault app an remove the car form the acount. "trennen sie ihr auto" on the very bottom left. You will then get the http 403 when evcc tries to ask the kemereon API.

Configuration details

vehicles:

Log details

ERROR 2022/05/29 15:19:17 vehicle odometer: unexpected status: 500 ERROR 2022/05/29 15:19:24 vehicle soc: unexpected status: 500

What type of operating system are you running?

Docker container

Version

master

ickeundso commented 2 years ago

I will create a pull request for that issue. Almost done.

andig commented 2 years ago

@ickeundso leider scheint das mit Dacia nicht zu funktionieren:

    "connectedDriver": {
        "createdDate": "2022-07-25T14:59:59.396452050Z",
        "lastModifiedDate": "2022-08-19T13:47:49.592337747Z"
    },

Hier gibts kein Role Attribut und trotzdem ist das Auto verbunden. Ich würde jetzt createdDate != 0 ebenfalls noch akzeptieren. Es scheint als würde die Regel nur greifen, wenn es ein Renault account ist?

andig commented 2 years ago

Siehe https://github.com/evcc-io/evcc/pull/4166