No update of values while charging
Hi,
i dont get update of the values from the car when i charge the car. i always have to unlock and lock doors to get an update of datas (for example soc)... how can i fix that?!
Mokka-e, est. 2021
Regards Malte
In most cases re-logging to PSACC solves the problem.
Edit: but at the moment it's most probably an issue on PSA server, as the official app doesn't update either.
Edit2: few days later PSACC died totally. I had to do a fresh install + login procedure to get it back running.
I have the same issue after starting to charge I get errors in the logs:
2025-02-18 18:46:41,780 :: WARNING :: remote_refresh_token isn't defined 2025-02-18 18:46:42,155 :: ERROR :: Error during activation: {'err': 'NOK:FORBIDDEN'}
Once the charging is done, everything is working fine again.
I get updates... But only if i lock and unlock the door of the car! While charging, i dont get any updates of the state for example...
PSA add-on version : 3.5.3 PSA car model : ds4 e-tense
HA Core 2025.2.5 HA Supervisor 2025.02.4 HA Operating System 14.2 HA Frontend 20250221.0
Charging start is always well automaticaly detected by the add_on After start, the add-on seems expecting the charging_level to increase during charging. However, ss the battery_level remains constant during charging, the add-on repeatedly try to wake-up the server but every wake-up fails (FORBIDDEN) until charging end is detected Redoing otp procedure as suggested in the log has no effect...
Same sequence of errors occur during each charging of the car.
The add-on sqlite database is however always well updated for all chargings with goods start_date/start_level/end_date/end_level
NB: I created a HA rest_command "psa_get_live_info" (get_live_info without using cache) that make the corresponding HTTP request to the add_on. The call to the corresponding service (using ha/tools/actions frontend), always return with status OK (200) (no otp requirement) The content of the response also shows that the charging level never increase during charging.
#
##############################################
# rest_commands for PSACC API
##############################################
#
rest_command:
#
###############################################################################
# 1. Get the car state
# http://localhost:5000/get_vehicleinfo/YOURVIN
###############################################################################
#
psa_get_vehicle_live_info:
url: "http://localhost:5000/get_vehicleinfo/{{vin}}"
headers:
User-Agent: "Home Assistant"
Content-Type: "application/json; charset=utf-8"
method: GET
ds4_get_vehicle_live_info:
url: "http://localhost:5000/get_vehicleinfo/<MY_VIN>"
headers:
User-Agent: "Home Assistant"
Content-Type: "application/json; charset=utf-8"
method: GET
# ###############################################################################
# # 2. Get the car state from cache to avoid to use PSA API too much
# # http://localhost:5000/get_vehicleinfo/YOURVIN?from_cache=1
# ###############################################################################
#
psa_get_vehicle_info:
url: "http://localhost:5000/get_vehicleinfo/{{vin}}?from_cache=1"
headers:
User-Agent: "Home Assistant"
Content-Type: "application/json; charset=utf-8"
method: GET
ds4_get_vehicle_info:
url: "http://localhost:5000/get_vehicleinfo/<MY_VIN>?from_cache=1"
headers:
User-Agent: "Home Assistant"
Content-Type: "application/json; charset=utf-8"
method: GET
Attached full log (with my VIN replaced by <MY_VIN>) : 2025-02-28 - PSA Controler errors during charging .log
Usualy the updates come from Stellantis while charging, but since a couple weeks(?) it only changes the charging state and doesn't update anything more.
What helps for me is sending a wake up signal. With that it doesn't update anything update verything. Stellantis just doesn't push any updates during charging itself.
Could you share what you do fort wakeup in homeassistant?!
In my Case IT doesnt Work. I have to lock / unlock car or Open the door... Just in this Case i get maybe an update
See the api https://github.com/flobz/psa_car_controller/blob/master/docs/psacc_api.md point 7
Ok , Same url i already use in my Script within my configuration.yaml with
rest_command: mokka_wakeup: url: http://localhost:5000/wakeup/VXKUXXXXXXXXXX And than i Trigger IT from an Automation every 5 mins
Or did you use it in another way?
I usually don't use the wake up in an automation. I only update with option 2 from the url to update from cache. Stellantis will temporarily ban you quite fast if you do too many api calls. The api limit seems to be really low.
A few days ago the wakeup Just rund every hour once... But Same Problem, cant get current accu Status... Thats quiet terrible cause my evcc doesnt make Sense :(
exact same issue here.
since 2 weeks at least, PSACC doesn't get any update from API when and only when the car (E-208) is charging.
in PSACC logs, we can see the token is invalid or revoked, which is weird, because once charging is finished (by depluging the charge cable), PSACC get informations from API flawlessly.
the wakeup command has the same result than the PSACC wakeup script (asked automaticaly by the script when Battery level doesn't change during a too long period of time during charging), token invalid. the charge level info directly get from API ( no "?from_cache=1") doesn't change anything.
I suspect PSACC ask too frequently the API to wakeup the car during charge sessions (every minutes according to logs, whatever the update cron we set), specially when we use a slow charge speed mode (3.6kw, which is the highest I can get at home).
logs I get are exactly the same than above :
2025-02-28 14:08:26,921 :: INFO :: ask wakeup to <MY_VIN>
2025-02-28 14:08:26,922 :: INFO :: topic: psa/RemoteServices/from/cid/AC-ACNT200005303345/VehCharge/state: {'action': 'state'}
2025-02-28 14:08:28,565 :: WARNING :: remote_refresh_token isn't defined
2025-02-28 14:08:28,804 :: ERROR :: Error during activation: {'err': 'NOK:FORBIDDEN'}
2025-02-28 14:08:29,039 :: ERROR :: Can't refresh remote token, please redo otp procedure
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/RemoteClient.py", line 177, in _refresh_remote_token
self._get_remote_access_token(otp_code)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/RemoteClient.py", line 208, in _get_remote_access_token
self.remoteCredentials.access_token = data["access_token"]
KeyError: 'access_token'
If I update datas from Mypeugeot app on my phone, wakeup works fine, and PSACC get the updated information, but just once. MyPeugeot app ask me the pin code frequently, when and only when car is charging, and PSACC is stuck with non-updated values. if car is not charging, the wakeup command works flawlessly (http 200 response from API in PSACC logs).
I've revoked all my tokens in MyPeugeot app, registered again MyPeugeot app and PSACC, no change. I've redone the OTP procedure, but no change.
I've tried to reduce the update frequency to 5 minutes, no change. I've rebuilt the PSACC docker, no change. I've downgraded from 3.5.6 to 3.5.3, no change.
This is pretty annoying, because it literraly kills the main goal of the app: stopping the charge at 80% battery level. @flobz , can you help about this ?
Opel told me that the car is.going to "sleep" to prevent damage / overconsumption of the 12v battery... I dont know If this answer make Sense or is realistic but maybe an explanation why the values are updating in the Moment of opening/closing the car?!
see my post ( https://github.com/flobz/psa_car_controller/issues/1080 ) , I fixed the issue I had.