LaggAt / hacs-govee

A HACS repository for Govee light integration
MIT License
272 stars 63 forks source link

Integration not working, configuring error: object has no attribute 'rate_limit_delay' #172

Open KitHubek opened 2 months ago

KitHubek commented 2 months ago

Configuration stopped working at all. Have 2 devices (H605C and H6067) and all not working. Configuration error. Devices working ok via Govee app.

Version of the custom_component 2023.11.1

Logs:

Rejestrator: custom_components.govee
Źródło: custom_components/govee/__init__.py:66
integracja: Govee (dokumentacja, Problemy)
Pierwsze zdarzenie: 21:54:59 (5 zdarzenia)
Ostatnio zalogowany: 22:45:58

Could not connect to Govee API: API: API-Error 500: {"message":"service is busy please try again later","status":500}

AND

Rejestrator: homeassistant.config_entries
Źródło: config_entries.py:604
Pierwsze zdarzenie: 21:54:59 (5 zdarzenia)
Ostatnio zalogowany: 22:45:58

Error setting up entry govee for govee
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/govee/__init__.py", line 67, in async_setup_entry
    await hub.rate_limit_delay()
          ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Govee' object has no attribute 'rate_limit_delay'. Did you mean: 'rate_limit_reset'?
masanjose21 commented 2 months ago

Having the same issue just now but also noticed an earlier warning in the logs:

Logger: custom_components.govee
Source: custom_components/govee/__init__.py:72
integration: Govee ([documentation](https://github.com/LaggAt/hacs-govee/blob/master/README.md), [issues](https://github.com/LaggAt/hacs-govee/issues))
First occurred: 5:45:30 PM (1 occurrences)
Last logged: 5:45:30 PM

Could not connect to Govee API: API: API-Error 500: {"message":"service is busy please try again later","status":500}

Could it be service related?

remipregh commented 2 months ago

Same issue for me. After a bit of digging and looking at the Govee API doc, I think it's an issue with the API service rather than the integration. Let's hope it gets resolved tomorrow!

nerotrobe commented 2 months ago

I'm seeing the above issue as well, the intergration isn't working. But I'm also seeing this message in my logs:

2024-09-16 18:44:56.456 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to load_verify_locations with args (<ssl.SSLContext object at 0x7f8dee1550>, '/usr/local/lib/python3.12/site-packages/certifi/cacert.pem', None, None) inside the event loop by custom integration 'govee' at custom_components/govee/__init__.py, line 53: hub = await Govee.create( (offender: /usr/local/lib/python3.12/ssl.py, line 708: context.load_verify_locations(cafile, capath, cadata)), please create a bug report at https://github.com/LaggAt/hacs-govee/issues

hfbauman commented 2 months ago

I'm also seeing this issue. I tried deleting and re-adding the integration and I get the message that Cannot connect. Is the API-Key correct and the internet connection working?

mukul-k commented 2 months ago

Same issues for me after updating to 2024.9.2

frankandsoo commented 2 months ago

Same issue for me after a restart earlier today.

talormanda commented 2 months ago

Same / broken for me and govee2mqtt too.

2024-09-16 23:25:59.559 WARNING (MainThread) [custom_components.govee] Could not connect to Govee API: API: API-Error 500: {"message":"service is busy please try again later","status":500}

thomast1906 commented 2 months ago

Yeah same here :(

INVADIA666 commented 2 months ago

Same for me after updating to 9.2 , it was working perfectly fine before .

eyesonly09 commented 2 months ago

This is happening to me on 9.1, it might not be related to the HA version but to Govee's service.

ramorimdias commented 2 months ago

Same issue here, stopped working tonight on its own, didn't update anything on HA. Must be Govee related.

ml0renz0 commented 2 months ago

Same here, changed nothing on my HA config. I also think it has to be something related to changes on Govee API service.

I tried removing and reinstalling the integration but it fails:

Screenshot_20240917-095656.png

inertia666 commented 2 months ago

Yes same here. I emailed govee asking if my API key had expired. No reply yet so i am sure it will get sorted.

cepheid-variable commented 2 months ago

Glad to see it's not just me. I always assume something wrong at my end and have to stop myself diving right in, reinstalling integrations etc.

AttributeError: 'Govee' object has no attribute 'rate_limit_delay'. Did you mean: 'rate_limit_reset'?

Was working up until about 12 hours ago!

inertia666 commented 2 months ago

Glad to see it's not just me. I always assume something wrong at my end and have to stop myself diving right in, reinstalling integrations etc.

AttributeError: 'Govee' object has no attribute 'rate_limit_delay'. Did you mean: 'rate_limit_reset'?

Was working up until about 12 hours ago!

tell me about it...spent like an hour trying to sort it-

inertia666 commented 2 months ago

It's actually really annoying a tv backlight requires an internet connection to work or bluetooth when most other Govee lights have a LAN api.

cepheid-variable commented 2 months ago

It's actually really annoying a tv backlight requires an internet connection to work or bluetooth when most other Govee lights have a LAN api.

Mistakes were made when I picked these lights... Lesson learned :)

beanboyrjs commented 2 months ago

Just to add to the discussion, it seems I am having a similar issue with the Govee Controller plugin for my Stream Deck. It is starting to feel more and more like a Govee "issue".

beanboyrjs commented 2 months ago

govee2mqtt seems to work beautifully! I might be switching to that Add-On now.

ItsMeNJC commented 2 months ago

I’m having the same issue with my Govee devices. IMG_0048

ml0renz0 commented 2 months ago

govee2mqtt seems to work beautifully! I might be switching to that Add-On now.

I did, and now the devices that can be controlled through Local API (LAN) do not have that annoying 2 seconds delay.

This issue made me re-evaluate gove2mqtt and, for me, local API is better than anything else.

cepheid-variable commented 2 months ago

While I'm here and keeping an eye on this thread, I have a 5m led strip running up the skirting on my stairs. I control it via home assistant and an aqara zigbee motion sensor, currently using the dreaded govee api. Can anyone recommend a replacement strip that uses the local api? thanks!

ml0renz0 commented 2 months ago

While I'm here and keeping an eye on this thread, I have a 5m led strip running up the skirting on my stairs. I control it via home assistant and an aqara zigbee motion sensor, currently using the dreaded govee api. Can anyone recommend a replacement strip that uses the local api? thanks!

These Govee devices have Local API (needs to be enabled first in govee configuration) and can be used with govee2mqtt integration.

Maybe you are lucky and just need to upgrade firmware and enable Local API...

ItsMeNJC commented 2 months ago

While I'm here and keeping an eye on this thread, I have a 5m led strip running up the skirting on my stairs. I control it via home assistant and an aqara zigbee motion sensor, currently using the dreaded govee api. Can anyone recommend a replacement strip that uses the local api? thanks!

If you’re buying new, buy one of their Matter enabled strips. I have the Neon Rope Light (H61A2) that supports local api. They have recently released the second gen of this, so I assume it will also have local api.

KitHubek commented 2 months ago

i just migrated to https://github.com/wez/govee2mqtt and all working ok. Last release of this govee inytergration was Nov 19, 2023. looking at the reported problems here to anyone I suggest switching to the mentioned repo to keep the devices running in HA.

wwelles commented 2 months ago

Same problem, also having success with govee2mqtt that I already had it setup before.

chadpatt commented 2 months ago

I have a lot of experience with python. I almost 100% guarantee that the issue is an underly module in either home core or a pip package that has been updated. I took their API examples and it works perfectly using them to call the external API using the API-Key. So, not key and not Govee API. Not really sure how to get into the home core for debugging, but will keep looking.

Biggiz commented 2 months ago

Same here. I‘ll try this local api thing tomorrow

WinesProof commented 2 months ago

@chadpatt , were you using the v2.0 API or the v1.0 one? I tried a python request to get devices using the v1.0 one (https://openapi.api.govee.com), and it succeeded, but the v2.0 one (https://developer-api.govee.com) returned {"message":"service` is busy please try again later","status":500}

kmercer6 commented 2 months ago

Sadly only 1 of my 5 Govee products support local API. https://www.home-assistant.io/integrations/govee_light_local/

chadpatt commented 2 months ago

@WinesProof , Here is what I tested with to get details. And then toggled on/off light with the second curl command.

Get curl -X GET "https://openapi.api.govee.com/router/api/v1/user/devices" -H "Content-Type: application/json" -H "Govee-API-Key: xxxxx"

Post curl -X POST "https://openapi.api.govee.com/router/api/v1/device/control" \ -H "Content-Type: application/json" \ -H "Govee-API-Key: xxxxxxx" \ -d '{ "requestId": "uuid", "payload": { "sku": "H6054", "device": "E7:D2:A4:xx:xx:xx:xx", "capability": { "type": "devices.capabilities.on_off", "instance": "powerSwitch", "value": 0 } } }'

WinesProof, I agree that with ya. Not sure where in the code yet. Never have messed with the internals. I just got home and am starting to dig into it tho.

Bing, here it is. https://github.com/LaggAt/hacs-govee/blob/52d3bc04b6e8bc253c20779f572fef695984e548/.git-subtree/python-govee-api/govee_api_laggat/api.py#L15

WinesProof commented 2 months ago

That's the v1 API. Try the v2 one, and you'll see the 500 error we're all getting

On Tue, Sep 17, 2024, 3:15 PM chadpatt @.***> wrote:

@WinesProof https://github.com/WinesProof , Here is what I tested with to get details. And then toggled on/off light with the second curl command.

Get curl -X GET "https://openapi.api.govee.com/router/api/v1/user/devices" -H "Content-Type: application/json" -H "Govee-API-Key: xxxxx"

Post curl -X POST "https://openapi.api.govee.com/router/api/v1/device/control" -H "Content-Type: application/json" -H "Govee-API-Key: xxxxxxx" -d '{ "requestId": "uuid", "payload": { "sku": "H6054", "device": "E7:D2:A4:xx:xx:xx:xx", "capability": { "type": "devices.capabilities.on_off", "instance": "powerSwitch", "value": 0 } } }'

— Reply to this email directly, view it on GitHub https://github.com/LaggAt/hacs-govee/issues/172#issuecomment-2357028849, or unsubscribe https://github.com/notifications/unsubscribe-auth/BDWG2QYFQR25FFZ6PFOKOMDZXCSYXAVCNFSM6AAAAABOKCWKNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJXGAZDQOBUHE . You are receiving this because you were mentioned.Message ID: @.***>

jeromelmd commented 2 months ago

Same here, changed nothing on my HA config. I also think it has to be something related to changes on Govee API service.

I tried removing and reinstalling the integration but it fails:

Screenshot_20240917-095656.png

Having this same issue

accordxtc commented 2 months ago

Add me to the list of poor souls with non Lan Control devices to this list. It's not Govee even sells a bulb that does Lan Control to upgrade to

innovatorgit commented 2 months ago

+1

irislich commented 2 months ago

Same here, I spent a few hours troubleshooting before coming here.

mafmafmafmaf commented 2 months ago

Fwiw, it's just self-corrected for me. After updating to 9.2 (could be coincidence), I went 2 days with the api error, and now it came back to normal, after just another reload of the integration.

hfbauman commented 2 months ago

@mafmafmafmaf thanks for saying something, I just checked and I was able to add it back. I wonder if everyone updating/restarting at the same time was enough to overwhelm the server.

kmercer6 commented 2 months ago

Mine is also good once again after the reload. Thanks for the update back in business

challgren commented 2 months ago

Just reloaded mine and it works now!

inertia666 commented 2 months ago

govee2mqtt seems to work beautifully! I might be switching to that Add-On now.

I did, and now the devices that can be controlled through Local API (LAN) do not have that annoying 2 seconds delay.

This issue made me re-evaluate gove2mqtt and, for me, local API is better than anything else.

It also works with non local api devices. I have also moved to this project.

inertia666 commented 2 months ago

Fwiw, it's just self-corrected for me. After updating to 9.2 (could be coincidence), I went 2 days with the api error, and now it came back to normal, after just another reload of the integration.

I got a mail back from Govee apologising that their server was down.

frosthal commented 2 months ago

I have no updated anything and just reloading today the integration solved the problem. Tonight this action didn't solved the problem.

cepheid-variable commented 2 months ago

Back to relying on external servers we go! I'm looking at the Aqara T1 to replace my stairs lights and this is the kick up the backside I needed. Cheers everyone.

James62370 commented 2 months ago

Seems to be working again, I didn't make any changes so was probably something on their server end.

wwelles commented 2 months ago

Same here, working today.

TobiTenno commented 1 month ago

I'm seeing this pretty constantly with the same error as others. Can we make the change ourselves? This feels like the library changed and the integration didn't update?

Logger: homeassistant.config_entries
Source: config_entries.py:594
First occurred: 08:52:58 (2 occurrences)
Last logged: 08:53:35

Error setting up entry govee for govee
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/govee/__init__.py", line 67, in async_setup_entry
    await hub.rate_limit_delay()
          ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Govee' object has no attribute 'rate_limit_delay'. Did you mean: 'rate_limit_reset'?
philharmonie commented 1 month ago

I'm seeing this pretty constantly with the same error as others. Can we make the change ourselves? This feels like the library changed and the integration didn't update?

Logger: homeassistant.config_entries
Source: config_entries.py:594
First occurred: 08:52:58 (2 occurrences)
Last logged: 08:53:35

Error setting up entry govee for govee
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/govee/__init__.py", line 67, in async_setup_entry
    await hub.rate_limit_delay()
          ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Govee' object has no attribute 'rate_limit_delay'. Did you mean: 'rate_limit_reset'?

Im getting the exact Same error