Thanks! It brought me closer, but I get errors in my HA logs as ZM is using a self-signed certificate. It seems the downloader integration chokes on these…
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 381, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 978, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 362, in connect
self.sock = ssl_wrap_socket(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 397, in ssl_wrap_socket
return context.wrap_socket(sock)
File "/usr/local/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/usr/local/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/usr/local/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1123)
I was able to edit the Downloader integration so that it did not balk at self-signed certificates. The file in question is /usr/src/homeassistant/homeassistant/components/downloader/__init__.py. Line 78, change req = requests.get(url, stream=True, timeout=10) to req = requests.get(url, stream=True, timeout=10, verfiy=False). When you restart HA, all will be good.
I was going to see if I could figure out how to put in a PR, however this did not solve my problem as the file downloaded from https://<ZMIP>:<ZMPORT>/zm/index.php?view=image&eid=<eventID>&fid=objdetect was the html login form, not an image. For whatever reason, HA was not authenticated against ZM.
Looks like I am going to have to go the AppDaemon route–thanks for your help!
Well that was too obvious, thanks! I will look into how to go about submitting an official PR to the Downloader integration to ignore self-signed certs.
Can anyone help me with getting ES sending MQTT messages, I’m using the dlandon docker container, ZM is working correctly, the ES is also running but I’m not getting any MQTT messages from events so I’m guessing it’s my zmeventnotification.ini that’s wrong.
My docker container is set to use port 2080>9000
Do I need to change that in the ini to 2080 or leave it as 9000?
I have
push off
FCM off
MQTT on, server set to 192.168.1.3 (do I need the port)
No MQTT username or password
SSL set to off
Hooks set to off
I must be missing something or doing something wrong here.
Hi, my reply could be late, but still better than never
As workaround (not a good from security point of view, since credentials will be part of URL) You can get the picture from ZM by providing credentials in the URL https://<ZMIP>:<ZMPORT>/zm/index.php?view=image&eid=<eventID>&fid=objdetect& username=<ZMUser>&password=<ZMPass>&
I think it’s acceptable if HA and ZM servers are not available from outside.
I run hassio in a docker container and the dlandon ZM container. I was having similar issues of not receiving mqtt messages. The issue (I think) was the event server wasn’t able to connect to the MQTT broker.
Pretty sure I fixed it by adding the dlandon ZM container to the hassio docker network.
My current issue is i’m receiving the mqtt messages when an event happens but they’re very generic messages. They appear to come from the default zone setup in ZM and not any sort of object detection. Also none of the events in ZM have anything related to object detection.
In zmeventnotification.ini - i’m not using ssl. I have auth enabled, port 9000, fcm enable, mqtt enable,
I’m using the dlandon container with the following environment variables
Did you just install dlandons latest dockercimage for zm?
I’m having the same problems. There seems to be a problem with that image. A lot of people have seen the issues at this moment.
There are maps missing and other stuff.
At least I’ve push notifications but with no object detections.
Interesting… Is there a known working image that you know of?
EDIT: I’m not sure i’m using the new image that people are mentioning in the dlandon github issues.
Here’s my logs: https://i.imgur.com/KjiPnmj.png I think the “start hook processing failed” line could possibly be a clue… I need to figure out why that is failing. I am receiving the event_start notifications via mqtt but again they’re very generic and only related to the motion alert and nothing to do with object detection.
For reference, the ID hash for my dlandon/zoneminder image is sha256:42db1ce73998a70f7017fa534ec71dff6ad7862e382c3e0d44c0323a3aa22d34
EDIT EDIT:
Following along with some of the debug steps, i’m getting this python error when attempting to manually run the zm_event_start script.
sudo -u www-data /var/lib/zmeventnotification/bin/zm_event_start.sh 7438 3
Traceback (most recent call last):
File "/var/lib/zmeventnotification/bin/zm_detect.py", line 27, in <module>
import zmes_hook_helpers.utils as utils
ModuleNotFoundError: No module named 'zmes_hook_helpers'
EDIT EDIT EDIT: I fixed my issues by deleting everything and restarting (ha!). one issue I ran into on round 2 was trying to use Yolov3 when the config appears to be setup for v4. Switched to yolov4 and i’m now getting detections.