Turn on/off motion detection (Motion & PIR combined)
Turn on/off PIR sensor (PIR Only)
Adjust motion sensitivity (Motion & PIR combined)
Toggle Night Vision On/Off/Auto
Turn on/off Video Recording to SD card
External Commands:
motionOn() - Video Motion Detection On
motionOff() - Video Motion Detection Off
pirOn() - PIR Motion Detection On
pirOff() - PIR Motion Detection Off
nvOn() - Night Vision On
nvOff() - Night Vision Off
nvAuto() - Night Vision Auto
vrOn() - Local Video Recording On
vrOff() - Local Video Recording Off
Prerequisites:
Fully configured DCS-942L camera on the same local network as your ST hub
Motion detection configured within local advanced camera settings (for motion detection / PIR sensor)
Email/FTP forwarding set up (for motion detection triggered pictures/video)
SD Card installed (for local video recording)
Installation Instructions:
Copy the DeviceType below
Go to âMy Device Handlersâ in the SmartThings IDE
Click the âCreate New Device Handlerâ button in the upper right corner
Click on the âFrom Codeâ tab and paste the GitHub code in the text box
Click on the âCreateâ button in the bottom left corner
Click on the âSaveâ and âPublishâ â âFor Meâ buttons
Go to the âMy Devicesâ tab in the IDE
Click on the âNew Deviceâ button in the upper right corner
Fill in the Name, Device Network ID, Type, Location and Hub
Name will be what shows up in the ST app
Device Network ID can be anything, the DTH will change this automatically when used
Type will be where you select the DTH you just created, it should show as âDCS-942Lâ
Location will be whatever location this device is installed at
Hub will be the name of the hub on the same local network as the camera.
Click the âCreateâ button
Open the SmartThings App on your smartphone and go to the âMarketplaceâ tab
Click on the âNot Yet Configuredâ button which should appear at the top of the list with a (1) next to it after a few seconds
Click on the Camera
Fill in all of the required information
Name will be what is shown in the Room and Thing views
Room will select which room the device exists in
Camera IP address should be the LOCAL IP address for the Camera
Camera Port should stay at â80â unless you have personally changed it
This is the LOCAL HTTP Port for the camera
Video IP address should be the LOCAL or EXTERNAL IP address for the camera
If you use the Local IP you will only be able to view the video stream while on the same network or while using a VPN connected to the network the camera is on.
If you use the External IP you need to make sure you set up port forwarding through your router
WARNING: Port forwarding will make your camera open to the internet, anyone with your IP/Port and credentials will be able to view your camera.
Video Port should be the LOCAL or EXTERNAL RTSP PORT for the camera
If you use a local IP address you must use a local port, if you use an external IP address you will need to use an external Port (which port forwarding to the camera set up)
The default local RTSP port is 554
Camera User is the Username used to get into the advanced settings, default is âadminâ
Camera Password is the Password used to get into the advanced settings
All Done! Now enjoy the added functionality of your DCS-942L camera!
This code is set up specifically for the DCS-942L however you could edit it to work with other cameras by finding their HTTP commands and substituting them in the code.
Hey Sean, as of right now the only support is for still pictures. ST hasnât opened up their video streaming code yet so I donât know if Iâd be able to get that working as well or not. They have previously mentioned that these older D-Link models will not be officially supported because they donât have the required technology built-in.
Hey blebson/Sean, Iâm new to the development side of Smartthings. How are you actually connecting your DCS-942L to smartthings? My hub cannot seem to see it. Any assistance would be appreciated.
Hey @chewymid, you have to add the device in the âmy devicesâ tab in the IDE. From there youâll assign the custom devicetype. Once you create the device manually you can fill in the local IP, local port, username and password within your smartthings app.
Just one thing to keep in mind, currently in the code the default âswitchâ for this device turns on/off motion detection. It does not effect the PIR sensor which has itâs own on/off button. If you turn on/off motion detection when you change modes it will not effect the PIR setting, meaning if PIR is on you will still get motion detection emails. To solve this and use both sensors I tied the two together in my personal version of the code but left this one alone so you could chose how you want to use it.
@blebson⌠Iâm fine with manually setting it up from its own interface as I have a mapped out motion area to capture. I was wondering if its possible to have the motion sensor read and alert just like a typical motion sensor? I have 2 of these camera facing outside and I would like to have alerts trigger upon movement. I have tried pointing motion sensors at a door thats 2 feet away from a window with no luck, just doesnât pickup⌠but my camera records perfectly with any motion (within my set parameters). I can modify the code to strip out the toggle buttons and sensitivity toggle as for what iâm doing they are not required. Any advice of where to start?
The issue I see is that the camera doesnât report to Smartthings unless itâs prompted by a command from the hub. Thereâs no way for Smartthings to âlistenâ for motion detection from what Iâve seen.
I havenât tried using the photo burst app, what Iâve done is set up the automatic e-mail feature of the d-link camera (using the local settings page) where it will email me 6 snapshots when the motion detection is active and senses motion. Then I have an IFTTT recipe which sends an alert to my Android Wear watch when I get an email thatâs filtered into a âSecurity Cameraâ folder in my Gmail account.
Youâll have to go to the âMy Devicesâ tab in the IDE and click the â+ New Deviceâ button in the upper right hand corner. Once in there youâll fill in all of the field and choose the custom DeviceType from the drop down list. Make sure to fill in everything except for Label (optional), Zigbee ID (not applicable), and group (youâll set this in the Smartthings app). For Device Network ID you can put any random letters and numbers in the field, the DeviceType will overwrite this field to get the camera to work.
Once youâve created the device, go to your smartphone app and go to the Marketplace (bottom right-most button). You will see that there is a device listed under the âNot Yet Configuredâ section, go in there and assign the camera to a room. Then go to the device in the Home Tab (second from the left on the bottom) and click the menu button in the upper right of the device screen. Click âEdit Preferencesâ and then fill in all of the fields.
Hopefully this clears it up for you, let me know if it works.
Ben - Good stuff. I applied it to a 930L and the image taking works fine but not the switch for motion detection. I looked at the log, and itâs returning a âfile not foundâ when firing the command to enable or disable (Cannot open URL(/etc_ro/web/config/motion.cgi,No such file or directory). Now if I enter âhttp://192.168.1.101/motion.cgiâ in browser it returns
Fantastic. That works. You should get a commission from ST! Iâm using the email feature built into the DLink. Itâs been a while since I played with the custom smartapps, but I assume since you have the motion on/off as a switch i should be able to turn it on or off with a smartapp, say if mode changes to away to turn it on. Any tips or tricks in this regard are also appreciated.