Integration with home automation

Discussion topics related to mobile applications for ZoneMinder
Post Reply
torkilt
Posts: 31
Joined: Thu Jul 06, 2017 10:56 am

Integration with home automation

Post by torkilt » Tue Feb 04, 2020 7:16 am

Hi

I have both indoor and outdoor cameras hooked up to zoneminder with zmninja. I use OpenHAB for home automation. I would like to be able to create alarm modes I can control in OpenHAB, so I can do stuff like "Turn off indoor alarm".

I presume it can be done either in zoneminder or in zmeventserver by REST API? Which would be the better/easier way?

Thanks,

Torkil

User avatar
asker
Posts: 1468
Joined: Sun Mar 01, 2015 12:12 pm

Re: Integration with home automation

Post by asker » Tue Feb 04, 2020 2:16 pm

There are multiple options.
1. You use ZM APIs
2. You use zmtrigger.pl
3. You use pyzm
Please don't ask me questions via PM. Feel free to post in the forums or Github

My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

torkilt
Posts: 31
Joined: Thu Jul 06, 2017 10:56 am

Re: Integration with home automation

Post by torkilt » Wed Feb 05, 2020 7:22 am

asker wrote:
Tue Feb 04, 2020 2:16 pm
There are multiple options.
1. You use ZM APIs
2. You use zmtrigger.pl
3. You use pyzm
Thanks.

I guess I can't do what I wanted that way, which is keeping morecord on but not get alarms in zmninja. That way I would still get faces cropped and saved for recognition.

But I can use either to change the mode from morecord til just record, which will do.

Mvh.

Torkil

User avatar
asker
Posts: 1468
Joined: Sun Mar 01, 2015 12:12 pm

Re: Integration with home automation

Post by asker » Wed Feb 05, 2020 2:24 pm

torkilt wrote:
Wed Feb 05, 2020 7:22 am

I guess I can't do what I wanted that way, which is keeping morecord on but not get alarms in zmninja. That way I would still get faces cropped and saved for recognition.
I might not be understanding the situation clearly, but you can always turn off notifications in zmNinja. That has no effect on the ES processing unknown faces or doing detection on events.
Please don't ask me questions via PM. Feel free to post in the forums or Github

My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

torkilt
Posts: 31
Joined: Thu Jul 06, 2017 10:56 am

Re: Integration with home automation

Post by torkilt » Wed Feb 05, 2020 4:02 pm

asker wrote:
Wed Feb 05, 2020 2:24 pm
torkilt wrote:
Wed Feb 05, 2020 7:22 am

I guess I can't do what I wanted that way, which is keeping morecord on but not get alarms in zmninja. That way I would still get faces cropped and saved for recognition.
I might not be understanding the situation clearly, but you can always turn off notifications in zmNinja. That has no effect on the ES processing unknown faces or doing detection on events.
Then I would have to do it in the app? I didn't find a way to turn of notifications for one or more zmnimja apps through any of the APIs. I want to do it through voice control and/or presence detection, like "Alexa, turn off alarm" or detecting my devices via mac or Bluetooth.

Mvh.

Torkil

User avatar
asker
Posts: 1468
Joined: Sun Mar 01, 2015 12:12 pm

Re: Integration with home automation

Post by asker » Wed Feb 05, 2020 4:50 pm

Notifications and APIs are completely unrelated.

You can turn off zmNinja notifications by:
a) Turning off event server support in the zmNinja app in which case it won't receive ANY push notifications
b) Turning off notification for a specific monitor. You do this by going to the app->Settings->EventServer->and turn off a specific monitor

All this does is ensure zmNinja does not get notifications. The ES continues to process events
Please don't ask me questions via PM. Feel free to post in the forums or Github

My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

torkilt
Posts: 31
Joined: Thu Jul 06, 2017 10:56 am

Re: Integration with home automation

Post by torkilt » Wed Feb 05, 2020 5:05 pm

asker wrote:
Wed Feb 05, 2020 4:50 pm
Notifications and APIs are completely unrelated.

You can turn off zmNinja notifications by:
a) Turning off event server support in the zmNinja app in which case it won't receive ANY push notifications
b) Turning off notification for a specific monitor. You do this by going to the app->Settings->EventServer->and turn off a specific monitor

All this does is ensure zmNinja does not get notifications. The ES continues to process events
Aye, so as I suspected. Doing it in the app is not an option, so flipping between record and mocord will have to do.

Thanks.

Torkil

User avatar
asker
Posts: 1468
Joined: Sun Mar 01, 2015 12:12 pm

Re: Integration with home automation

Post by asker » Wed Feb 05, 2020 7:02 pm

If you can better describe your use-case there may be a simple solution.
You could manually edit tokens.txt and remove the tokens you don't want, or disable them but the next time zmNinja starts it will re-activate them.

But I can very easily add server side controls for it, assuming it is useful - and for that I need to understand the motivation b better.
Please don't ask me questions via PM. Feel free to post in the forums or Github

My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

torkilt
Posts: 31
Joined: Thu Jul 06, 2017 10:56 am

Re: Integration with home automation

Post by torkilt » Wed Feb 05, 2020 10:07 pm

asker wrote:
Wed Feb 05, 2020 7:02 pm
If you can better describe your use-case there may be a simple solution.
You could manually edit tokens.txt and remove the tokens you don't want, or disable them but the next time zmNinja starts it will re-activate them.

But I can very easily add server side controls for it, assuming it is useful - and for that I need to understand the motivation b better.
I have a couple indoors cameras for which I would like to receive notifications in zmninja when it detects persons, but only if no-one is home. My wife would like to receive notifications as well. There's also an almost adult child who comes and goes on her own.

It would soon become tedious if both of us had to juggle our own notifications in the app every time we get an benign alarm.

One solution is presence detection based on our telephones so it would all run automatically whenever we connect or disconnect from wifi. Another way would be a voice command or smart switch just inside the front door. It can be done by switching the cameras from mocord to record through the API but then I lose the ability to collect mugshots to improve known face detection.

I hope that better describes it. An way to disable zmninja notifications for given or all clients for a given monitor through a REST call would be perfect.

User avatar
asker
Posts: 1468
Joined: Sun Mar 01, 2015 12:12 pm

Re: Integration with home automation

Post by asker » Wed Feb 05, 2020 10:13 pm

Good use case. I can use it myself. Can you create a GH issue in zmeventnotification? I’ll think about a clean approach. It would likely be via the existing web sockets channel. Would that be ok?
Please don't ask me questions via PM. Feel free to post in the forums or Github

My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

torkilt
Posts: 31
Joined: Thu Jul 06, 2017 10:56 am

Re: Integration with home automation

Post by torkilt » Thu Feb 06, 2020 6:43 am

asker wrote:
Wed Feb 05, 2020 10:13 pm
Good use case. I can use it myself. Can you create a GH issue in zmeventnotification? I’ll think about a clean approach. It would likely be via the existing web sockets channel. Would that be ok?
Great, I'll create an issue =)

It looks like OpenHAB doesn't have a websocket client but it does have a binding for running a shell script, so I guess that would do just fine.

User avatar
MsAkagi
Posts: 1
Joined: Wed Apr 07, 2021 10:16 am

Re: Integration with home automation

Post by MsAkagi » Wed Apr 07, 2021 10:17 am

I have the same and use Zoneminder with zero issues.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests