home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.17k stars 30.2k forks source link

Ecovacs Intergration not working with self hosted Bumper anymore. #121342

Closed BeJay8675309 closed 2 months ago

BeJay8675309 commented 3 months ago

The problem

This no longer works after core_2024.5.2 with the self hosted version of bumper. I have 2 x Deebot Neos that are successfully registered in bumper, but am now unable to get HA intergration to register as a client. Screenshot 2024-07-06 at 08-02-17 Bumper

What version of Home Assistant Core has the issue?

core_2024.6.1

What was the last working version of Home Assistant Core?

core_2024.5.2

What type of installation are you running?

Home Assistant OS

Integration causing the issue

ecovacs

Link to integration documentation on our website

https://www.home-assistant.io/integrations/ecovacs

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-07-06 07:36:04.409 DEBUG (MainThread) [deebot_client.authentication] Calling api(1/3): url=https://portal-ww.ecouser.net/api/iot/devmanager.do, params={'mid': 'z0gd1j', 'did': 'd5a1fe5a

It may be that it is only looking for https and not http that bumper provides?

Additional information

No response

home-assistant[bot] commented 3 months ago

Hey there @mib1185, @edenhaus, @augar, mind taking a look at this issue as it has been labeled with an integration (ecovacs) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `ecovacs` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign ecovacs` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


ecovacs documentation ecovacs source (message by IssueLinks)

mib1185 commented 3 months ago

Please provide the full debug log, thx 👍

BeJay8675309 commented 2 months ago

I was wondering if anyone else was having issues. The full log is huge and requires a lot of obfuscation of user details, so here is the main issue:

  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1033, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.6.2:8007 ssl:default [Connect call failed ('192.168.6.2', 8007)]
2024-05-11 20:45:55.699 WARNING (MainThread) [deebot_client.mqtt_client] Connection lost; Reconnecting in 5 seconds ...
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/deebot_client/mqtt_client.py", line 203, in mqtt
    async with await self._get_client() as client:
  File "/usr/local/lib/python3.12/site-packages/aiomqtt/client.py", line 703, in __aenter__
    raise MqttError(str(exc)) from None
aiomqtt.exceptions.MqttError: [Errno 111] Connection refused
2024-05-11 20:46:00.701 WARNING (MainThread) [deebot_client.mqtt_client] Connection lost; Reconnecting in 5 seconds ...
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/deebot_client/mqtt_client.py", line 203, in mqtt
    async with await self._get_client() as client:
  File "/usr/local/lib/python3.12/site-packages/aiomqtt/client.py", line 703, in __aenter__
    raise MqttError(str(exc)) from None
aiomqtt.exceptions.MqttError: [Errno 111] Connection refused
2024-05-11 20:46:05.705 WARNING (MainThread) [deebot_client.mqtt_client] Connection lost; Reconnecting in 5 seconds ...
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/deebot_client/mqtt_client.py", line 203, in mqtt
    async with await self._get_client() as client:
  File "/usr/local/lib/python3.12/site-packages/aiomqtt/client.py", line 703, in __aenter__
    raise MqttError(str(exc)) from None
aiomqtt.exceptions.MqttError: [Errno 111] Connection refused

My bumper server is 192.168.6.2 and works ok for the deebot vacuums to connect to, just not the HA intergration client.

ecovacs

mib1185 commented 2 months ago

you seems to have multiple issues while connecting to your bumper server the rest api fails to connect with: Cannot connect to host 192.168.6.2:8007 ssl:default [Connect call failed ('192.168.6.2', 8007)] the mqtt fails with: [Errno 111] Connection refused maybe the ports are wrong or the bumper server runs some kind of local firewall for the rest-api try to use https

edenhaus commented 2 months ago

I can confirm that the HA integration works with bumper. Can you verify that your bumper server certificate is valid and not expired?

for the rest-api try to use https

Should work for both and the above error is from mqtt and has nothing to do with rest. Rest and mqtt is seperated

mib1185 commented 2 months ago

there are two separate errors in the log:

rest-api related:

File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1033, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.6.2:8007 ssl:default [Connect call failed ('192.168.6.2', 8007)]

mqtt related:

aiomqtt.exceptions.MqttError: [Errno 111] Connection refused
BeJay8675309 commented 2 months ago

ok, it was the certificates. I didn't realize they only last 2 years...

Running create_certs_linux fixed the problem sort of.. $ ./create_certs_linux -------- Create_Certs -------- -------- Starting Certificate Creation -------- Options: Output Directory: /home/bumper/create_certs Input SAN List: /home/bumper/create_certs/Bumper_SAN.txt -------- Creating CA Cert -------- 2024/07/11 07:42:59 ca.crt created at /home/bumper/create_certs/ca.crt 2024/07/11 07:42:59 ca.key created at /home/bumper/create_certs/ca.key -------- Creating Server Cert -------- 2024/07/11 07:42:59 bumper.crt created at /home/bumper/create_certs/bumper.crt 2024/07/11 07:42:59 bumper.key however I still could only use http not https in HA.

I can reach the bumper page using a web browser https (on port 8007/443) however the HA times out with no log entry ( I have the debug enabled in ecovacs). Using the rest URL as http (not https) now let's me register the account in HA.

Anyway it is now working again using mqtt, so I call that a win. Screenshot 2024-07-11 at 08-25-00 Bumper

Thanks for your help!