core: Unable to add the nVent RAYCHEM SENZ integration
The problem
Since a couple of days I am unable to add the nVent RAYCHEM SENZ integration to Home Assistant. Because of #83274 I had to remove the integration and re-add it only to be greeted with an error message. I have since tried several time over the last couple of days with no luck.
account-link.nabucasa.com responds with this:
What version of Home Assistant Core has the issue?
core-2024.1.5
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
nVent RAYCHEM SENZ
Link to integration documentation on our website
https://www.home-assistant.io/integrations/senz
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
This message is what appears in the log when #83274 hits, requiring the user to re-add the integration to get back on track:
2024-01-22 20:58:28.982 ERROR (MainThread) [homeassistant.components.senz] Error requesting email@example.com data: 500, message='Internal Server Error', url=URL('https://account-link.nabucasa.com/refresh_token/senz')
Additional information
No response
About this issue
- Original URL
- State: open
- Created 5 months ago
- Reactions: 12
- Comments: 27
No, the 7 days is simply because it took me 7 days each time to report it to NVent.
They’ve been great. I was told that during recent maintenance the old rate limits were accidentally reinstated. They were corrected today.
This is a common problem for a lot of us.
There are usage limits for the API but strange thing is that this hits many users are at the same time though we all have different used IDs. Looks more like Home Assistant users are treated as one or the limits are not reset as they should.
Or are we all channeled via account-link.nabucasa.com?
https://api.senzthermostat.nvent.com/#burstratelimits
Current limits These limits are defined as a per user and per client basis. Which means a single user combined with a specific client id, has these specific limits. That means if a client ids user hits the limit, he is blocked out for the rest of that period, but it does not affect the other users of that client id.
Per second 50 Per 30 minutes 750 Per 12 hours 20,000 Per 7 days 250,000
Http Responses: When the rate limits are hit, the RestAPI will return HttpCode 429 - Too many requests.
Now it’s again possible to add the integration. And like last time, 7 days after it stopped working.
I found a way to get this working without going through the stupid home assistant nabucasa cloud.
Also manual did a test with this so there is definitely a rate limiting of 99999 for 7 days for the API, api.senzthermostat.nvent.com.
< X-Rate-Limit-Limit: 7d < X-Rate-Limit-Remaining: 99997 < X-Rate-Limit-Reset: 2024-03-13T14:15:09.1776935Z
Interesting that it has been exactly one month again, between when the rate limit issue was fixed and now it has reoccured.
That’s the same timeframe the refresh token issue was always seen, is this just a coincidence.
I now suspect both issues are within the SENZ API itself.
That can be changed in Automation, instructions here:
https://www.home-assistant.io/common-tasks/general/
Disable the default polling (usually 30 s) in the System Options for the Integration (behind the 3 dots in upper right corner):
Set up a new automation to run at desired intervals:
2024-01-30 17:36:35.665 DEBUG (MainThread) [homeassistant.components.senz] Finished fetching email@example.com data in 0.161 seconds (success: True) 2024-01-30 17:37:35.664 DEBUG (MainThread) [homeassistant.components.senz] Finished fetching email@example.com data in 0.159 seconds (success: True) 2024-01-30 17:38:35.720 DEBUG (MainThread) [homeassistant.components.senz] Finished fetching email@example.com data in 0.213 seconds (success: True) 2024-01-30 17:39:35.694 DEBUG (MainThread) [homeassistant.components.senz] Finished fetching email@example.com data in 0.187 seconds (success: True) 2024-01-30 17:40:35.687 DEBUG (MainThread) [homeassistant.components.senz] Finished fetching email@example.com data in 0.183 seconds (success: True) 2024-01-30 17:41:35.687 DEBUG (MainThread) [homeassistant.components.senz] Finished fetching email@example.com data in 0.180 seconds (success: True)