core icon indicating copy to clipboard operation
core copied to clipboard

Error when calling async_set_default for bulb Yeelight Ceiling3 0x7e790fa at xxx.xxx.xxx.xxx: {'code': -5006, 'message': 'illegal request'}

Open alexsudakov opened this issue 2 years ago • 3 comments

The problem

If i use SERVICE LIGHT.TURN_ON with Service data attribute "brightness_pct", alias: wakeup sequence:

  • service: light.turn_on data: color_name: red brightness_pct: 20 target: entity_id: light.yeelight_ceiling3_0x7e790fa

i get an error:

What version of Home Assistant Core has the issue?

10.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

yeelight

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

alias: wakeup
sequence:
  - service: light.turn_on
    data:
      color_name: red
      brightness_pct: 20
    target:
      entity_id: light.yeelight_ceiling3_0x7e790fa

Anything in the logs that might be useful for us?

Logger: homeassistant.components.websocket_api.http.connection
Source: components/yeelight/light.py:265
Integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 15:07:13 (1 occurrences)
Last logged: 15:07:13

[547729310768] Error when calling async_set_default for bulb Yeelight Ceiling3 0x7e790fa at xxx.xxx.xxx.xxx: {'code': -5006, 'message': 'illegal request'}
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/yeelight/light.py", line 245, in _async_wrap
    return await func(self, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/yeelight/light.py", line 704, in async_set_default
    await self._bulb.async_set_default()
  File "/usr/local/lib/python3.10/site-packages/yeelight/aio.py", line 38, in wrapper
    cmd = await self.async_send_command(
  File "/usr/local/lib/python3.10/site-packages/yeelight/aio.py", line 96, in async_send_command
    raise BulbException(response["error"])
yeelight.main.BulbException: {'code': -5006, 'message': 'illegal request'}

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 199, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1849, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1889, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 474, in _service_handler
    await self.async_turn_on(variables=service.data, context=service.context)
  File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 433, in async_turn_on
    await coro
  File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 463, in _async_run
    return await self.script.async_run(script_vars, context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1533, in async_run
    await asyncio.shield(run.async_run())
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 410, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 454, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 477, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 452, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1849, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1889, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 226, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 798, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 980, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 838, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 582, 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 802, in async_turn_on
    await self.async_set_default()
  File "/usr/src/homeassistant/homeassistant/components/yeelight/light.py", line 265, in _async_wrap
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Error when calling async_set_default for bulb Yeelight Ceiling3 0x7e790fa at xxx.xxx.xxx.xxx: {'code': -5006, 'message': 'illegal request'}

Additional information

No response

alexsudakov avatar Jun 05 '23 12:06 alexsudakov

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (websocket_api) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of websocket_api 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 websocket_api Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


websocket_api documentation websocket_api source (message by IssueLinks)

home-assistant[bot] avatar Jun 05 '23 12:06 home-assistant[bot]

Hey there @zewelor, @shenxn, @starkillerog, @alexyao2015, 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!

Code owner commands

Code owners of yeelight 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 yeelight Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


yeelight documentation yeelight source (message by IssueLinks)

home-assistant[bot] avatar Jun 05 '23 12:06 home-assistant[bot]

No, the problem is in Yeelight integration. With another lamp (xiaomi) no problem

alexsudakov avatar Jun 05 '23 12:06 alexsudakov

up

alexsudakov avatar Jun 14 '23 11:06 alexsudakov

I have the same problem since (I think) the last HomeAssistant Update to 2023.8.0

DerEichler avatar Aug 06 '23 19:08 DerEichler

same think

PskNorz avatar Aug 10 '23 19:08 PskNorz

It seems that this occurs only when you specify brightness level.

airmonitor avatar Aug 12 '23 15:08 airmonitor

Same problem =(

samplec0de avatar Sep 10 '23 19:09 samplec0de

Same problem =(

I fix it by turn off those settings from mihome DA0DB4BC-C39E-415F-90AF-AAA90A491D02

PskNorz avatar Sep 10 '23 19:09 PskNorz

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.