Page 1 of 1

Phone to arm and disarm alarms

Posted: Thu May 05, 2016 1:12 am
by schott1984
Good evening, everyone.

I recently got Zoneminder running with one IP camera and ZMninja on my android phone.

My goal here is to simply use ZM's motion detecting to replace a traditional home security system.

I have read about writing a script to check if your devices are on the home network's wifi, if they're within bluetooth range, etc.

Is it realistically possible to get a simple ARM/DISARM button working on our android phones? I realize I could connect with putty and enable or disable zoneminder, but my wife needs to be able to do this simply and even for me, the SSH method takes too much effort upon leaving/arrive at home.

Ideally I would like to simply change the mode of the monitors to "monitor" (possibly only certain ones) on "disarm" and "modect" on "arm".

What does everyone think? Is my only option to learn to make an app for android and design that around the ZM API?

Thank you in advance!

Re: Phone to arm and disarm alarms

Posted: Thu May 05, 2016 12:56 pm
by asker
Yup - I'll be adding an API for that and will also add it to zmNinja soon

Re: Phone to arm and disarm alarms

Posted: Thu May 05, 2016 1:03 pm
by rockedge
Yup - I'll be adding an API for that and will also add it to zmNinja soon
That will be fantastic. Nice work.

Re: Phone to arm and disarm alarms

Posted: Thu May 05, 2016 1:21 pm
by schott1984
asker wrote:Yup - I'll be adding an API for that and will also add it to zmNinja soon
Awesome. I won't put so much effort into figuring it out on my own, then.

Will we be able to assign groups of monitors to arm/disarm (change from modect to monitor)?

Re: Phone to arm and disarm alarms

Posted: Sat May 07, 2016 3:06 pm
by asker
For now, its on/off per monitor. No groups.
I've put in a PR here https://github.com/ZoneMinder/ZoneMinder/pull/1466

Feel free to give it a go

Code: Select all

// arm/disarm alarms
 +	// expected format: http(s):/portal-api-url/monitors/alarm/id:M/command:C.json
 +	// where M=monitorId
 +	// where C=on|off

Re: Phone to arm and disarm alarms

Posted: Mon May 09, 2016 4:18 pm
by calmor15014
I'm new to ZM (4 days of experimenting now), but wouldn't this type of thing be better served as a state change, which is possible (though not as a big red/green button) in zmNinja already?

I'm also trying to figure out the workflow to handle some form of semi-automatic or easy-to-use state change.