ZoneMinder Control Script for Foscam FI8918W

Gnarly asleep via ZoneMinder

Update 27/02/2011: Added IR control and password passthrough.
I’ve recently put together a CCTV solution using a few Foscam FI8918W cameras and the excellent ZoneMinder software. This is all running on a CentOS 5.5 virtual machine under Hyper-V (more on this setup another time). The Foscam cameras have pan, tilt and the ability to set and move to preset locations.

The Foscam control script for ZoneMinder which I found on the ZoneMinder wiki was a good starting point, but seemed to have left and right wired backwards, and didn’t support the presets. So I’ve updated it to fix those issues, the script is below.

To install: find where the control scripts are installed on your distro. In mine I found the files in:


If you’re not sure where to look, run the command:


This will return the location of one of the existing control scripts.

Once you’ve found them, create a new file called and paste the code below into it. As with the original script this assumes there is an admin user with no password on your camera. This will have to do until I can work out how to pass through a proper username and password from the ZoneMinder frontend.Update 27/02/2011: the username and password are now passed via the Control Device field. See below.

You’ll need to add the control script to the ZoneMinder interface and attach it to your camera. First make sure that ZoneMinder is configured to support controllable cameras. Open Options from the main console and click OPT_CONTROL in the System tab.

Then open the source options for the camera you want to control. Select the Control tab, and click Edit next to Control Type. Click the Add New Control button, then enter the following settings (Update 27/02/2011, see bottom of post for updated settings for IR control and username/password.):

Now save and close that window, and refresh the one for your camera. You should now see the Foscam FI8918W script in the list. Select it, and enter the IP address of the camera in the Control Address box. Make sure Controllable is ticked, then click Save.

Now if you view the camera you’ll have a Control option near the top. Click it to reveal the Pan/Tilt controls, along with the presets:

ZoneMinder Controls

That’s it. Enjoy your controllable cameras!

Download the script.

I’ll update this post when I work out the password passthrough and how to turn the IR LED on and off via ZoneMinder.

UPDATE 27/02/2011

The script now uses Sleep and Wake to turn the IR off and on and passes the username and password via the Control Device parameter. You’ll need to enable those options on the Main tab of the Control and put your username and password query string in the Control Device field, as below.

Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • USW Pro 24 PoE Teardown
  • 3D Rendering Your In-House GPS
  • Extracting a Full Day’s Video from UniFi NVR