Groupe PSA Cars Binding (Peugeot, Citroen, DS, Opel, Vauxhall)

I get everything that you have plus:

Charging time remaining
Current (however it has always been 0,0A, so I don’t get any meaningful data from it)
Fuel autonomy (it‘s obviously a hybrid)
Fuel level (sometimes, mostly it’s stuck at 0% which is not correct)
Mileage
Privacy status (always ‚None‘)

Service says always Hybrid for me. This does not seem to relate to the actual drive mode.

1 Like

So, my car is at the dealer because it does not charge anymore. Therefore, I did not look into my Openhab config much. However, now I saw that the PSA bridge is in status ERROR and disabling and reenabling yields the follwing message in the log:

[oauth2client.internal.OAuthConnector] - grant type refresh_token to URL https://idpcvs.peugeot.com/am/oauth2/access_token failed with error code invalid_grant, description grant is invalid

Any idea, what is wrong and how to refresh the authorisation token (that is what the python server did on a restart)?

I had similar problems (don’t know about the exact error message though). I could fix this by deleting and adding the bridge again. I had the bridge disabled for a couple of months before I had these problems. Could be that some sort of auth token is simply not valid anymore after a couple of days/weeks/months?!

I tried deleting and re-adding the bridge again, but I still get the same error.

EDIT: I tried to use the same UID for the bridge again, which seems to be a problem. I tried a different UID and now the bridge is ONLINE again.

I had some serious problems with unexpected OH restarts today (sometimes maybe an estimated 5 times per hour) and could not really find out what was causing this…

However I realised that my PSA bridge was offline and I saw some errors (nothing really out of the ordinary, just some authentication issues) in the logs. Since I’m hardly using it I just disabled the bridge and no restart occurred so far :man_shrugging:

Could this be related?

LOL - a minute after I wrote this OH just restarted again :joy: never mind…

Same here :frowning: and my log says:

2022-10-08 22:14:36.072 [WARN ] [ternal.bridge.GroupePSABridgeHandler] - Unable to fetch vehicles: Rest call failed: statusCode=-1, message=Unable to authenticate: null

I double checked my credentials several times.

After recreating the bridge, it is working again.

I hope it continues working: PSA/Stelantis does seem to be changing the login procedure.

My car was discovered, but status is OFFLINE and

Vehicle not connected to the cloud

What can i do?

i have the same, when i drive the car i becomes online and the channels being updated.

this is something stelantis has chosen.
my car is only connected when driving, or when unlocking the car. even the mypeugeot app has no connection, so openhab also doenst have a connection

I partially fixed that for me using an ESP32 on the OBD port which reports various values over MQTT to openhab and allows to stop the charge at 90 percent for example.

See here (German) CAN-BUS am OBD2-Stecker - e-208 - Batterie, Reichweite • Peugeot e-208 - Elektroauto Forum

What a pain :confused:
Next car is a Tesla :roll_eyes:

3 Likes

is it the same binding as the one in the official distribution?
If true, is there a reason to maintain it as published in the marketplace, with a risk of confusion for the users?

@arjanmels : could you please answer?

@Lolodomo, Yes it’s the same, I’ll remove it form the marketplace, since it has been included in the official distribution.

I wanted to give the PSA API a try again. I configured the bridge with username, password and also my own client id and secret. But the bridge stays offline:

2023-04-16 20:08:37.490 [ERROR] [oauth2client.internal.OAuthConnector] - grant type refresh_token to URL https://idpcvs.opel.com/am/oauth2/access_token failed with error code invalid_grant, description grant is invalid

I can connect to endpoint https://idpcvs.opel.com/am/oauth2/access_token with my credentials but using grant_type: password (described here).

I assume the binding needs an update to the new API?

@arjanmels Do you develop thus binding any longer? I can assist and test but I’m afraid I don’t think I could manage to provide full code.

1 Like

Hi, I think the binding is dead. Stellantis have changed the connection method and I think they support MQTT event based connections now instead of REST polling. I’m having similar problems with code I’ve written for myself to do this. I think there is a python library that’s up to date, but nothing for OH.

:slight_smile:

Looks like they change the login-flow… the REST APIs are still in place…
If you have a valid token the binding is still working.

I follow several forums on the topic, so far there is no reference implementation in other projects.