Zoneminder integration getting Failed to establish a new connection: [Errno 111] Connection refused

Hi Guys,

I`m trying to configure Zoneminder into home assistant but struggeling with connection issues. Just wrote this on ZM Forum, but I than thought thats rather a HA issue.

HA: 2020.12.7 running in docker
ZM: 1.34.22 running in docker

ZM seems to get no connection from HA:

error log:

[Wed Jan 13 11:04:11.458143 2021] [mpm_prefork:notice] [pid 11460] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1i configured -- resuming normal operations
[Wed Jan 13 11:04:11.458186 2021] [core:notice] [pid 11460] AH00094: Command line: '/usr/sbin/apache2'

access log:

192.168.253.230 - - [13/Jan/2021:11:01:27 +0100] "GET /zm/index.php?view=request&request=status&entity=navBar HTTP/1.1" 200 1571 "https://192.168.253.22:8466/zm/?view=options&tab=system" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.253.230 - - [13/Jan/2021:11:02:27 +0100] "GET /zm/index.php?view=request&request=status&entity=navBar HTTP/1.1" 200 1571 "https://192.168.253.22:8466/zm/?view=options&tab=system" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

From the HA I can see in the logs the following:

2021-01-13 11:04:50 ERROR (MainThread) [homeassistant.setup] Error during setup of component zoneminder
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 96, in create_connection
raise err
File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 86, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 353, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f8ea73df3a0>: Failed to establish a new connection: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 573, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='my-domain.duckdns.org', port=8466): Max retries exceeded with url: /zm/api/host/login.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f8ea73df3a0>: Failed to establish a new connection: [Errno 111] Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component
result = await task
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/zoneminder/__init__.py", line 75, in setup
success = zm_client.login() and success
File "/usr/local/lib/python3.8/site-packages/zoneminder/zm.py", line 46, in login
req = requests.post(urljoin(self._server_url, 'api/host/login.json'),
File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 119, in post
return request('post', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='my-domain.duckdns.org', port=8466): Max retries exceeded with url: /zm/api/host/login.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f8ea73df3a0>: Failed to establish a new connection: [Errno 111] Connection refused'))
2021-01-13 11:04:50 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform zoneminder.camera: Unable to set up component.

So I did the Curl command from the HA (curl -XPOST -d “user=username&pass=password” https://my-domain.duckdns.org:8466/zm/a … login.json) which is working fine and I get the token for the login.
can also than see the entry in the log:
172.17.0.1 - - [13/Jan/2021:11:09:48 +0100] “POST /zm/api/host/login.json HTTP/1.1” 200 4299 “-” “curl/7.69.1”

Configuration:
zoneminder:

  • host: my-domain.duckdns.org:8466
    path: /zm/
    path_zms: /zm/cgi-bin/nph-zms
    username: username
    password: password
    ssl: true
    verify_ssl: false

I using DuckDNS certificate which are used on ZM and HA. I have no further idea where the issue can be and any help would be appreciated.

BR
Dan