In my last post, I talked about setting up a PI Zero with a web cam using the excellent RPi Cam Web Interface. I have multiple devices running. The motion capture on these cameras can be automatically turned on and off using a variety of schedules. It can also be toggled directly from the web interface that each devices serve up.
But how about integrating them with the rest of your home monitoring system? I want to be able to put my home monitoring system into "away" mode or "present" mode and have it toggle motion capture appropriately without me having to manually go to both user interfaces.
Doing this is surprisingly easy.
In addition to a human usable interactive GUI, the web server on the Pi also provides a url that lets you directly task the system. The PHP file that does this is called "cmd_pipe.php" You pass "cmd" as a parameter into that URL and it will issue the command to the underlying camera process.
The command to start motion capture is "md 1" and the command to stop it is "md 0." So after you appropriately escape the space for URLs, issuing the following URL will start motion catpure:
http://camera.name.local/html/cmd_pipe.php?cmd=md%201
Issuing the following URL will stop it.
http://camera.name.local/html/cmd_pipe.php?cmd=md%200
This way, if you have other software around the house that does command and control for your home monitoring system, you can have that software issue these commands to your cameras.
But how about integrating them with the rest of your home monitoring system? I want to be able to put my home monitoring system into "away" mode or "present" mode and have it toggle motion capture appropriately without me having to manually go to both user interfaces.
Doing this is surprisingly easy.
In addition to a human usable interactive GUI, the web server on the Pi also provides a url that lets you directly task the system. The PHP file that does this is called "cmd_pipe.php" You pass "cmd" as a parameter into that URL and it will issue the command to the underlying camera process.
The command to start motion capture is "md 1" and the command to stop it is "md 0." So after you appropriately escape the space for URLs, issuing the following URL will start motion catpure:
http://camera.name.local/html/cmd_pipe.php?cmd=md%201
Issuing the following URL will stop it.
http://camera.name.local/html/cmd_pipe.php?cmd=md%200
This way, if you have other software around the house that does command and control for your home monitoring system, you can have that software issue these commands to your cameras.
Comments
Post a Comment