Openhab 2 Rules & Sitecom WLC-1000 Camera Script

I have openhab running as my home automation system, which allows me to control my lights and in-house ventilation system. And I have setup some nice rules to automate as much as possible, now I want to update my WLC-1000 cameras settings through openhab.


Recently I bought some Sitecom WLC-1000 Cameras in a sale on iBOOD for a great price, I will make a short review and some dissecting / exploring them in another post.

Bottom line is, they are quite good for indoors, but the software isn’t that great, for instance I can set to enable motion detection, but I can’t specify any time range for this (I don’t want the cams recording all day, because they will keep sending notifications every minute, when movement is detected (or sound if you enable it.), and I don’t want to need to enable motion on every single cam every night / morning when away..

After some digging and playing around I found you can post setting strings to this url:
the settings to enable motion detection through posting an xml:


and to disable:


I created 2 simple python files, which I can later execute in openhab when certain conditions are met.
The turn motion detection on file:

# -*- coding: utf-8 -*-
import requests

headers = {'Content-Type': 'application/xml'}
print'http://YOUR_CAM_IP/CGI/CameraSetup', data=xml, headers=headers).text

In order to test this in openhab, I created a switch in my cam.items file

Switch enableCams

and created a cams.rules file, which has:

rule "Switch On Motion Recording"
		Item enableCams received command ON
		val result = executeCommandLine("python /home/openhabian/python/",2000)
		logInfo("Switching on motion detection", result)

I added some logging to check the response from the cam in my openhab eventlog (/var/log/openhab2/openhab.log) and sure enough there it is:


If you would like to enable audio detection in the same way, just replace the xml with:


I will follow up with more info on the sitecom’s camera settings in a later post.

Leave a Reply

Your email address will not be published.