Managing my camera’s with Fibaro HC2

My camera’s are all Foscam like camera’s and work well with the Foscam driver. These camera’s (and also many other camera’s) conform to the following standaard: IPCAM CGI SDK V1.7.

All camera’s are equiped with an alarm function which is capable of sending pictures in case of an (motion-based) event. This only works when the camera is in armed mode. In unarmed mode, the camera may not sent anything.

For my own convienience I would like to let Fibaro handle the arm and disarm modes of the camera’s. I already configured my camera’s with Fibaro HC2. See also Adding Foscam like camera’s to Fibaro HC2.

Within Fibaro, the function of Virtual Device can be used for this. The functionality will (for now) be limited to:

  • arm the camera;
  • disarm the camera;

Start with creating a virtual device:

Virtual Device - Camera Motion Detection
Virtual Device – Camera Motion Detection

The settings for this device are the same as for the camera. For your own convience use another name e.g. indicating the motion detection. I called mine Motion <ROOM> as I have 4 camera’s in 4 different rooms. You may choose whatever name you like.

Configure the virtual device with the following list of buttons:

Virtual Device - Number of buttons
Virtual Device – Number of buttons

I only use 2 buttons here. One for arming the system and one for disarming the system.

Last step is to define the scripts that needs to be performed when the buttons are pushed. Basically the communiction with the Foscam like camera is done via HTTP. The manual mentioned above gives you an idea of which parameters may be passed in the commands.

Virtual Device - Configuration
Virtual Device – Configuration

Arming the device is done by the following script:

  • GET /set_alarm.cgi?motion_armed=1&user=YOURADMINUSER&pwd=YOURPASSWORD HTTP/1.10x0D0x0A0x0D0x0A

where:

  1. motion_armed= 1 (armed) or 0 (disarmed)
  2. youradminuser= your admin username
  3. yourpassword = your admin password

The string at the end (HTTP …) must be attached to every command. It is just to indicate the type of request.

Disarming the device script is straightforward:

  • GET /set_alarm.cgi?motion_armed=0&user=YOURADMINUSER&pwd=YOURPASSWORD HTTP/1.10x0D0x0A0x0D0x0A

Other commands can be found here:  IPCAM CGI SDK V1.7.