Error during setup of component zoneminder

Hi I’m a newbie. I’m running home assistant in a Docker container (network: HOST), and zoneminder in another container (networw: bridge) on the same machine. Zoneminder is working fine, but I can`t add the integration.

log:

Logger: homeassistant.setup
Source: components/zoneminder/__init__.py:75
First occurred: 23:04:20 (1 occurrences)
Last logged: 23:04:20

Error during setup of component zoneminder
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 159, in _new_conn
    conn = connection.create_connection(
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 61, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/local/lib/python3.8/socket.py", line 918, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name does not resolve

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 670, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 392, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.8/http/client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1301, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1250, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1010, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.8/http/client.py", line 950, in send
    self.connect()
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 187, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 171, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f613d144400>: Failed to establish a new connection: [Errno -2] Name does not resolve

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 726, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 446, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='http', port=80): Max retries exceeded with url: /zm/api/host/login.json (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f613d144400>: Failed to establish a new connection: [Errno -2] Name does not resolve'))

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 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 643, 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: HTTPConnectionPool(host='http', port=80): Max retries exceeded with url: /zm/api/host/login.json (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f613d144400>: Failed to establish a new connection: [Errno -2] Name does not resolve'))

My config file:

zoneminder:
  host: http://192.168.0.35:9080
  path: /zm/
  path_zms: /zm/cgi-bin/nph-zms

It’s all in my local network, so I`m not using authentication. I’ve tried without the port number and only adding the host setting.
ZMninja works ok in my PC and my android phone, so the API is working.
The DNS setting in the host is 1.1.1.1, 1.0.0.1

Thanks for your help.

Upgraded to ha 117.4 and lost connection to zoneminder. Have the following error.

Logger: zoneminder.zm
Source: /usr/local/lib/python3.8/site-packages/zoneminder/zm.py:79
First occurred: 2:49:01 PM (1 occurrences)
Last logged: 2:49:01 PM

Connection error logging into ZoneMinder

Binary sensors working ie binary_sensor.front_door_camera_online
Bud switch and event not working

configuration.yaml as follows

- platform: zoneminder
    include_archived: true
    monitored_conditions:
      - hour
      - day

camera:
  
  - platform: amcrest
  - platform: zoneminder 
switch:
  - platform: zoneminder
    command_on: Modect
    command_off: Monitor

I am running ubutu 18.04 and docker. Both zonminder and hassio are on the same machine. All was working prior to my upgrade to 117.

Thanks

i’ve tried with ssl true and verify ssl false and port 8443 wich is the port that I assigned in zoneminder docker, keep getting name does not resolve error and authentication error:

ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='http', port=443): Max retries exceeded with url: /zm/api/host/login.json (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f613d144400>: Failed to establish a new connection: [Errno -2] Name does not resolve'))

The server (host) and the docker have 1.1.1.1 as DNS.

Please help.

Similar issue here.

This is my config, I tried those parameters that are currently commented out as well.

zoneminder:
  - host: !secret zm_host
    path: !secret zm_path
    # path_zms:
    # ssl: false
    # verify_ssl: false
    # username: !secret zm_username
    # password: !secret zm_password

# Informationen anzeigen
sensor:
  - platform: zoneminder
    include_archived: false

# Zwischen Modect und Monitor wechseln
switch:
  - platform: zoneminder
    command_on: Modect
    command_off: Monitor

I tested with AUTH en- and disabled within Zoneminder. Created a user and a server for Home Assistant

It does not make a difference whether authentication is turned on or off, whether there was this dedicated server or not. I get

Logger: zoneminder.zm
Source: /usr/local/lib/python3.8/site-packages/zoneminder/zm.py:79
First occurred: 07:50:34 (1 occurrences)
Last logged: 07:50:34
Connection error logging into ZoneMinder 

Both Home Assistant and ZoneMinder are on the same subnet in my local network. I can access ZoneMinder even from a different subnet / VLAN in my local network (my IOT runs on a different VLAN than my regular devices, but my phones and computers can access ZM without any issues; Home Assistant is even on the same subnet/VLAN as ZM and cannot connect to it).

I had this same issue while running zoneminder 1.32, I upgraded to 1.34 and that resolved the issue.

Hello!
I have solved this issue for me.
Problem was with Zoneminder API - it was broken on my Ubuntu 20lts.
To check the problem run request on your browser
http://<ZM-HOST>/zm/api/host/getVersion.json
ZM-HOST - hostname or IP address of your Zomeminder.
If ZM API is not working you will get 500 ERROR in your browser.
I’ve found in ZM forums it’s an issue of ZM - details here
To fix this issue run on ZM-HOST:
sudo apt install cakephp

To check ZM API is fine - run getVersion of ZM:
{"version":"1.34.26","apiversion":"2.0"}

Kind regards,
Alex