Yeelight not resposnse

Hi ,
I have 5 new GU10 mono yeelight bulbs (wifi) , I’ve encountered an issue where Home-Assistant stops controlling these bulbs after a few hours of operation. To resolve this, I’ve had to restart the Home Assistant Docker container, but the problem recurs later on. Interestingly, the Yeelight app consistently operates these bulbs without any problems (using LAN control). Additionally, I have 2 other Yeelight bulbs (non-GU10) that work perfectly fine within the same setup.

Any insights on what might be causing this issue would be greatly appreciated.

Thanks!

Thanks

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/yeelight/aio.py", line 101, in async_send_command
    response = await future
               ^^^^^^^^^^^^
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/yeelight/light.py", line 256, in _async_wrap
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/yeelight/light.py", line 628, in async_set_brightness
    await self._bulb.async_set_brightness(
  File "/usr/local/lib/python3.12/site-packages/yeelight/aio.py", line 45, in wrapper
    cmd = await self.async_send_command(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/yeelight/aio.py", line 100, in async_send_command
    async with asyncio_timeout(TIMEOUT):
  File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__
    raise TimeoutError from exc_val
TimeoutError

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 2335, in _run_service_call_catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 2356, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 905, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 628, 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 803, in async_turn_on
    await self.async_set_brightness(brightness, duration)
  File "/usr/src/homeassistant/homeassistant/components/yeelight/light.py", line 262, in _async_wrap
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Timed out when calling async_set_brightness for bulb Yeelight Monob 0x1b409415 at 192.168.0.156: <class 'TimeoutError'>

I’m having a very similar issue. I have 2 Yeelight W1 GU10 Mono bulbs, and also they work fine for a few hours before becoming unresponsive from HA. Mine also are still controllable via the Yeelight app.

I seem to be able to get them working again by opening the Yeelight Integration and using Reload on the integration entries.

My other Yeelight bulbs (Color GU10, and Color E27) are working just fine.

This is what I’m seeing in the logs:

2024-03-15 09:45:25.684 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139854470498240] Timed out when calling _async_turn_on for bulb Yeelight Monob 0x1b184ebc at 192.168.1.43: <class 'TimeoutError'>
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/yeelight/aio.py", line 101, in async_send_command
    response = await future
               ^^^^^^^^^^^^
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/yeelight/light.py", line 256, in _async_wrap
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/yeelight/light.py", line 775, in _async_turn_on
    await self._bulb.async_turn_on(
  File "/usr/local/lib/python3.12/site-packages/yeelight/aio.py", line 45, in wrapper
    cmd = await self.async_send_command(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/yeelight/aio.py", line 100, in async_send_command
    async with asyncio_timeout(TIMEOUT):
  File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__
    raise TimeoutError from exc_val
TimeoutError

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 239, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2319, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2356, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 905, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 628, 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 795, in async_turn_on
    await self._async_turn_on(duration)
  File "/usr/src/homeassistant/homeassistant/components/yeelight/light.py", line 262, in _async_wrap
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Timed out when calling _async_turn_on for bulb Yeelight Monob 0x1b184ebc at 192.168.1.43: <class 'TimeoutError'>
2024-03-15 09:46:41.735 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139854470498240] Error when calling _async_turn_on for bulb Yeelight Monob 0x1b184ebc at 192.168.1.43: The write socket is closed
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/yeelight/light.py", line 256, in _async_wrap
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/yeelight/light.py", line 775, in _async_turn_on
    await self._bulb.async_turn_on(
  File "/usr/local/lib/python3.12/site-packages/yeelight/aio.py", line 45, in wrapper
    cmd = await self.async_send_command(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/yeelight/aio.py", line 99, in async_send_command
    future = await self._async_send_command(method, params)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/yeelight/aio.py", line 127, in _async_send_command
    raise BulbException("The write socket is closed")
yeelight.main.BulbException: The write socket is closed

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 239, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2319, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2356, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 905, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 628, 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 795, in async_turn_on
    await self._async_turn_on(duration)
  File "/usr/src/homeassistant/homeassistant/components/yeelight/light.py", line 276, in _async_wrap
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Error when calling _async_turn_on for bulb Yeelight Monob 0x1b184ebc at 192.168.1.43: The write socket is closed
1 Like

Actually - I’ve just figured out a way to trigger the issue:

  1. Bulb is working OK, I can turn off/on fine.
  2. Open Developer tools - Services, and set the following:
    a. Service: Yeelight: Set mode
    b. Targets: Choose entity - Bedroom Right (the name I gave my bulb)
    c. Mode: Moonlight
  3. Select CALL SERVICE
  4. Bulb is now unresponsive
  5. Go to Yeelight Integration, and Reload the integration entry for the bulb
  6. Bulb is now working OK again

I’ve repeated this a couple times and seems to recreate the issue every time.

I enabled debug logging on the Yeelight integration whilst I ran through the above steps, however the resulting log (just under 850KB) is too large to fit in the body. Not sure if there is a way I can attach files here.

1 Like

someone can help please?

1 Like