Zoneminder

Wouldn’t it be possible to have Home Assistant interact with Zoneminder when an alarm arm state is set to “Away?” So if I set a state from my smartphone to “Home” state and the camera detects motion, it won’t record?

I see that Home Assistant has support for Ubiquiti Video Camera and that really caught my interest in buying the cameras when I buy/build my own house.

Honestly, I used the find feature in my browser to search for zoneminder when I select to view all the components.

Update: Actually, I found something that could be useful. Has anyone tried something like this?
https://forums.zoneminder.com/viewtopic.php?t=18985

I’m not sure how an alarmcp could be used in tandem with Home Assistant.

There are some Perl Scripts in ZM, they can be found under /usr/bin.
You can create some CLI switches and after that trigger them as you wish.
For example you can turn ZM on/off with: sudo zmpkg.pl stop/start.

I want to integrate ZM with Hass, but at the moment ZM is producing noise in my images and I get a lot of fake alarms.

So it looks like I’ll want to make Zoneminder run as the same user as Home Assistant so that I can issue start/stop commands.

But will I still be able to access the recordings through a web interface once I tell zmpkg to stop?

Hi,

I’m using a CLI switch for control zoneminder run states (available since zm 1.28.107). I have 2 run states profiles (InHouse and OutHouse) and i use it for enable or disable detection on cameras.

If you stop zm with zmpkg you wouldn’t be able to access live streams but ZM web interface will be available for events, etc.

This is my configuration:

switch: platform: command_line switches: Alarma: oncmd: "/usr/bin/zmpkg.pl OutHouse" offcmd: "/usr/bin/zmpkg.pl InHouse" statecmd: "/etc/home-assistance/zm/getstate.sh" value_template: '{{ value == "OutHouse" }}'

And this is the content of my “gestate.sh” script:

#!/bin/bash zmdbuser=cat /etc/zm/zm.conf | grep ZM_DB_USER | awk -F= ‘{print $2}’ | tr -d ’ ' zmdbpass=cat /etc/zm/zm.conf | grep ZM_DB_PASS | awk -F= ‘{print $2}’ | tr -d ’ ' runstate=mysql -N -B -u$zmdbuser -p$zmdbpass zm -e “select Name from States where isActive=1 LIMIT 1;” echo $runstate

1 Like