2.8 Optional but Recommended: Making sure everything is running (in manual mode) . . . . . . . . . . 13
2.9 Making sure the ES gets auto-started when ZM starts . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.10 Set up logging correctly for troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3 Key Principles - Event Notification Server and Hooks 15
3.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 From Event Detection to Notification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3 Controlling the Event Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.4 How Machine Learning works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4 Machine Learning Hooks 23
4.1 Key Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.2 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.3 What . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.4 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.5 Post install steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.6 Test operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.7 Upgrading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.8 Sidebar: Local vs. Remote Machine Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.9 Which models should I use? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.10 Understanding detection configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.11 About specific detection types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.12 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.13 Performance comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.14 Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5 Configuration Guide 41
5.1 Secret Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6 Event Notification Server FAQ 43
6.1 Machine Learning! Mmm..Machine Learning! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.2 What is it? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.3 Why do we need it? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.4 Is this officially developed by ZM developers? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.5 How can I use this with Node-Red or Home Assistant? . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.6 Disabling security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.7 How do I safely upgrade zmeventnotification to new versions? . . . . . . . . . . . . . . . . . . . . . 44
6.8 Configuring the notification server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6.9 Troubleshooting common situations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.10 How do I disable secure (WSS) mode? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.11 Debugging and reporting problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.12 Brickbats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
7 Machine Learning Hooks FAQ 59
7.1 My hooks run just fine in manual mode, but don’t in daemon mode . . . . . . . . . . . . . . . . . . 59
7.2 I get a segment fault/core dump while trying to use opencv in detection . . . . . . . . . . . . . . . . 59
7.3 I am trying to use YoloV4 and I see errors in OpenCV . . . . . . . . . . . . . . . . . . . . . . . . . 60
7.4 Necessary Reading - Sample Config Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
7.5 How do the hooks actually invoke object detection? . . . . . . . . . . . . . . . . . . . . . . . . . . 60
7.6 How To Debug Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
7.7 It looks like when ES invokes the hooks, it misses objects, but when I run it manually, it detects it just
fine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
7.8 I’m having issues with accuracy of Face Recognition . . . . . . . . . . . . . . . . . . . . . . . . . . 61
7.9 I am using a Coral TPU and while it works fine, at times it fails loading . . . . . . . . . . . . . . . . 61
7.10 Local vs. Remote server for Machine Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
ii