Enable/Disable Motion Detection on D-Link DCS-933L via Vera

I have a DCS-933L camera mainly because of it’s ability to record video when motion is detected rather than stills as the Foscams do. This is a great feature but uses a boat-load of unnecessary FTP bandwidth when I’m home and don’t want it to detect motion. I want to be able to turn this feature on when I activate the “Leave” scene and turn off when I activate the “Home” scene in Vera.
I have scoured the internet but can’t seem to find anything that works… I can see the status of the feature by issuing this command in a browser:
http://CameraIP/motion.cgi
But the following command does not flip the bit from 1 to 0 as expected:
http://CameraIP/motion.cgi?MotionDetectionEnable=0
I have also tried issuing the following curl command from Terminal in Ubuntu but still no luck:
curl -v --user admin:password --data “MotionDetectionEnable=0” http://192.168.0.108/motion.cgi
The response I get is:

  • Hostname was NOT found in DNS cache
  • Trying 192.168.0.108…
  • Connected to 192.168.0.108 (192.168.0.108) port 80 (#0)
  • Server auth using Basic with user ‘admin’

POST /motion.cgi HTTP/1.1
Authorization: Basic YWRtaW46d2FjMzkx
User-Agent: curl/7.35.0
Host: 192.168.0.108
Accept: /
Content-Length: 20
Content-Type: application/x-www-form-urlencoded

  • upload completely sent off: 20 out of 20 bytes
  • HTTP 1.0, assume close after body
    < HTTP/1.0 200 OK
    < Server: alphapd
    < Date: Sat Jan 1 00:00:05 2000
    < Pragma: no-cache
    < Cache-Control: no-cache
    < Content-type: text/plain
    <
    MotionDetectionEnable=1
    MotionDetectionBlockSet=0000000100001000010000100
    MotionDetectionSensitivity=90
    MotionDetectionScheduleMode=0
    MotionDetectionScheduleDay=0
    MotionDetectionScheduleTimeStart=00:00:00
    MotionDetectionScheduleTimeStop=00:00:00
  • Closing connection 0

I also found this post by Rob Vella and used some pieces from it but STILL no luck!:
http://robvella.com/2013/05/simple-script-to-enable-disable-dcs-930l-motion-detection/

Has anyone been able to get this working with this camera?

Thanks,
Grant

I figured it out!! ;D
I installed the “Live HTTP Headers” add-on in Firefox so I could see exactly what was being passed when enabling/disabling through the browser, then I copied the line where the parameter was being modified (see --data "… below) into the os.execute luup command with the additional curl parameters and it worked!
In my “Leave” scene, I added the following in the LUUP section to enable motion detection:
os.execute(‘curl --user admin:password --data “ReplySuccessPage=motion.htm&ReplyErrorPage=motion.htm&MotionDetectionEnable=1&MotionDetectionScheduleDay=0&MotionDetectionScheduleMode=0&MotionDetectionSensitivity=90&ConfigSystemMotion=Save” http://192.168.0.108/setSystemMotion’)

and in the “Home” scene, I have the following to disable motion detection:
os.execute(‘curl --user admin:password --data “ReplySuccessPage=motion.htm&ReplyErrorPage=motion.htm&MotionDetectionEnable=0&MotionDetectionScheduleDay=0&MotionDetectionScheduleMode=0&MotionDetectionSensitivity=90&ConfigSystemMotion=Save” http://192.168.0.108/setSystemMotion’)

Using this same format, and help from the headers one should be able to modify any parameter in a D-Link camera.

Now all I need to figure out is how to get D-Link to tell Vera that motion was detected so I can send a notification.
Anyone have any ideas on that one??

Grant

I’m trying to do exactly what you just did but with a HIKVISION. I’m a newbie - do you mind posting your code and more details on how you got it going? I’m going to see if I can port that over to the HIKVISION equivalent.