TheNoctambulist / hass-airtouch

Home Assistant integration for the Polyaire AirTouch AC Controllers
MIT License
16 stars 1 forks source link

Latest Update of Airtouch 5 breaks api? #4

Closed codeghari closed 3 months ago

codeghari commented 3 months ago

System Health details

Logger: pyairtouch.comms.socket Source: .local/lib/python3.12/site-packages/pyairtouch/at5/comms/xC023_ac_status.py:230 First occurred: 8:30:05 PM (11741 occurrences) Last logged: 9:23:35 PM

Error decoding bytes: 55 55 55 ab 00 00 00 22 00 22 55 55 55 aa b0 80 92 c0 00 16 23 00 00 00 00 0e 00 01 00 14 a0 c1 0a b7 00 00 d0 00 e2 bc 00 00 0c 60 Error decoding bytes: 55 55 55 ab 00 00 00 22 00 22 55 55 55 aa b0 80 94 c0 00 16 23 00 00 00 00 0e 00 01 00 14 a0 c1 0a b7 00 00 d0 00 e2 bc 00 00 8c 76 Error decoding bytes: 55 55 55 ab 00 00 00 22 00 22 55 55 55 aa b0 80 96 c0 00 16 23 00 00 00 00 0e 00 01 00 14 a0 c1 0a b7 00 00 d0 00 e2 bc 00 00 33 85 Error decoding bytes: 55 55 55 ab 00 00 00 22 00 22 55 55 55 aa b0 80 98 c0 00 16 23 00 00 00 00 0e 00 01 00 14 a0 c1 0a b7 00 00 d0 00 e2 bc 00 00 cc 59 Error decoding bytes: 55 55 55 ab 00 00 00 22 00 22 55 55 55 aa b0 80 9a c0 00 16 23 00 00 00 00 0e 00 01 00 14 a0 c1 0a b7 00 00 d0 00 e2 bc 00 00 73 aa Traceback (most recent call last): File "/config/.local/lib/python3.12/site-packages/pyairtouch/comms/socket.py", line 416, in _read_one_message message_result = message_decoder.decode(message_buffer, header) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/.local/lib/python3.12/site-packages/pyairtouch/at5/comms/xC0_ctrl_status.py", line 211, in decode sub_message_result = sub_message_decoder.decode( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/.local/lib/python3.12/site-packages/pyairtouch/at5/comms/xC023_ac_status.py", line 230, in decode raise comms.DecodeError( pyairtouch.comms.DecodeError: Header repeat_length (14) != AC Status Data size (10)

Checklist

Describe the issue

It appears that the latest update of Airtouch (released yesterday) has broken the integration.

Both the "official" integration and this custom one you developed seem to be unable to connect.

When either integration is attempting to connect, it looks like the console gets flooded with requests and stops working correctly until the attempts are stopped from home assistant.

Mobile app also stops working when the integrations are trying to connect (and failing).

Happy to help you with anything and a fair warning to anyone not to update to latest 😅

Reproduction steps

  1. Be on latest console update for airtouch 5
  2. This should be service version 1.7 and console 1.2
  3. integrations stop working and break Airtouch console and mobile applications while they are polling

Debug logs

Logger: pyairtouch.comms.socket
Source: .local/lib/python3.12/site-packages/pyairtouch/at5/comms/xC023_ac_status.py:230
First occurred: 8:30:05 PM (11741 occurrences)
Last logged: 9:23:35 PM

Error decoding bytes: 55 55 55 ab 00 00 00 22 00 22 55 55 55 aa b0 80 92 c0 00 16 23 00 00 00 00 0e 00 01 00 14 a0 c1 0a b7 00 00 d0 00 e2 bc 00 00 0c 60
Error decoding bytes: 55 55 55 ab 00 00 00 22 00 22 55 55 55 aa b0 80 94 c0 00 16 23 00 00 00 00 0e 00 01 00 14 a0 c1 0a b7 00 00 d0 00 e2 bc 00 00 8c 76
Error decoding bytes: 55 55 55 ab 00 00 00 22 00 22 55 55 55 aa b0 80 96 c0 00 16 23 00 00 00 00 0e 00 01 00 14 a0 c1 0a b7 00 00 d0 00 e2 bc 00 00 33 85
Error decoding bytes: 55 55 55 ab 00 00 00 22 00 22 55 55 55 aa b0 80 98 c0 00 16 23 00 00 00 00 0e 00 01 00 14 a0 c1 0a b7 00 00 d0 00 e2 bc 00 00 cc 59
Error decoding bytes: 55 55 55 ab 00 00 00 22 00 22 55 55 55 aa b0 80 9a c0 00 16 23 00 00 00 00 0e 00 01 00 14 a0 c1 0a b7 00 00 d0 00 e2 bc 00 00 73 aa
Traceback (most recent call last):
  File "/config/.local/lib/python3.12/site-packages/pyairtouch/comms/socket.py", line 416, in _read_one_message
    message_result = message_decoder.decode(message_buffer, header)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/.local/lib/python3.12/site-packages/pyairtouch/at5/comms/xC0_ctrl_status.py", line 211, in decode
    sub_message_result = sub_message_decoder.decode(
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/.local/lib/python3.12/site-packages/pyairtouch/at5/comms/xC023_ac_status.py", line 230, in decode
    raise comms.DecodeError(
pyairtouch.comms.DecodeError: Header repeat_length (14) != AC Status Data size (10)
codeghari commented 3 months ago

Logger: homeassistant Source: runner.py:148 First occurred: 8:29:59 PM (56 occurrences) Last logged: 9:25:29 PM

Error doing job: Task was destroyed but it is pending! (<Task pending name='Task-58175' coro=<AirTouchSocket._read() done, defined at /config/.local/lib/python3.12/site-packages/pyairtouch/comms/socket.py:345> wait_for= cb=[AirTouchSocket._schedule..discard_task() at /config/.local/lib/python3.12/site-packages/pyairtouch/comms/socket.py:283]>) Error doing job: Task was destroyed but it is pending! (<Task pending name='Task-60673' coro=<AirTouchSocket._read() done, defined at /config/.local/lib/python3.12/site-packages/pyairtouch/comms/socket.py:345> wait_for= cb=[AirTouchSocket._schedule..discard_task() at /config/.local/lib/python3.12/site-packages/pyairtouch/comms/socket.py:283]>) Error doing job: Task was destroyed but it is pending! (<Task pending name='Task-65054' coro=<AirTouchSocket._read() done, defined at /config/.local/lib/python3.12/site-packages/pyairtouch/comms/socket.py:345> wait_for= cb=[AirTouchSocket._schedule..discard_task() at /config/.local/lib/python3.12/site-packages/pyairtouch/comms/socket.py:283]>) Error doing job: Task was destroyed but it is pending! (<Task pending name='Task-65059' coro=<AirTouchSocket._read() done, defined at /config/.local/lib/python3.12/site-packages/pyairtouch/comms/socket.py:345> wait_for= cb=[AirTouchSocket._schedule..discard_task() at /config/.local/lib/python3.12/site-packages/pyairtouch/comms/socket.py:283]>) Error doing job: Task was destroyed but it is pending! (<Task pending name='Task-65063' coro=<AirTouchSocket._read() done, defined at /config/.local/lib/python3.12/site-packages/pyairtouch/comms/socket.py:345> wait_for= cb=[AirTouchSocket._schedule..discard_task() at /config/.local/lib/python3.12/site-packages/pyairtouch/comms/socket.py:283]>)

pppaulie commented 3 months ago

Broken for me too since the latest AirTouch update. Along with the integration being broken, I also noticed the AirTouch 5 Android phone APP also has issues with fetching data and requires a close and re-open of the app on the console. This only temporarily fixed the phone app as shortly afterwards, the error appeared again. SmartSelect_20240627_063328_AirTouch 5

JohnMcIl commented 3 months ago

Agreed!!! Broke for me also! 100% caused by the update. Screenshot 2024-06-27 at 10 35 45 am

Debug logging enabled…

@TheNoctambulist FYI

pppaulie commented 3 months ago

Broken for me too since the latest AirTouch update. Along with the integration being broken, I also noticed the AirTouch 5 Android phone APP also has issues with fetching data and requires a close and re-open of the app on the console. This only temporarily fixed the phone app as shortly afterwards, the error appeared again. SmartSelect_20240627_063328_AirTouch 5

FYI - After some more testing, I've learnt the android phone app and LCD console stop working (the touchscreen is unresponsive on the LCD Console and the android APP shows the error demonstrated in the screenshot above) due to the HA Component still actively trying to initialise (although failing)... It seems that when the HA Integration attempts to initialise it causes the system to freeze requiring a reset of the LCD Console. Since disabling the HA Integration, the LCD Console and any remote APPs are working correctly.

JohnMcIl commented 3 months ago

Can confirm I also have this issue! The HA integration causes the mobile interface to break. Disabling the ha integration and restarting the console allows use of the mobile app.

JohnMcIl commented 3 months ago

The HA integration is breaking the other comms for AirTouch as @pppaulie correctly identified.

TheNoctambulist commented 3 months ago

Thanks for the reports everyone. Polyaire have pulled the update, but I've released v0.7.2 which should address the compatibility issues with the protocol and be more lenient for future updates. I'll look into whether there is anything I can do in the integration to avoid locking up the AirTouch console if any connection errors occur in the future.

Let me know if you still see any errors in the latest release.

pppaulie commented 3 months ago

Thank you for your prompt action resolving the issue 👏👏👏 Very much appreciated 👍