Flodu31/HomeAssistant-PeugeotIntegration

Timeout calling Wakeup

iendicott opened this issue · 3 comments

This was working the other week before there were lots of Home Assistant updates so not sure if it's related. I am seeing this error when trying to wake the Peugeot. All the sensors drop offline for about 3 minutes, then they reappear with no issues.

The actual PSA app seems to be able to wake the car. This mentions a token so I can only assume I may need to re-register my car with the plugin again?

The log shows this error

2024-04-14 08:30:50,639 :: INFO :: ask wakeup to <vin removed> 2024-04-14 08:30:50,639 :: INFO :: topic: psa/RemoteServices/from/cid/AP-ACNT200006114963/VehCharge/state: {'action': 'state'} 2024-04-14 08:30:51,372 :: ERROR :: Can't refresh remote token 'refresh_token' Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/RemoteClient.py", line 167, in _refresh_remote_token self.remoteCredentials.refresh_token = data["refresh_token"] KeyError: 'refresh_token' 2024-04-14 08:30:52,999 :: INFO :: save config change

Screenshot_20240414-043159~3.png

Any ideas?

Just checked, I am receiving this message with any rest_command. Here is my code which hasn't changed in the last few weeks.

psa_wakeup:
url: "http://127.0.0.1:5000/wakeup/VIN REMOVED"
psa_climate_on:
url: "http://127.0.0.1:5000/preconditioning/VIN REMOVED/1"
psa_climate_off:
url: "http://127.0.0.1:5000/preconditioning/VIN REMOVED/0"

So I found the issue.
It seems like the Peugeot Servers are taken over 60 seconds to return a response to the Plugin.
I've overcome this by adding a timeout.

Hope this helps someone else.

psa_wakeup:
url: "http://127.0.0.1:5000/wakeup/VIN REMOVED"
timeout: 70
psa_climate_on:
url: "http://127.0.0.1:5000/preconditioning/VIN REMOVED/1"
timeout: 70
psa_climate_off:
url: "http://127.0.0.1:5000/preconditioning/VIN REMOVED/0"
timeout: 70

I am having a similar issue, getting a timeout on any rest_command.
including a time-out time of 90 in the code did not solve it.

anything else I can do?