Home Assistant release with the issue:
0.89.1
Last working Home Assistant release (if known):
Operating environment (Hass.io/Docker/Windows/etc.):
hassio
Component/platform:
https://www.home-assistant.io/components/toon/
Description of problem:
The toon component seems to calling the Toon api too much
Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):
toon:
client_id: ***
client_secret: ****
Traceback (if applicable):
toonapilib.toonapilibexceptions.IncompleteStatus: {'fault': {'faultstring': 'Rate limit quota violation. Quota limit exceeded. Identifier : *******', 'detail': {'errorcode': 'policies.ratelimit.QuotaViolation'}}}
Additional information:
n/a
I confirm the same issue as @MatthijsDJ already posted. Before upgrading I was using the custom component from https://github.com/krocat/ToonHA which worked without any issues for the last 5-6 months.
Same here.
Just got the same problem. Used to work for a few days but after few subsequent HA restarts i started to get this.
See: https://github.com/home-assistant/home-assistant/issues/21010#issuecomment-471358123
Same here, had it nearly from the beginning ...
I see in https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/toon/climate.py that the update interval is set at 30 seconds. Which is 2880 API calls a day.
SUPPORT_FLAGS = SUPPORT_TARGET_TEMPERATURE | SUPPORT_OPERATION_MODE
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=5)
SCAN_INTERVAL = timedelta(seconds=30)
But the Toon API docs say the following... max 100 or 500 calls a day (not sure at what it depends)
https://developer.toon.eu/developer-journey
To protect our quality of service we have set a quotum of 10 calls per minute per display. To discourage the implementation of longer lasting continuous interaction a quotum of 100 calls per display per days applies on top of this. But to give you more flexibility during development you are allowed to consume 60 calls per minute and 500 calls per day per display to make sure you can play around as desired.
This is weird, I've seen the limitation in the documentation, but was unable to hit it.
The previous existing custom component is also polling at a rate of 30 seconds, which has not been an issue for a long time.
FYI: I'm not having those issues myself.
I'll look into a solution for this.
Does it maybe have something to do with the appname you give to https://developer.toon.eu/user/me/apps when you sign up to a developer account. maybe they only accept an special amount of request for a specific appneme.
because the new component has been released everybody is now maybe signing up with the same appname like: hassio or homeassistant could that cause any conflicts?
The toonapilib with Krocat/ToonHA has worked for me the last year flawlessly. but right now there are problems just when the new component is released.
I am reverting back to the Krocat/ToonHA versionto see if i have problems with that version.
Maybe you could try to extend the minimum MIN_TIME_BETWEEN_UPDATES to 30 seconds
@scheric The easy solution for this, it to adhere to the limits imposed by the docs.
Suggested:
I like the configurable scan interval because it has worked perfectly for the last year with 30 seconds interval.
@scheric It might be the appname but also Toon went to a new api. Probably the limit wasn't an issue on the old api? Hence no problems with it in the past.
Regarding the app name, I didn't used a generic name for it so I guess that isn't the issue.
@MatthijsDJ
I have used https://github.com/krocat/ToonHA for the last year that version uses the same (new) API that this new component uses. It even uses the same toonapilib
I did not have problems with https://github.com/krocat/ToonHA for the last year. but now i stept on this new component i am having problems.
I am now going to test the https://github.com/krocat/ToonHA version for a week and look for errors.
@scheric Ok, I was not aware of that. Might it be that this new component gets more data (sensors) from toon and does more api calls?
@MatthijsDJ It does not, since the toonapilib is the one that limits the number of requests. And both use the same lib.
or maybe due to increased interest, Toon is now enforcing the limit more thoroughly?
I am now running https://github.com/krocat/ToonHA . i have changed the toonapilib refresh time to STATE_CACHING_SECONDS = 5 I have hooked up an template sensor that tracks the refresh time.
I only received some
toonapilib.toonapilibexceptions.IncompleteStatus: {'code': 500, 'message': 'Internal Server Error', 'description': 'Error communicating with Toon'}
errors.
I have not seen any quota violation errors and i can see my my full log.
I had the same issue when I did use a common name: Home Assistant.
Now it's running fine for 2 days after I changed the appname to something random.
I reverted to https://github.com/krocat/ToonHA and for the last 3 days works perfect with no modification of developer appname, refresh time or toonapilib version.
I've changed my appname last night, and for now it's running...
Altough I didn't used a common changed my app name aswell.. Will have a look the logs wether this fix it,
Interesting conclusion if this becomes true... that would be a bug we'd need to report with Eneco/Toon themselves.
@frenck Changed the name, but didn't fixed the issue. Also if I look the error message the "rate_limit" is based on your Developer account with Toon.
Learning Python since yesterday so might use this issue to speed up learing ;-)
@frenck, I also changed the name, worked for al little while but now it's broken again...
Thanks for letting me know!
I'm currently finishing another thing and will dive into this asap. (Unless someone beats me to it of course) :+1:
I celebrated too early, sorry guys :(
Looking for another solution, let you know if I find some .
@frenck, would really like to help you but don't know where to start :p ...
@frenck
I haven't thoroughly tested this change but could this be an solution?
https://github.com/home-assistant/home-assistant/compare/dev...scheric:scheric-toon-quota-violation
@scheric No, that is not a solution. I've left a comment on your PR as well.
I'm testing a workaround for now (based on the temporary changed cache TTL on the toonapilib). This will take off the heat.
I also found the source of the issue at hand and started implementing a better solution to this problem overall.
Can confirm that the temporary fix is working.
Thanks for letting me know @MatthijsDJ, I'm currently about 60-70% done with the "real" solution to this problem.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 馃憤
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
This is still ongoing, but currently blocked due to the climate 1.0 change. PR is open.
Merged, part of v0.96.