joro75 / Domoticz-Toyota-Plugin

A Domoticz plugin that provides devices for a Toyota car with connected services
MIT License
6 stars 1 forks source link

'Too many requests' Exception is raised when retrieving the vehicle information #53

Closed joro75 closed 1 year ago

joro75 commented 1 year ago

A 'Too many requests' Exception is raised when retrieving the vehicle information. See the Log-file

2022-12-05 21:00:08.059 RAV4: Updating vehicle status
2022-12-05 21:00:09.215 Error: RAV4: 'onHeartbeat' failed 'ToyotaApiError':'HTTP: 429 - Too Many Requests. Please try again later.'.
2022-12-05 21:00:09.216 Error: RAV4: Exception traceback:
2022-12-05 21:00:09.217 Error: RAV4: ----> Line 798 in '/home/pi/domoticz/plugins/Domoticz-Toyota-Plugin/plugin.py', function onHeartbeat
2022-12-05 21:00:09.217 Error: RAV4: ----> Line 164 in '/home/pi/domoticz/plugins/Domoticz-Toyota-Plugin/plugin.py', function onHeartbeat
2022-12-05 21:00:09.218 Error: RAV4: ----> Line 752 in '/home/pi/domoticz/plugins/Domoticz-Toyota-Plugin/plugin.py', function update_devices
2022-12-05 21:00:09.218 Error: RAV4: ----> Line 245 in '/home/pi/domoticz/plugins/Domoticz-Toyota-Plugin/plugin.py', function retrieve_vehicle_status
2022-12-05 21:00:09.219 Error: RAV4: ----> Line 50 in '/usr/lib/python3.7/asyncio/runners.py', function run
2022-12-05 21:00:09.219 Error: RAV4: ----> Line 584 in '/usr/lib/python3.7/asyncio/base_events.py', function run_until_complete
2022-12-05 21:00:09.219 Error: RAV4: ----> Line 254 in '/usr/local/lib/python3.7/dist-packages/mytoyota/client.py', function get_vehicle_status
2022-12-05 21:00:09.219 Error: RAV4: ----> Line 73 in '/usr/local/lib/python3.7/dist-packages/mytoyota/api.py', function get_vehicle_status_endpoint
2022-12-05 21:00:09.219 Error: RAV4: ----> Line 226 in '/usr/local/lib/python3.7/dist-packages/mytoyota/controller.py', function request

Information from 2022-11-29 is still available, and seems to be the latest retrieved information. Since then no updates are received anymore. Domoticz is already restarted, but doesn't seem to make any difference.

joro75 commented 1 year ago

This seems to be a problem related to the Toyota servers. Also other users of the mytoyota library have reported similar problems. See: https://github.com/DurgNomis-drol/mytoyota/issues/204

joro75 commented 1 year ago

The cause of the problem is found, and is already fixed in version 0.9.1 of mytoyota. We need to upgrade to that version, to also fix the plugin.

joro75 commented 1 year ago

Fixed by PR #55

joro75 commented 1 year ago

I can confirm that with version 0.9.1 of Domoticz-Toyota-Plugin, the retrieval of the status of the vehicle is working without errors again.