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

Yeelight Music Mode Client Quota Exceeded #64884

Closed
alexyao2015 opened this issue Jan 25, 2022 · 2 comments · Fixed by #64891
Closed

Yeelight Music Mode Client Quota Exceeded #64884

alexyao2015 opened this issue Jan 25, 2022 · 2 comments · Fixed by #64891

Comments

@alexyao2015
Copy link
Contributor

The problem

I'm getting client quota exceeded errors with Yeelight in music mode (verified through the web ui as music mode: true).

I created a simple script that calls the light.turn_on service with varying rgb values with a delay of 0.1 seconds between each call. After around 60 calls (same as the default rate limit), an error will be generated with the message "client quota exceeded".

My ESPHome based light under this same test was able to reach several hundred service calls with no issues.

Is there some unspecified rate limit or are the calls to change the light not going through the music mode protocol?

What version of Home Assistant Core has the issue?

2021.12.3

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

Yeelight

Link to integration documentation on our website

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

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/yeelight/light.py", line 250, in _async_wrap
    return await func(self, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/yeelight/light.py", line 648, in async_set_hs
    await self._bulb.async_set_hsv(
  File "/usr/local/lib/python3.9/site-packages/yeelight/aio.py", line 36, in wrapper
    cmd = await self.async_send_command(
  File "/usr/local/lib/python3.9/site-packages/yeelight/aio.py", line 75, in async_send_command
    raise BulbException(response["error"])
yeelight.main.BulbException: {'code': -1, 'message': 'client quota exceeded'}

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1495, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/__init__.py", line 121, in async_handle_turn_service
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/core.py", line 1495, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 209, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 663, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 896, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 700, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 494, in async_handle_light_on_service
    await light.async_turn_on(**filter_turn_on_params(light, params))
  File "/usr/src/homeassistant/homeassistant/components/yeelight/light.py", line 787, in async_turn_on
    await self.async_set_hs(hs_color, duration)
  File "/usr/src/homeassistant/homeassistant/components/yeelight/light.py", line 271, in _async_wrap
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Error when calling async_set_hs for bulb Yeelight Color 0x7de36db at 10.76.19.240: {'code': -1, 'message': 'client quota exceeded'}

Additional information

The script used the web socket api with the following commands in loop with a delay of 0.1 between each command.

{"type": "call_service", "domain": "homeassistant", "service": "turn_on", "service_data": {"rgb_color": [255, 0, 0], "transition": 0.0, "entity_id": "entity_id"}}
{"type": "call_service", "domain": "homeassistant", "service": "turn_on", "service_data": {"rgb_color": [0, 255, 0], "transition": 0.0, "entity_id": "entity_id"}}
{"type": "call_service", "domain": "homeassistant", "service": "turn_on", "service_data": {"rgb_color": [0, 0, 255], "transition": 0.0, "entity_id": "entity_id"}}
@probot-home-assistant
Copy link

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


yeelight documentation
yeelight source
(message by IssueLinks)

@alexyao2015
Copy link
Contributor Author

This appears to be an issue with the async component of the library. Reported issue https://gitlab.com/stavros/python-yeelight/-/issues/73

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.

1 participant