Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging "Unknown error occurred while communicating with iT600 gateway" #41

Open
prupert opened this issue Nov 3, 2024 · 0 comments

Comments

@prupert
Copy link

prupert commented Nov 3, 2024

While working on the Home Assistant integration of a Salus UGE600 gateway, I noticed that the underlying pyit600 library suddenly stopped being able to connect to the device. Because I believe that the gateway is configured correctly, and I am able to ping and HTTP the device IP address, I am looking for guidance how to further debug this issue.

I have installed pyit600 module on a VM to debug. I get the following errors:

% python main.py --host 192.168.x.25 --euid 001Exxxxxxxxxxxx --debug

Quickly gives the following output:

DEBUG:pyit600:Trying to connect to gateway at 192.168.x.25
DEBUG:pyit600:Gateway request: POST http://192.168.x.25:80/deviceid/read
{"requestAttr": "readall"}

(--- Logging error ---
Traceback (most recent call last):
  File "/redacted-path-tovenv/lib/python3.13/site-packages/pyit600/gateway.py", line 922, in _make_encrypted_request
    with async_timeout.timeout(self._request_timeout):
         ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'Timeout' object does not support the context manager protocol

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/redacted-path-to-python/Frameworks/Python.framework/Versions/3.13/lib/python3.13/logging/__init__.py", line 1150, in emit
    msg = self.format(record)
  File "/redacted-path-to-python/Frameworks/Python.framework/Versions/3.13/lib/python3.13/logging/__init__.py", line 998, in format
    return fmt.format(record)
           ~~~~~~~~~~^^^^^^^^
  File "/redacted-path-to-python/Frameworks/Python.framework/Versions/3.13/lib/python3.13/logging/__init__.py", line 711, in format
    record.message = record.getMessage()
                     ~~~~~~~~~~~~~~~~~^^
  File "/redacted-path-to-python/Frameworks/Python.framework/Versions/3.13/lib/python3.13/logging/__init__.py", line 400, in getMessage
    msg = msg % self.args
          ~~~~^~~~~~~~~~~
TypeError: not all arguments converted during string formatting
Call stack:
  File "/redacted-path-tovenv/main.py", line 172, in <module>
    asyncio.run(main())
  File "/redacted-path-to-python/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/runners.py", line 194, in run
    return runner.run(main)
  File "/redacted-path-to-python/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
  File "/redacted-path-to-python/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/base_events.py", line 708, in run_until_complete
    self.run_forever()
  File "/redacted-path-to-python/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/base_events.py", line 679, in run_forever
    self._run_once()
  File "/redacted-path-to-python/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/base_events.py", line 2027, in _run_once
    handle._run()
  File "/redacted-path-to-python/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/events.py", line 89, in _run
    self._context.run(self._callback, *self._args)
  File "/redacted-path-tovenv/main.py", line 72, in main
    await gateway.connect()
  File "/redacted-path-tovenv/lib/python3.13/site-packages/pyit600/gateway.py", line 101, in connect
    all_devices = await self._make_encrypted_request(
  File "/redacted-path-tovenv/lib/python3.13/site-packages/pyit600/gateway.py", line 956, in _make_encrypted_request
    _LOGGER.error("Exception. %s / %s", type(e), repr(e.args), e)
Message: 'Exception. %s / %s'
Arguments: (<class 'TypeError'>, '("\'Timeout\' object does not support the context manager protocol",)', TypeError("'Timeout' object does not support the context manager protocol")))
Traceback (most recent call last):
  File "/redacted-path-tovenv/lib/python3.13/site-packages/pyit600/gateway.py", line 922, in _make_encrypted_request
    with async_timeout.timeout(self._request_timeout):
         ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'Timeout' object does not support the context manager protocol

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

Traceback (most recent call last):
  File "/redacted-path-tovenv/main.py", line 172, in <module>
    asyncio.run(main())
    ~~~~~~~~~~~^^^^^^^^
  File "/redacted-path-to-python/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "/redacted-path-to-python/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/redacted-path-to-python/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/base_events.py", line 721, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/redacted-path-tovenv/main.py", line 72, in main
    await gateway.connect()
  File "/redacted-path-tovenv/lib/python3.13/site-packages/pyit600/gateway.py", line 101, in connect
    all_devices = await self._make_encrypted_request(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
    )
    ^
  File "/redacted-path-tovenv/lib/python3.13/site-packages/pyit600/gateway.py", line 957, in _make_encrypted_request
    raise IT600CommandError(
        "Unknown error occurred while communicating with iT600 gateway"
    ) from e
pyit600.exceptions.IT600CommandError: Unknown error occurred while communicating with iT600 gateway

I tried the following already:

  • Changed the EUID to 000000000000: same output
  • Confirmed that local WiFi mode was NOT disabled in Salus app
  • Made sure the device was reachable (ping and HTTP)
  • Reboot the UGE600 gateway device

The mentioned URL in the debug output responds (quickly) to a curl request:

% curl -I http://192.168.x.25:80/deviceid/read

Quickly returns the following output:

HTTP/1.1 200 OK
Keep-Alive: timeout=5, max=199
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Date: Sun, 03 Nov 2024 13:15:30 GMT
Content-Length: 32
X-XSS-Protection: 1; mode=block
Connection: Keep-Alive
Accept-Ranges: bytes

So to me it seems that the Salus UGE600 device should be reachable. I am totally clueless as to why line 957, in _make_encrypted_request raise IT600CommandError("Unknown error occurred while communicating with iT600 gateway"

Details about the UGE600 device:

  • Model: Universal Gateway
  • Software version: 021720240719
  • Coordinator version: 20240613
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant