home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.74k stars 30.85k forks source link

Tomorrow.io not allowing integration after removing previous ClimaCell integration #69608

Closed Intecpsp closed 2 years ago

Intecpsp commented 2 years ago

The problem

When trying to add the Tomorrow.io integration (after removing ClimaCell integration yesterday), I am either getting "Currently rate limited, please try again later." or a blank "Aborted" prompt.

What version of Home Assistant Core has the issue?

core-2022.4.0

What was the last working version of Home Assistant Core?

core-2022.3.8

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tomorrow.io

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tomorrowio

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Nothing in the logs for Tomorrow.io

Additional information

I removed the ClimaCell integration yesterday after upgrading to 2022.4.0 and seeing that it had been trnasitioned over to Tomorrow.io. After removing ClimaCell, I tried adding the Tomorrow.io integration using the same API key, but was prompted that I was being rate limited and to try later. After trying some more last night and again this morning, I am seeing the same prompt as well as an intermittent aborted prompt.

probot-home-assistant[bot] commented 2 years ago

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


tomorrowio documentation tomorrowio source (message by IssueLinks)

raman325 commented 2 years ago

@Intecpsp did you remove ClimaCell before or after the upgrade? If you waited until after the upgrade, the migration should have occurred automatically (ClimaCell would have been removed automatically as well). If it was before, that is odd. I'm pretty sure I tested creation from scratch but I will check again later. I would also log in to the Tomorrow.io site and check your API usage. It sounds like you may have hit your limit, but unclear yet as to why if you are only using the API key in HA.

Intecpsp commented 2 years ago

I removed it afterward since everything was still referencing ClimaCell (integration and entities). I did see that everything should've been migrated for me, but after giving it an hour or so I still saw ClimaCell, so that is when I removed it and tried adding Tomorrow.io.

raman325 commented 2 years ago

I see - did you get a notification? My guess is that you were using a V3 API key for the ClimaCell integration. The Tomorrow.io integration requires a V4 key. You may need to sign up for a V4 key to set it up

Intecpsp commented 2 years ago

I did, that and one saying to give it time for the database upgrade. That's why I checked back after about an hour.

Looking at the Tomorrow.io site, I don't see a specific version tied to my key: Screenshot 2022-04-07 1 58 20 PM How would I know what version it is or how to request a v4 key?

Intecpsp commented 2 years ago

Actually, just noticed that the example below my key is specifying the v4 endpoint

Screenshot 2022-04-07 2 01 27 PM

raman325 commented 2 years ago

got it OK, so it's not an issue with the key. Can you share a screenshot of this page: https://app.tomorrow.io/development/activity

Intecpsp commented 2 years ago

Had to change to 12 hours to show any data and I hovered over the highest point: Screenshot 2022-04-07 2 22 44 PM

raman325 commented 2 years ago

that's odd, especially because you aren't seeing anything in the logs. Let me try this on a clean install later today, maybe part of their API is down? (he hopes because otherwise he is lost 😕 )

Intecpsp commented 2 years ago

Just tried again and got it, not sure what happened other than giving it time

raman325 commented 2 years ago

Sounds like maybe troubles on their end. Regardless glad it's working now!

Intecpsp commented 2 years ago

Not sure if I should open a new issue or stick with this one. Now the integration is down with "Config entry 'Tomorrow.io - Home' for tomorrowio integration not ready yet; Retrying in background".

Home Assistant hasn't been restarted and that log was around 5:56 and I started writing this around 6:03, it still hasn't come back up.

Also, I just tried to restarting Home Assistant and then reloading the integration, but it is refusing to come back up. Screenshot_20220408-060913

goofy7264 commented 2 years ago

I'm also having the issue. I was getting the same retrying in background. I removed the integration and when I try and re-ads it. it now says rate limited. Can't add it again

raman325 commented 2 years ago

please give it a day or two then try again. I looked at the code and I can't see anything obvious internally that would be causing this, and from the screenshot above it doesn't look like @Intecpsp should be rate limited, so my only guess is that something is going on with the Tomorrow.io API, but if it's still a problem after you try again, I will take another look.

Qpernicus commented 2 years ago

I think it's unrelated. But still I have the same issue with the 'can't load Home'. I cleared the log on 2022.04 and then reloaded the integration (auto migrated from climacell)which shows most entities fine btw. Upon reload my log shows only this:

Logger: frontend.js.latest.202204050 Source: components/system_log/init.py:190 First occurred: 07:03:37 (1 occurrences) Last logged: 07:03:37

:0:0 Script error.

Like I said, I think it's unrelated, but thought I post anyway

raman325 commented 2 years ago

Ok that's helpful maybe it has something to do with the zone finding logic. I will look at it again tomorrow

goofy7264 commented 2 years ago

I just tried to re-add the integration again now, and it worked. Seems like it was indeed, at least in my case, a problem on the tomorrow.io side. Will monitor it to see if it continues to function as expected.

Intecpsp commented 2 years ago

Got a new one as of this morning (nothing below the last line even though there is a colon suggesting it): Screenshot_20220409-083750

Integration unavailable as of that log: Screenshot_20220409-083900

goofy7264 commented 2 years ago

Looks like mine stopped work again as well.

image

The logs are not offering much help here

Logger: homeassistant.config_entries Source: config_entries.py:366 First occurred: 08:24:17 (1 occurrences) Last logged: 08:24:17

Config entry 'Tomorrow.io - Home {redacted} for tomorrowio integration not ready yet; Retrying in background

and here is my Tomrrow.io API activity Page

image

raman325 commented 2 years ago

What are your API rate limits? Maybe I've set the max to too high

raman325 commented 2 years ago

I think the max was set too high. Hopefully the next patch release resolves your issue. I will eventually add support for configuring the max amount of calls in options because my account has 1000 calls for free

Intecpsp commented 2 years ago

What are your API rate limits? Maybe I've set the max to too high

How do you check this?

goofy7264 commented 2 years ago

Free Plan ( which I have) is the following limits

Calls 500 /per day 25 /per hour 3 /per second

raman325 commented 2 years ago

https://app.tomorrow.io/home

It tells you available calls on the right

Intecpsp commented 2 years ago

https://app.tomorrow.io/home

It tells you available calls on the right

I have the same as @goofy7264. Funny thing though, I'm currently showing 400/500 for the day and it's only 10 AM... Screen Shot 2022-04-11 at 10 11 44 AM

Also, not sure what happened here (the only thing using this key is HA) Screen Shot 2022-04-11 at 10 12 29 AM

Intecpsp commented 2 years ago

@raman325 was the recent change to send 100 at a time?! Screen Shot 2022-04-11 at 10 40 04 AM

I'm now showing maxed out for the day Screen Shot 2022-04-11 at 10 41 03 AM

raman325 commented 2 years ago

no, I lowered the daily limit from 500 to 100 so calls should have gone down... can you come find me on the HA discord? we may be able to figure this out faster if you can screen share and we can troubleshoot together

goofy7264 commented 2 years ago

I've installed the update and it appears to have fixed the issue. I will monitor as it may not be exactly obvious if it fixed it completely until tomorrow (full 24 hour cycle).

raman325 commented 2 years ago

It may not be the API limit that was causing this issue, it may be the OOM issue - if your HA instance was rebooting regularly because it was OOM it would trigger a call on each restart which would quickly deplete you. In either case, I hope the issue is now resolved 🤞🏾

Qpernicus commented 2 years ago

I just saw another possibly related tomorrow.io alert in my log

Logger: homeassistant.components.tomorrowio Source: helpers/update_coordinator.py:203 Integration: Tomorrow.io (documentation, issues) First occurred: 01:54:42 (1 occurrences) Last logged: 01:54:42

Error requesting Home data: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://api.tomorrow.io/v4/timelines')

raman325 commented 2 years ago

that's not related, the API endpoint must have thrown back something weird. Is anyone still hitting API limit issues?

Intecpsp commented 2 years ago

Is anyone still hitting API limit issues?

I'm staying comfortably under mine now

goofy7264 commented 2 years ago

Everything seems to be working after monitoring for days. The API Activity has gone way down and the Integration hasn't stopped working since the patch.

raman325 commented 2 years ago

excellent, marking this as closed, and I have some in flight work to tie the limits to your actual API limits so that we don't have to keep playing this game

OldShaterhan commented 2 years ago

I just noticed the code change (I'm testing this integration) and even on the https://www.tomorrow.io/weather-api/ the number of limited calls is said to be 500.

raman325 commented 2 years ago

There will be a future update that will get the request limit from the API response headers