AlexxIT / XiaomiGateway3

Home Assistant custom component for control Xiaomi Multimode Gateway (aka Gateway 3), Xiaomi Multimode Gateway 2, Aqara Hub E1 on default firmwares over LAN
https://github.com/AlexxIT/Blog
MIT License
2.48k stars 349 forks source link

Lights opened itself constantly #1345

Closed wz69699 closed 6 months ago

wz69699 commented 6 months ago

I see the issue ‘Bluetooth mesh does not get the status correctly #1335’. The conversation mentioned the adaptive-lighting integration.   I also use the adaptive-lighting integration. Here's my issue: During my trip, I found my mesh-group light (I got only one mesh group) opened itself constantly. I'm sure the open status is correct because I can see the light through the camera. And my mom asked me what happened to the 3 lights.   The mesh-group(筒灯) includes 3 lights, which is 筒灯1,筒灯2 and 筒灯3. All 4 entities are added to gateway3, and only 1 entity(the mesh group) is added to Homekit Bridge and adaptive-lighting.   By the way, the gateway3 version is 4.0.5.

home-assistant_xiaomi_gateway3_2024-05-04T15-05-19.456Z.log

1 2 3 4 5 6 7
wz69699 commented 6 months ago

Device information: 3 same lights Mesh: YLTS02YL/YLTS04YL, yeelink.light.ml1

wz69699 commented 6 months ago

it happened again. Here's the log.

Is the issue caused by xiaomi_miot? My ha's Core version is 2024.5.0 currently (The latest is 5.1) .

日志: homeassistant.core
来源: core.py:2758
首次发生: 2024年5月3日 08:15:11 (136 全部发生)
上次记录: 02:28:36

Error executing service: <ServiceCall light.turn_on (c:01HX2DFWF0:al:5CD2:ntrv:H3): entity_id=['light.yeelink_ceil26_2404_light'], params=transition=45.0, brightness=3, color_temp=370, color_temp_kelvin=2702>
Error executing service: <ServiceCall light.turn_on (c:01HX2DJMV7:al:5CD2:ntrv:H4): entity_id=['light.yeelink_ceil26_2404_light'], params=transition=45.0, brightness=3, color_temp=370, color_temp_kelvin=2702>
Error executing service: <ServiceCall light.turn_on (c:01HX2DND7F:al:5CD2:ntrv:H5): entity_id=['light.yeelink_ceil26_2404_light'], params=transition=45.0, brightness=3, color_temp=370, color_temp_kelvin=2702>
Error executing service: <ServiceCall light.turn_on (c:01HX2DR5KM:al:5CD2:ntrv:H6): entity_id=['light.yeelink_ceil26_2404_light'], params=transition=45.0, brightness=3, color_temp=370, color_temp_kelvin=2702>
Error executing service: <ServiceCall light.turn_on (c:01HX2DTXZT:al:5CD2:ntrv:H8): entity_id=['light.yeelink_ceil26_2404_light'], params=transition=45.0, brightness=3, color_temp=370, color_temp_kelvin=2702>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 2758, in _run_service_call_catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1047, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 627, in async_handle_light_on_service
    await light.async_turn_on(**filter_turn_on_params(light, params))
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1680, in async_turn_on
    await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_miot/light.py", line 187, in turn_on
    ret = self.send_miio_command('set_bright', [val, 'smooth', trs])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_miot/__init__.py", line 1340, in send_miio_command
    return super().send_miio_command(method, params, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_miot/__init__.py", line 989, in send_miio_command
    self.hass.bus.async_fire(f'{DOMAIN}.send_miio_command', {
  File "/usr/src/homeassistant/homeassistant/core.py", line 1508, in async_fire
    self._hass.verify_event_loop_thread("async_fire")
  File "/usr/src/homeassistant/homeassistant/core.py", line 440, in verify_event_loop_thread
    frame.report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 162, in report
    _report_integration(what, integration_frame, level, error_if_integration)
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 203, in _report_integration
    raise RuntimeError(
RuntimeError: Detected that custom integration 'xiaomi_miot' calls async_fire from a thread at custom_components/xiaomi_miot/__init__.py, line 989: self.hass.bus.async_fire(f'{DOMAIN}.send_miio_command', {. Please report it to the author of the 'xiaomi_miot' custom integration.

日志: homeassistant.helpers.frame
来源: helpers/frame.py:190
首次发生: 2024年5月3日 02:44:23 (143 全部发生)
上次记录: 02:28:36

Detected that custom integration 'xiaomi_miot' accesses hass.helpers.service. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from service directly at custom_components/xiaomi_miot/__init__.py, line 560: hass.helpers.service.async_register_admin_service(, please create a bug report at https://github.com/al-one/hass-xiaomi-miot/issues
Detected that custom integration 'hacs' accesses hass.helpers.event. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from event directly at custom_components/hacs/base.py, line 642: self.hass.helpers.event.async_track_time_interval(, please create a bug report at https://github.com/hacs/integration/issues
Detected that custom integration 'xiaomi_miot' calls async_fire from a thread at custom_components/xiaomi_miot/__init__.py, line 989: self.hass.bus.async_fire(f'{DOMAIN}.send_miio_command', {, please report it to the author of the 'xiaomi_miot' custom integration
Detected that custom integration 'adaptive_lighting' accesses hass.helpers.entity_component. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from entity_component directly at custom_components/adaptive_lighting/switch.py, line 2471: await self.hass.helpers.entity_component.async_update_entity(light), please create a bug report at https://github.com/basnijholt/adaptive-lighting/issues
Detected that custom integration 'xiaomi_miot' calls async_write_ha_state from a thread at custom_components/xiaomi_miot/__init__.py, line 1906: self.async_write_ha_state(), please report it to the author of the 'xiaomi_miot' custom integration
8 9
AlexxIT commented 6 months ago
  1. There is nothing in your logs about this component
  2. Your error about the component xiaomi_miot
  3. Your screenshots are useless because I don't understand your language
wz69699 commented 6 months ago

My mesh-group (light1, light2 and light3) just turned on by itself. I screenshotted the log and translated it. I'm pretty sure the translation is correct (I checked it 3 times).It says 'triggered by service'. what service indeed? What service may it be?

I did not add this mesh-group (light1, light2 and light3) into xiaomi_miot. In my understanding, the issue can't be caused by xiaomi_miot.

And I only add the group into Gateway3. (I did not add light1, light2 or light3 into Gateway3)

x

I'm really confused.

home-assistant_adaptive_lighting_2024-05-05T15-57-19.654Z.log home-assistant_xiaomi_gateway3_2024-05-05T15-59-21.613Z.log