fmartinou / tydom2mqtt

Deltadore Tydom to MQTT Bridge
https://fmartinou.github.io/tydom2mqtt/
MIT License
86 stars 49 forks source link

tydom2mqtt 3.4.1 - ERROR - Task exception was never retrieved #133

Closed foux44 closed 9 months ago

foux44 commented 10 months ago

Bonjour,

Depuis la dernière mise à jour de début septembre, j'ai une erreur du type" ERROR - Task exception was never retrieved" qui ne me permet plus le control des modules via tydom2mqtt .

Ci après le journal juste après un appuie sur la descente de volet roulant:

2023-09-04 20:46:38,856 - gmqtt.mqtt.handler - DEBUG - [CMD 0x30] b'\x00.cover/tydom/1605379537_1605379537/set_position\x0045' 2023-09-04 20:46:38,856 - gmqtt.mqtt.handler - DEBUG - [RECV cover/tydom/1605379537_1605379537/set_position with QoS: 0] b'\x0045' 2023-09-04 20:46:38,856 - gmqtt.mqtt.utils - DEBUG - FREE MID: None 2023-09-04 20:46:38,856 - mqtt.MqttClient - INFO - set_position message received (topic=cover/tydom/1605379537_1605379537/set_position, message=45) 2023-09-04 20:46:38,856 - sensors.Cover - INFO - 1605379537 position 45 2023-09-04 20:46:38,856 - tydom.TydomClient - DEBUG - Sending message to tydom (PUT devices data [{"name":"position","value":"45"}]) 2023-09-04 20:46:38,856 - asyncio - ERROR - Task exception was never retrieved future: <Task finished name='Task-67' coro=<MqttClient.on_message() done, defined at /app/mqtt/MqttClient.py:77> exception=AttributeError("'NoneType' object has no attribute 'send'")> Traceback (most recent call last): File "/app/mqtt/MqttClient.py", line 143, in on_message await Cover.put_position(tydom_client=self.tydom, device_id=device_id, cover_id=endpoint_id, position=str(value)) File "/app/sensors/Cover.py", line 114, in put_position await tydom_client.put_devices_data(device_id, cover_id, 'position', position) File "/app/tydom/TydomClient.py", line 263, in put_devices_data await self.connection.send(a_bytes) ^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'send' 2023-09-04 20:46:43,672 - gmqtt.client - DEBUG - [QoS query IS EMPTY] 2023-09-04 20:46:48,672 - gmqtt.client - DEBUG - [QoS query IS EMPTY] 2023-09-04 20:46:53,675 - gmqtt.client - DEBUG - [QoS query IS EMPTY] 2023-09-04 20:46:58,676 - gmqtt.client - DEBUG - [QoS query IS EMPTY] 2023-09-04 20:47:03,678 - gmqtt.client - DEBUG - [QoS query IS EMPTY] 2023-09-04 20:47:08,683 - gmqtt.client - DEBUG - [QoS query IS EMPTY]

Merci d'avance pour tout début d'explication, Un reboot du Tydom 1.0 ou de HA n'a rien changé ...

fcollonval commented 9 months ago

Hey

I'm facing a similar problem. I can no longer control my shutters through HA.

2023-09-10 14:19:40,952 - mqtt.MqttClient      - INFO    - set_positionCmd message received (topic=cover/tydom/3_0/set_positionCmd, message=UP)
2023-09-10 14:19:40,955 - sensors.Cover        - INFO    - 0 positionCmd UP
2023-09-10 14:19:40,957 - asyncio              - ERROR   - Task exception was never retrieved
future: <Task finished name='Task-19421' coro=<MqttClient.on_message() done, defined at /app/mqtt/MqttClient.py:77> exception=ConnectionClosedError(None, None, None)>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 959, in transfer_data
    message = await self.read_message()
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 1029, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 1104, in read_data_frame
    frame = await self.read_frame(max_size)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 1161, in read_frame
    frame = await Frame.read(
            ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/websockets/legacy/framing.py", line 68, in read
    data = await reader(2)
           ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/streams.py", line 733, in readexactly
    await self._wait_for_data('readexactly')
  File "/usr/local/lib/python3.11/asyncio/streams.py", line 526, in _wait_for_data
    await self._waiter
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 970, in _read_ready__get_buffer
    nbytes = self._sock.recv_into(buf)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
ConnectionResetError: [Errno 104] Connection reset by peer
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/app/mqtt/MqttClient.py", line 131, in on_message
    await Cover.put_positionCmd(tydom_client=self.tydom, device_id=device_id, cover_id=endpoint_id,
  File "/app/sensors/Cover.py", line 124, in put_positionCmd
    await tydom_client.put_devices_data(device_id, cover_id, 'positionCmd', positionCmd)
  File "/app/tydom/TydomClient.py", line 263, in put_devices_data
    await self.connection.send(a_bytes)
  File "/usr/local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 635, in send
    await self.ensure_open()
  File "/usr/local/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 935, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: no close frame received or sent

Versions

foux44 commented 9 months ago

On my side, the solution was simple: check your TYDOM IP, mine has changed because of dynamic DHCP ... Once moved to a static IP, a HA reboot and was working again.

fcollonval commented 9 months ago

Thanks @foux44 for your fix - I force static IP on my side. But I solved the issue by uninstalling and reinstalling the add-on.

fmartinou commented 9 months ago

Hi,

Sorry for replying so late...

I'm glad to see you've sorted it out; can I close the issue?

fcollonval commented 9 months ago

can I close the issue?

For me yes