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

Mill. Still getting "too many requests after 2023.9.1 #100060

Closed
Bluhme1 opened this issue Sep 10, 2023 · 12 comments · Fixed by #100315
Closed

Mill. Still getting "too many requests after 2023.9.1 #100060

Bluhme1 opened this issue Sep 10, 2023 · 12 comments · Fixed by #100315
Assignees

Comments

@Bluhme1
Copy link

Bluhme1 commented Sep 10, 2023

The problem

Mill. Still getting "too many requests after 2023.9.1

What version of Home Assistant Core has the issue?

2023.9.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Mill

Link to integration documentation on our website

No response

Diagnostics information

Logger: homeassistant.components.mill
Source: helpers/update_coordinator.py:248
Integration: Mill (documentation, issues)
First occurred: 08.51.38 (227 occurrences)
Last logged: 13.52.53

Unexpected error fetching mill data: {"error":{"type":"Too Many Requests","message":"Too Many Requests from customer - 066e9e66-5370-42a6-87e3-288b5da637dc. Limit: 4000 requests per day for this endpoint"}}
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 293, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 248, in _async_update_data
return await self.update_method()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/mill/init.py", line 323, in fetch_heater_and_sensor_data
await self.update_devices()
File "/usr/local/lib/python3.11/site-packages/mill/init.py", line 206, in update_devices
await asyncio.gather(*tasks)
File "/usr/local/lib/python3.11/site-packages/mill/init.py", line 224, in _update_home
await asyncio.gather(*tasks)
File "/usr/local/lib/python3.11/site-packages/mill/init.py", line 234, in _update_room
await asyncio.gather(*tasks)
File "/usr/local/lib/python3.11/site-packages/mill/init.py", line 250, in _update_device
device_stats = await self.request(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/mill/init.py", line 163, in request
raise TooManyRequests(result)
mill.TooManyRequests: {"error":{"type":"Too Many Requests","message":"Too Many Requests from customer - 066e9e66-5370-42a6-87e3-288b5da637dc. Limit: 4000 requests per day for this endpoint"}}

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.mill
Source: helpers/update_coordinator.py:248 
Integration: Mill (documentation, issues) 
First occurred: 08.51.38 (227 occurrences) 
Last logged: 13.52.53

Unexpected error fetching mill data: {"error":{"type":"Too Many Requests","message":"Too Many Requests from customer - 066e9e66-5370-42a6-87e3-288b5da637dc. Limit: 4000 requests per day for this endpoint"}}
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 293, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 248, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mill/__init__.py", line 323, in fetch_heater_and_sensor_data
    await self.update_devices()
  File "/usr/local/lib/python3.11/site-packages/mill/__init__.py", line 206, in update_devices
    await asyncio.gather(*tasks)
  File "/usr/local/lib/python3.11/site-packages/mill/__init__.py", line 224, in _update_home
    await asyncio.gather(*tasks)
  File "/usr/local/lib/python3.11/site-packages/mill/__init__.py", line 234, in _update_room
    await asyncio.gather(*tasks)
  File "/usr/local/lib/python3.11/site-packages/mill/__init__.py", line 250, in _update_device
    device_stats = await self.request(
                   ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mill/__init__.py", line 163, in request
    raise TooManyRequests(result)
mill.TooManyRequests: {"error":{"type":"Too Many Requests","message":"Too Many Requests from customer - 066e9e66-5370-42a6-87e3-288b5da637dc. Limit: 4000 requests per day for this endpoint"}}

Additional information

No response

@home-assistant
Copy link

Hey there @Danielhiversen, mind taking a look at this issue as it has been labeled with an integration (mill) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of mill can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign mill Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


mill documentation
mill source
(message by IssueLinks)

@Danielhiversen
Copy link
Member

It seems that Mill has made some changes to the rate limiting again.
Really hard to fix since it is not documented and changes without any notice.

@Bluhme1
Copy link
Author

Bluhme1 commented Sep 10, 2023

Just for your information. I get approximately 9 hours of data between 14.00 and 23.00. Then it turns unavailable again

@Danielhiversen
Copy link
Member

How many heaters do you have?

@Bluhme1
Copy link
Author

Bluhme1 commented Sep 10, 2023

I have 2 generation 2 and 2 generation 3 heaters in my summer cabin

@Bluhme1
Copy link
Author

Bluhme1 commented Sep 10, 2023

Could we set a limit on the number of requests. Knowing that we loose on accuracy

@Danielhiversen
Copy link
Member

Yes, that is what I am trying.
Are you able to test these changes?
https://github.com/Danielhiversen/pymill/compare/master...cache-1?quick_pull=1

@Bluhme1
Copy link
Author

Bluhme1 commented Sep 10, 2023

How do I test that. Should I try to set Mill up as a custom_component? Or can I modify the files in HA directly?

@MistaWu
Copy link

MistaWu commented Sep 11, 2023

Getting the same, 4 gen2 and 1 gen3 heaters. How do I test?

@Danielhiversen
Copy link
Member

You need to modify the library locally, and that depends on how HA is installed.
I only have one heater, but if it works fine here I push another fix .

@MistaWu
Copy link

MistaWu commented Sep 12, 2023

Just got this mail from Mill:

Dear valued API user,

We have recently identified an issue with your account involving excessive utilization of our API endpoints. This heightened activity has placed a significant strain on our server resources, resulting in a noticeable degradation in performance for all other users of our application.

Several of our endpoints have been designed with a maximum request limit of 4000 requests per 24 hours. Regrettably, it has come to our attention that this threshold is being reached prematurely in the day, and despite reaching this limit, we continue to observe a considerable volume of spam-like activity originating from your account.

We are eager to understand whether this unusual usage pattern is intentional or if it may be attributed to a third-party integration you have implemented. If the latter is the case, it could signify a suboptimal integration that may require refinement.

If your integration employs the Homey Integration, we strongly recommend upgrading to the latest version, as initial releases were notably less optimized. Furthermore, if you utilize any third-party integrations apart from Tibber or Homey, we kindly request that you inform us so that we can initiate discussions with these providers to enhance their integration with our systems.

Soon, we will be introducing API call limits per account, which will encompass two key components:

The maximum number of API calls allowed per minute/hour.

The maximum number of API calls allowed within a 24-hour period.

This measure is being implemented to ensure equitable resource allocation for all users, preventing the actions of a few from adversely affecting the experience of many. We trust that you appreciate the necessity of this step, and should you have any inquiries or concerns, please do not hesitate to reach out to us.

For your convenience, the updated API quota limits will be published on our documentation website: http://mn-be-prod-documentation.s3-website.eu-central-1.amazonaws.com/#/. We anticipate further improvements and enhanced organization of this documentation page soon, complete with illustrative examples. Stay tuned for these enhancements.

Thank you for your understanding and cooperation.

@fahlsen
Copy link

fahlsen commented Sep 12, 2023

I also spoke with Mill support on the phone now, and they say they will change the limit to 200 request pr hour.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants