fsaris / home-assistant-awox

AwoX mesh light integration for Home Assistant
MIT License
84 stars 23 forks source link

AwoX mesh became unavailable #117

Open Aljumaili85 opened 1 month ago

Aljumaili85 commented 1 month ago

fresh installed home assistant ( OS 12.4 , Core 2024.7.3) HACS 1.34.0 AwoX MESH control 0.1.6 problem: The lights has been added successfully but the system always shows "AwoX mesh became unavailable" and lights are inactive to turn on/off


2024-07-25 22:13:53.134 ERROR (Thread-32) [root] Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.12/site-packages/pygatt/backends/gatttool/gatttool.py", line 140, in run
    clb(event)
  File "/usr/local/lib/python3.12/site-packages/pygatt/backends/gatttool/gatttool.py", line 550, in _handle_notification_string
    self._connected_device.receive_notification(handle, values)
  File "/usr/local/lib/python3.12/site-packages/pygatt/device.py", line 291, in receive_notification
    callback(handle, value)
  File "/config/custom_components/awox/awoxmeshlight/__init__.py", line 348, in _handleNotification
    self._parseStatusResult(message)
  File "/config/custom_components/awox/awoxmeshlight/__init__.py", line 410, in _parseStatusResult
    self.status_callback(status)
  File "/config/custom_components/awox/awox_mesh.py", line 202, in mesh_status_callback
    self._devices[status['mesh_id']]['callback'](status)
  File "/config/custom_components/awox/light.py", line 272, in status_callback
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1006, in async_write_ha_state
    report_non_thread_safe_operation("async_write_ha_state")
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 225, in report_non_thread_safe_operation
    report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 159, in report
    _report_integration(what, integration_frame, level, error_if_integration)
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 197, in _report_integration
    raise RuntimeError(
RuntimeError: Detected that custom integration 'awox' calls async_write_ha_state from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#async_write_ha_state at custom_components/awox/light.py, line 272: self.async_write_ha_state(). Please report it to the author of the 'awox' custom integration.
2024-07-25 22:13:55.390 INFO (MainThread) [custom_components.awox.awox_mesh] [5AgwanX7] Queue command requestStatus {'dest': 65535, 'withResponse': True}
2024-07-25 22:13:55.392 DEBUG (AwoxMeshCommands-5AgwanX7) [custom_components.awox.awox_mesh] [5AgwanX7] process 0/0 - {'command': 'requestStatus', 'params': {'dest': 65535, 'withResponse': True}, 'callback': <function AwoxMesh._async_add_command_to_queue.<locals>.command_executed at 0x7f6e445da0>, 'allow_to_fail': False}
2024-07-25 22:13:55.394 DEBUG (AwoxMeshCommands-5AgwanX7) [custom_components.awox.awoxmeshlight] [5AgwanX7][a4:c1:38:72:c0:1c] requestStatus(65535)
2024-07-25 22:13:55.397 INFO (AwoxMeshCommands-5AgwanX7) [custom_components.awox.awoxmeshlight] [5AgwanX7][a4:c1:38:72:c0:1c] Writing command 218 data b'\x10'`
fsaris commented 1 month ago

See https://github.com/fsaris/home-assistant-awox/issues/110 I suggest to switch to the esp32 alternative