epoplavskis / homeassistant_salus

Home Assistant integration with Salus devices
MIT License
47 stars 15 forks source link

Cannot connect to UGE600 #43

Open imihailovs opened 1 year ago

imihailovs commented 1 year ago

I am trying to add UGE600 gateway via HACS installed component and I can't seem to connect to the gateway - tried both real and all-zero EUIDs.

I've made sure to maintain Local WIFI setting and I've also tried connecting via Ethernet and WIFI connections one after another - no success - I'm getting "Invalid IP address. Try again." error message.

Is there a log file somewhere that I can use to analyze the response from the GW?

alex-ricobon commented 10 months ago

same issue here, did you manage to fix it?

stvogel commented 9 months ago

I have the same problem for the UGE600, but I got the error-message: "Unknown error occurred" In the log I find:

2023-10-25 09:48:07.134 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/pyit600/gateway.py", line 929, in _make_encrypted_request
    response_json_string = self._encryptor.decrypt(response_bytes)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyit600/encryptor.py", line 27, in decrypt
    plain: bytes = unpadder.update(padded_data) + unpadder.finalize()
                                                  ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/cryptography/hazmat/primitives/padding.py", line 160, in finalize
    result = _byte_unpadding_check(
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/cryptography/hazmat/primitives/padding.py", line 102, in _byte_unpadding_check
    raise ValueError("Invalid padding bytes.")
ValueError: Invalid padding bytes.

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 177, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 293, in async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 394, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/salus/config_flow.py", line 44, in async_step_user
    unique_id = await gateway.connect()
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyit600/gateway.py", line 101, in connect
    all_devices = await self._make_encrypted_request(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyit600/gateway.py", line 957, in _make_encrypted_request
    raise IT600CommandError(
pyit600.exceptions.IT600CommandError: Unknown error occurred while communicating with iT600 gateway

Seems to me as if this is a problem of the underlying pyit600 -library, https://github.com/jvitkauskas/pyit600

Edit: I tried with the underlying pyit600-library. With command: python main.py --host 192.168.xxx.xxx --euid 001E5E0909xxxxxx I got the same error.

But python main.py --host 192.168.xxx.xxx --euid 0000000000000000 works fine!

andvarga79 commented 8 months ago

Hi All, I just purchased a Salus IT600 underfloor heating automatization, hoping to integrate it in Home Assistant, and I am at the point that I will send it back if not doable. I have downloaded latest of the integration from HACS and when I try to add IP and EUID the error of Failed to connect, please check IP address coms back. I have tried the troubleshooting from the readme, all looks good, but error persists. I am not an IT person, and not really understanding the above solution. Do you mind creating a tutorial as for a person without required IT knowledge? Thank you!

nicu-cbn commented 8 months ago

Hello. I have the same error. Also found in the HA logs the following:

Logger: pyit600 Source: custom_components/salus/config_flow.py:44 Integration: Salus iT600 (documentation, issues) First occurred: 00:47:29 (1 occurrences) Last logged: 00:47:29

Timeout while connecting to gateway:

palladin8282 commented 8 months ago

Hi, I have simmilar issue,

But what I found also is that:

Also check if you have "Local Wifi Mode" enabled:

Open Smart Home app on your phone Sign in Double tap your Gateway to open info screen Press gear icon to enter configuration Scroll down a bit and check if "Disable Local WiFi Mode" is set to "No" Scroll all the way down and save settings Restart Gateway by unplugging/plugging USB power

In my gateway this mode was disabled

Trying this righ now - I will inform about results.

palladin8282 commented 8 months ago

Hi All, After enabling the Local Wifi Mode to on and restarting the gateway I was able to establish connection :) Maybe this will help you too.

nicu-cbn commented 8 months ago

On my side my router has an option to isolate IoT devices and Salus Gateway was one of those isolated devices (and the and the HA server not), that's why Home Assistant was unable to connect. Solving this was fixed my issue

imihailovs commented 3 months ago

Came back to integrating the Gateway, but still facing the same issue. Both HA and Gateway are on the same subnet, firewall doesn't block anything. Local mode is enabled on the gateway. What I have noticed is that I can't ping the IP address of a gateway. Could be normal, don't know. Anyhow, the error I am getting from the logs is as follows:

`This error originated from a custom integration.

Logger: pyit600 Source: custom_components/salus/config_flow.py:44 integration: Salus iT600 (documentation, issues) First occurred: 9:21:30 AM (7 occurrences) Last logged: 9:29:17 AM

Timeout while connecting to gateway:`