Integration with home automation

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
torkilt
Posts: 38
Joined: Thu Jul 06, 2017 10:56 am

Integration with home automation

Post by torkilt »

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: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Integration with home automation

Post by asker »

There are multiple options.
1. You use ZM APIs
2. You use zmtrigger.pl
3. You use pyzm
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
torkilt
Posts: 38
Joined: Thu Jul 06, 2017 10:56 am

Re: Integration with home automation

Post by torkilt »

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: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Integration with home automation

Post by asker »

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.
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
torkilt
Posts: 38
Joined: Thu Jul 06, 2017 10:56 am

Re: Integration with home automation

Post by torkilt »

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: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Integration with home automation

Post by asker »

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
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
torkilt
Posts: 38
Joined: Thu Jul 06, 2017 10:56 am

Re: Integration with home automation

Post by torkilt »

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: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Integration with home automation

Post by asker »

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 no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
torkilt
Posts: 38
Joined: Thu Jul 06, 2017 10:56 am

Re: Integration with home automation

Post by torkilt »

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: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Integration with home automation

Post by asker »

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?
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
torkilt
Posts: 38
Joined: Thu Jul 06, 2017 10:56 am

Re: Integration with home automation

Post by torkilt »

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.
airfoxone
Posts: 1
Joined: Fri May 07, 2021 6:50 am

Re: Integration with home automation

Post by airfoxone »

i was thinking about same
tsp84
Posts: 227
Joined: Thu Dec 24, 2020 4:04 am

Re: Integration with home automation

Post by tsp84 »

What are you trying to accomplish?
burekvid
Posts: 1
Joined: Wed Mar 23, 2022 8:38 am

Re: Integration with home automation

Post by burekvid »

yes, OpenHAB doesn't have a websocket client but it does have a binding for running a shell script vidmate apk download insta downloader
Post Reply