Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poll rate (rate limit) #215

Closed
Stene79 opened this issue Oct 12, 2023 · 24 comments · Fixed by #219
Closed

Poll rate (rate limit) #215

Stene79 opened this issue Oct 12, 2023 · 24 comments · Fixed by #219
Assignees
Labels
bug Something isn't working

Comments

@Stene79
Copy link

Stene79 commented Oct 12, 2023

About 1 month ago, I had problems with the car becoming unavailable in HA every evening, the same applies to access in the Skoda app. Connection was restored a little late at night, with a downtime of about 6 hours.

I thought at first that this was due to work on the servers, but when the problem did not stop I contacted Skoda who took the matter up with the factory. Was then told that access was closed due to backend protection due to a third party program.

Guess this is due to HA polling the skoda server too often. Is it possible to add a variable in configuration to set update frequency against server, or reduce this permanent?

I run the latest version of HA and Skoda connect. Both parts have been updated during this period without the problem having changed

@Stene79 Stene79 added the bug Something isn't working label Oct 12, 2023
@dvx76
Copy link
Member

dvx76 commented Oct 12, 2023

Hi, you can configure the Polling Frequency in the integration settings (Settings -> Devices and Services -> Integrations -> Skoda Connect -> Configure).

Keep in mind there are many other third-party services. I suspect things like Tronity and Pump might have a larger userbase than HA and who knows how often they are hitting the Skoda API.

Either way, feel free to play around with the polling interval. I personally have it set to 30s.

@Stene79
Copy link
Author

Stene79 commented Oct 12, 2023

Thanks for the reply dvx76. Mistake of me not checking configuration settings. Was sure I had checked there earlier.

It was at 60sec, set it to 120sec and I'll see if that prevents me from being blocked.

I don't know about Tronity and Pump, it's not something I use. I have only configured Skoda connect in HA and I occasionally use the Android app.

@nation-wide
Copy link

nation-wide commented Oct 12, 2023

I am also seeing this error. It can be seen in the logs for example like below but also as HTTP request error code 429:

'errors': [{'type': 'UNAVAILABLE_VCF_CAPABILITIES', 'description': 'Fetch VCF capabilities failed because of {UNKNOWN}'}]}

I've now changed my poll interval to 180 seconds to see if it works like that.

It seems that there is some kind of daily quota of requests. The request limit is lifted when they day changes at 00:00 UTC.

@AlexanderKas
Copy link

I think I have the same issue since quite some time, but I did not find the time to investigate it further.
When I go to bed the status of my car is automatically checked with a forced refresh. This used to work fine until, I suppose a few weeks or maybe months ago.

Every day in the evening the Skoda entities become unavailable. Every night at 2:00 am (00:00 UTC) the entities come available again. During the time the entities are unavailable the Skoda app doesn't connect either.

I have changed the poll interval from 60 to 120 seconds to see if it works.

@federicotravaini
Copy link

I have the same issue with a CUPRA and the bad thing is I can't even use the official app. Setting to 120s and see how it changes.

@federicotravaini
Copy link

Fixed for me using 120s pull

I also removed some data that are no longer pulled and this makes me think if this also count as single pull request (one for each data type) or is it just one pull with all the data in a single request.

Do you know?

@Stene79
Copy link
Author

Stene79 commented Oct 16, 2023

I have had full uptime since changing to 120s. Before this I deactivated a number of sensors without it affecting anything, so I think they count each update and not data that is read.

I had about 6 hours of downtime a day, so I assume that the limit is 1000 pulls a day, 18 hours x 60 = 1080. So 120s is well within, 24x30 = 720.

@tiefflieger666
Copy link

Same here (HA and off. app stop to work daily at 18:00 +/- few minutes) on 60 sec poll (16 hrs (02:00 - 18:00) * 60 ) = 960 => ≈ 1k

After changed to 180 sec everything is fine - go now to 120.

The issue started from 09.10.2023 on - looks like "VW" changed their policy.

Bottom line - the bug is to allow polls below 120 sec, additionally the issue should be mentioned in the documention.

@federicotravaini
Copy link

Bottom line - the bug is to allow polls below 120 sec, additionally the issue should be mentioned in the documention.

I absolutely second this

@dvx76
Copy link
Member

dvx76 commented Oct 22, 2023

What do you mean by the bug is to allow polls below 120 sec ?

As for documentation, I can add a note where Poll frequency is documented in the README.

dvx76 added a commit to dvx76/homeassistant-skodaconnect that referenced this issue Oct 22, 2023
dvx76 added a commit to dvx76/homeassistant-skodaconnect that referenced this issue Oct 22, 2023
@bratanon
Copy link

I have the same problem, and got the same answer from Skoda support that @Stene79 got.

Will try to change the polling interval to 300 and see if that helps.

Also, please correct me if I'm wrong here, but disabling entities in the Skoda integrations will not affect anything as all data (instruments) are collected for every request anyway, right?

@federicotravaini
Copy link

I have the same problem, and got the same answer from Skoda support that @Stene79 got.

Will try to change the polling interval to 300 and see if that helps.

Also, please correct me if I'm wrong here, but disabling entities in the Skoda integrations will not affect anything as all data (instruments) are collected for every request anyway, right?

120s is fine

@Nomeboj
Copy link

Nomeboj commented Oct 23, 2023

Hi.

Is it possible to somehow collaborate with Skoda to have official integration? I don't know the details but isn't better to be subscribed to some data on server, so server can send when some information is changed? In that case we will not ask server for data refresh every two minutes or less, or I am getting this wrong?
I mean this HA integration is really nice to have, it works as additional alarm in case of car movement, it can notify if you forgot to close doors,windows etc.

@tiefflieger666
Copy link

What do you mean by the bug is to allow polls below 120 sec ?

As for documentation, I can add a note where Poll frequency is documented in the README.

I have to apologise - bug is not the correct wording. It should be enough do mentioned into the documention.

And 120 should be default - 120 sek means 720 calls (enough below 1000 what looks like the Skoda limit).

@tiefflieger666
Copy link

Hi.

Is it possible to somehow collaborate with Skoda to have official integration? I don't know the details but isn't better to be subscribed to some data on server, so server can send when some information is changed? In that case we will not ask server for data refresh every two minutes or less, or I am getting this wrong? I mean this HA integration is really nice to have, it works as additional alarm in case of car movement, it can notify if you forgot to close doors,windows etc.

I don't think that Skoda / VW will allow that - they have their own app. Look what happen with Mazda where Mazda do not allow to use the api for HA integration.

@dvx76
Copy link
Member

dvx76 commented Oct 23, 2023

@tiefflieger666

And 120 should be default - 120 sek means 720 calls (enough below 1000 what looks like the Skoda limit).

Cool. I'm changing the doc in #219 and the default is being changed in #217

Is it possible to somehow collaborate with Skoda to have official integration?

The integration replicates how the Skoda App works. Which is pull-based. There is no push-based solution, even though that would definitely be nice.

I would be very reluctant to try and discuss this integration with Skoda/VW because at best I don't think they will be interested to collaborate with no financial incentive. At worst, the don't like this at all and can try to block us. Ideally someone with a good contact in VW/Skoda would create a backchannel.

dvx76 added a commit that referenced this issue Oct 24, 2023
Rate changes to stay within the rate limits mentioned in #215
@odelma
Copy link

odelma commented Oct 30, 2023

Hi, just wanted to share my experience in case someone else is puzzled by the rate limiting behavior. I had the poll frequency at 60s (or was it even 30s) for some time and it worked fine, but few weeks ago every afternoon at the same time the inegration started reporting unavailable and came back alive at UTC 00:00. After increasing the poll frequency (having read about the problems both here and with VW, our other car is ID.3), it was again stable for some days with 120s, but now it changed again a few days ago. Now the unavailability comes at 3PM UTC and as expected lasts until 12PM UTC. So it seem I have to increase the poll frequence again to at least 180s.

Why I wanted to share this is that it may not be enough to give any exact "safe" polling frequency. It would be nice to know how it works at the back end, why some clients are limited (seemingly) more than others. We do not have anything else polling the API except this integration, I assume the VW integration is working with a completely different back-end (although it could explain something if VAG was harmoninzing their e-services and rate limiting ip's with too frequent connections). The Skoda model in this case is -23 Superb iV.

@Farfar
Copy link
Collaborator

Farfar commented Oct 30, 2023

I assume the VW integration is working with a completely different back-end (although it could explain something if VAG was harmoninzing their e-services and rate limiting ip's with too frequent connections).

I believe that it's the same backend for all VAG connected cars. Perhaps different for ID/Enyaq but your Superb iV shares backend, and frontend, with the VW Passat GTE.

@tiefflieger666
Copy link

Looks like Skoda / VW changed the behavior / daily limit again after 23.10.2023. Before it was working 24 hrs with 120 sec, but after 23.10.2023 it becames unavaliable after aprox. 18,5 hours (between 21:15-21:30 GMT+2). What refers to a limit of 500 calls per day - or a poll rate of 180.
Have adapted it on my side to 150 (I know - it's not enough to cover the whole, but that would proof the hypothesis). Results will be visible on Wednesy (partly tomorrow, due the change was done at 8:00 GMT+1).

Will keep you updated.

@odelma
Copy link

odelma commented Oct 30, 2023

I assume the VW integration is working with a completely different back-end (although it could explain something if VAG was harmoninzing their e-services and rate limiting ip's with too frequent connections).

I believe that it's the same backend for all VAG connected cars. Perhaps different for ID/Enyaq but your Superb iV shares backend, and frontend, with the VW Passat GTE.

Yes, that could be. Our other car is ID.3. It does not seem to suffer from similar rate limit. I think I've set it to 120s now and it works 24h.

I changed the poll frequence for Skoda Connect to 180s around noon today but still, at exactly 3PM UTC it stopped working.

@Farfar
Copy link
Collaborator

Farfar commented Oct 30, 2023

My ID4 started becoming unavailable every other poll cycle. So they have definitely made changes to the frontend for ID/Enyaq as well. Though there does not seem to be a hard limit (yet what I've seen) for ID frontend.
The hardest rate limit is for the old API which is common for all PHEV+Combustion connected cars which makes sense since there's plenty more cars and users using it.

@schmic79
Copy link

schmic79 commented Mar 8, 2024

I got the information from Skoda that the limit should be around 20 - 25 calls per day!

Have not tested if this is true - but it is possible that they lowered the limit again.

@kjbstar
Copy link

kjbstar commented Apr 17, 2024

It seems they did, yes.
Since a few weeks I'm getting mad at their official app far more often than before.

I can see the multiple 429 errors in logs :

Too many requests. Further requests can only be made after the end of next trip in order to protect your vehicles battery.

And

Failed to execute data refresh - Action rate limit reached. Start the car to reset the action limit

@dvx76 it would bé nice to remove the 900 poll refresh rate limit, I was at 90, and wanted to put 1800, but impossible. Used 900, but who knows how many times it will hold :)

@dvx76
Copy link
Member

dvx76 commented Apr 18, 2024

Please raise a new issue (or better, submit a PR) to get the max poll frequency raised. Should be trivial.

25 calls a day is ridiculous, even for Skoda. Probably mentioned before the actual limit is obscure, probably updated regularly, and definitely different for different models (and maybe also different locations). I've had poll frequency 60s for nearly 2 years with no issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.