Change function onDemand

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
girkers
Posts: 17
Joined: Wed Mar 22, 2017 12:08 am

Change function onDemand

Post by girkers »

I have a few cameras and some are in day to day places in my house and I don't want to have to go through all recordings and have to delete them. Is there a way for me to easily change the function from Modetect to Monitor and back again simply enough, such as a button on an app or a webscript?

Couldn't imagine someone else has not had to do this before me, so love to hear how other people get around this.

Cheers

Girkers
--

Girkers
User avatar
kitkat
Posts: 193
Joined: Sun Jan 27, 2019 5:17 pm

Re: Change function onDemand

Post by kitkat »

I think that you may be able to do this using Run States.

Set things up as you want them for a particular scenario.
Click the State button at the top-right of the Console page (it usually says 'Running' when the system is active).
Enter a name for your current setup/state and click 'Save'.
girkers
Posts: 17
Joined: Wed Mar 22, 2017 12:08 am

Re: Change function onDemand

Post by girkers »

Cheers kitkat but not quite what I was after.

I think what I need to do is "disable" the mode "Modetect", but to do this manually is very onerous. I also did see when you are viewing the camera there is a link to "Disable Alarms" but I don't see a link to "Enable Alarms".

Still looking for options and suggestions.

Cheers

Girkers
--

Girkers
mythedoff
Posts: 25
Joined: Sat Dec 04, 2010 5:21 pm

Re: Change function onDemand

Post by mythedoff »

Perhaps this:

change-state-to-modect.sh

Code: Select all

#! /bin/bash
curl -XPOST -d "user=<username>&pass=<password>" -c cookies.txt  http://<ip>/zm/api/host/login.json

curl -b cookies.txt -XPOST http://<ip>/zm/api/monitors/2.json -d "Monitor[Function]=Modect&Monitor[Enabled]=2"

curl -b cookies.txt  http://<ip>/zm/api/host/logout.json
Create a second script to change state to Monitor.
This worked with the Android app "SSH Button" which has a home screen widget.
Ref.: https://zoneminder.readthedocs.io/en/stable/api.html
Post Reply