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:
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:
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.
Arming the device is done by the following script:
- GET /set_alarm.cgi?motion_armed=1&user=YOURADMINUSER&pwd=YOURPASSWORD HTTP/1.10x0D0x0A0x0D0x0A
- motion_armed= 1 (armed) or 0 (disarmed)
- youradminuser= your admin username
- 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