DurgNomis-drol / ha_toyota

Toyota Connected Services integration for Home Assistant.
MIT License
148 stars 29 forks source link

Receiving HTTP 429 errors #122

Closed ajain-93 closed 1 year ago

ajain-93 commented 1 year ago

Describe the bug Unable to update any of the sensors, all sensors showing up as unavailable. Started receiveing HTTP 429 errors since 12 hours ago.

To Reproduce -

Expected behavior The sensors updates at interval.

Screenshots image

image

Additional context Log ouput:

This error originated from a custom integration.

Logger: custom_components.toyota
Source: helpers/update_coordinator.py:223
Integration: Toyota Connected Services (documentation, issues)
First occurred: 9:13:20 PM (5 occurrences)
Last logged: 9:15:07 PM

Error fetching toyota data: HTTP: 429 - Too Many Requests. Please try again later.
roenlond commented 1 year ago

Same issue with my system. I've tried deleting both the integration and the HACS package while restarting HA with no effect. Following this issue, thanks for reporting

Aad3229 commented 1 year ago

Exactly the same here. All sensors unavailable: Error fetching toyota data: HTTP: 429 - Too Many Requests. Please try again later. Error fetching toyota data: Update canceled! Toyota's API was too slow to respond. Will try again later...

ajain-93 commented 1 year ago

Tried updating the integration using the github-repo (rather than the release in HACS).

After Disabling and Enabling the integration, there is an Failed to set up error on the integration screen. image

Checking the logs, it shows the same 429, as well as an Update Cancelled error.

Log Output

This error originated from a custom integration.

Logger: custom_components.toyota
Source: helpers/update_coordinator.py:223
Integration: Toyota Connected Services (documentation, issues)
First occurred: 8:52:54 AM (139 occurrences)
Last logged: 11:58:46 AM

Error fetching toyota data: HTTP: 429 - Too Many Requests. Please try again later.
Error fetching toyota data: Update canceled! Toyota's API was too slow to respond. Will try again later...
lkucytowski commented 1 year ago

It's now taking forever to pull any data in their official app, somebody in Toyota needs to restart the NGINX ;) Their infrastructure is in shambles, probably running on a potato, hopefully the problem will go away soon.

DurgNomis-drol commented 1 year ago

It's now taking forever to pull any data in their official app, somebody in Toyota needs to restart the NGINX ;) Their infrastructure is in shambles, probably running on a potato, hopefully the problem will go away soon.

Toyota's servers are the worst things I have ever worked with 😆 😭 They crap out for no reason what so ever

fransward commented 1 year ago

Same here. Could it be that they modified their api rate limiter?

ald3baranfr commented 1 year ago

hello same issue for me.

daha76 commented 1 year ago

Same issue for me. I can't get it work for several days...

rpetteruti commented 1 year ago

Same here

ndriu commented 1 year ago

same here for many hours...

AdrianStanciu22 commented 1 year ago

A possible explanation could be here: https://twitter.com/samwcyo/status/1597792097175674880

ajain-93 commented 1 year ago

The API for Toyota (MyT) is still online. Debuggning a HASS integration was a little bit too much for me. I tried my shot reverse-engineering the API and realised that this integration is an spinoff/inspired from the project https://github.com/calmjm/tojota.

I have now created a fork of the above project, which publishes data to MQTT when executed (this can be accomplished via an automation and Shell Command), from which HASS can automatically pick up the data. Note, I do not have any remote control functions, hence they are not present in the published MQTT data.

image

If @DurgNomis-drol could point me in the right direction for debug I can help try to solve this issue in this integration.

primeroz commented 1 year ago

even with testing just the simple example in https://github.com/DurgNomis-drol/mytoyota/tree/v0.7.7 i get 429 as soon as client.get_vehicle_status(car) is called which seems to issue 4 concurrent requests https://github.com/DurgNomis-drol/mytoyota/blob/v0.7.7/mytoyota/client.py#L248

I guess we need to limit the number of concurrent requests ?

Iture commented 1 year ago

No, it doesn't work (I've tried this approach) I just added an issue here: https://github.com/DurgNomis-drol/mytoyota/issues/204

DurgNomis-drol commented 1 year ago

@Iture issue seems like a good reason as to why it does not work, or they have added aggressive rate limiting to their API to stop integrations like this from getting data from them. Either way, this will require substantial work to fix, if even possible.

lucianlazar1983 commented 1 year ago

i debugged network connections while the app was open and found http calls to this endpoints:myt-agg.toyota-europe.com ( i think this is it, had a lot of them while calling for trips)events.mapbox.comapi.mapbox.comI am trying to find a way to get the payload too but it will be difficult as i have an iphone.—Lazar LucianOn 6 Dec 2022, at 21:24, Simon Hansen @.***> wrote: @Iture issue seems like a good reason as to why it does not work, or they have added aggressive rate limiting to their API to stop integrations like this from getting data from them. Either way, this will require substantial work to fix, if even possible.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

joro75 commented 1 year ago

The server endpoint seems to be oke. The mytoyota library that is being used is also connecting to: "https://myt-agg.toyota-europe.com/". Can you check or determine if the complete URL of the endpoint is still: "https://myt-agg.toyota-europe.com/cma/api" (including the 'cma/api' suffix?)

lucianlazar1983 commented 1 year ago

tomorrow will sure do and report back, i am out now—Lazar LucianOn 6 Dec 2022, at 22:10, John de Rooij @.***> wrote: The server endpoint seems to be oke. The mytoyota library that is being used is also connecting to: "https://myt-agg.toyota-europe.com/". Can you check or determine if the complete URL of the endpoint is still: "https://myt-agg.toyota-europe.com/cma/api" (including the 'cma/api' prefix?)

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

ajain-93 commented 1 year ago

@joro75: The server endpoint seems to be oke. The mytoyota library that is being used is also connecting to: "https://myt-agg.toyota-europe.com/". Can you check or determine if the complete URL of the endpoint is still: "https://myt-agg.toyota-europe.com/cma/api" (including the 'cma/api' suffix?)

There are essentially three different endpoints used:

DurgNomis-drol commented 1 year ago

See #204 for the reason it does not work, will publish a fixed version soon

DurgNomis-drol commented 1 year ago

Can confirm fix works, will be releasing a new version shortly!

primeroz commented 1 year ago

thank you

joro75 commented 1 year ago

@ajain-93 : Thanks for the information. Most of the endpoint URL's are also being used by mytoyota. However (to my suprise), some of them are also slightly different. That's interesting, but no need to change it at this moment.

ajain-93 commented 1 year ago

@joro75: https://ssoms.toyota-europe.com/authenticate and https://cpb2cs.toyota-europe.com/api/ones i mentioned above are the ones I was able to reverse-engineer by checking out the Swedish MyT portal on the web. The last one though, doesn't show up for me in my webbrowser.