[RELEASE] D-Link Camera Virtual Switch Controller


(Ben Lebson) #1

##D-Link Camera Virtual Switch Controller

This SmartApp will allow you to tie a switch (or virtual switch) to any of your D-Link camera’s custom commands.

Want to turn the PIR sensor on/off when you run your ‘Goodbye!’ routine? Done. Want the camera to move to a preset position when someone hits a light switch? Done.

##Installation Instructions:

  1. Add the Github Repo to your IDE with the following settings:
  • Owner: blebson
  • Name: dlink-virtual-switch-controller
  • Branch: master
  1. Go to the “My SmartApps” tab in the IDE and click
  2. Select dlink-virtual-switch-controller (master) from the drop-down menu.
  3. Select the SmartApp in the ‘New’ tab.
  4. Click on ‘Execute Update’
  5. In your ‘My SmartApps’ section of IDE, select open:
  6. When the SmartApp opens, click Publish -> For Me
  7. Now, go into the SmartThings App on your phone/tablet
  8. Go to the ‘Marketplace’ tab in the bottom right.
  9. Go to the ‘SmartApps’ tab and select ‘My Apps’
  10. Select “D-Link Camera Virtual Switch Controller”
  11. Follow the instructions to set up the SmartApp

##GitHub Repo:

##Compatible Cameras:

Any camera supported by the D-Link Camera Manager (Connect) SmartApp will work with this. See the following post for a list of compatible cameras:

[RELEASE] D-Link Camera Manager (Connect) - Add your D-Link IP Cameras to SmartThings! Video Streaming, Image Capture, Motion Detection and more
(Tim Slagle) #2

(Jared) #3

Hey Ben, amazing work with these apps!

I’m having some trouble with a 2630L and this app. I’ve created a virtual (simulated) switch which I’m hoping to use to turn on and off motion detection on the 2630L. I’ve verified that I’ve setup the camera correct and I have no issues enabling / disabling the motion detection from the ST device itself (verified in the web UI, works wonderfully). I successfully setup an instance of this smart app tying to together the virtual switch and the motion option the camera - no errors in the live logs. However, whenever I manually flip the virtual switch the HTTP request does not actually trigger on the camera ST device.

When I manually toggle the virtual switch on / off here are the logs:

8b8f2862 11:17:07 AM: debug State Changed to Off. 1abc9312 11:17:07 AM: debug PUBLISHED on()

(8b8f2862 is the virtual switch controller, 1abc9312 is the virtual switch)

The message doesn’t make it to the camera device. I tried re-saving the switch controller:

8b8f2862 11:16:45 AM: debug Updated with settings: [mySwitch:Virtual Camera Motion Switch, camera:Yoshi Cam, commandOn:motionOn, commandOff:motionOff]

If that helps. Not sure what I’m missing at this point. I’ve included a screenshot of the configuration of the switch controller as well.

(Ben Lebson) #4

It looks like there is a bug with motion right now that I will fix shortly. I want to point out, however, that motion on/off is the default command on the camera so if you use the camera as a normal switch in a routine or SmartApp it will toggle the motion detection.

I’ll let you know once I’ve updated the code.

(Jared) #5

Ah, I completely missed that it’s the default command. That simplifies things greatly. Thanks again for all your hard work!

(Ben Lebson) #6

No worries. I’ve updated the SmartApp so that it should work for motion commands now. I’ve also updated the D-Link Camera Manager post to show the default commands more clearly.

(Greginfla) #7

I am new to ip cameras… do I need three different ip address for a camera? one for camera itself, two for video, and third for photos… any help/links setting up the camera would be appreciated.

(Ben Lebson) #8

There is one internal and one external IP for a camera. You should use the internal IP on everything except for video if you are looking to access it externally.