Anyone know of a script that one can add to a custom php file that allows one to stop and start ZM?
I have a php file that I run on the ZM server that shows my feeds full screen on my monitor. It also changes the selected camera every 5 seconds and plays a fairly loud audible noise when an "alarm" is activated.
I know I could simply close up the window and load up the ZM page and stop/start there. But it would be nice to be able to just click a button with a mouse whenever I have to go out and mow the yard or whatever. Mowing adds over 100 extra recordings (I have 3+ acres and forgot to turn it off ).
Start/Stop button script?
-
- Posts: 15
- Joined: Thu Mar 21, 2024 11:39 am
Re: Start/Stop button script?
Nevermind. I came up with my own way to accomplish my goal using a couple of bash scripts. Not perfect. But it'll do.
Re: Start/Stop button script?
Instead of stopping ZM fully you can control monitors individually so the rest can continue to do their jobs.
You can execute this from php:
curl -XPOST http://<IP>/zm/api/monitors/<monitor>.json -d "Monitor[Function]=Modect&Monitor[Enabled]=1"
This turns monitor funcion on for the selected camera.
Later you can switch back to recording (Monitor[Function]=Record&Monitor[Enabled]=1) or whatever you want.
Also you can schedule the desired default function in case you forget to do that manually.
I use 1.34.x so API might have changed a bit.
You can execute this from php:
curl -XPOST http://<IP>/zm/api/monitors/<monitor>.json -d "Monitor[Function]=Modect&Monitor[Enabled]=1"
This turns monitor funcion on for the selected camera.
Later you can switch back to recording (Monitor[Function]=Record&Monitor[Enabled]=1) or whatever you want.
Also you can schedule the desired default function in case you forget to do that manually.
I use 1.34.x so API might have changed a bit.