[OBSOLETE] D-Link DCS-5222L HD PTZ IP Camera DeviceType - Full feature support (Now With Video Streaming!)

##This DeviceType is Obsolete, Please use the following SmartApp instead:

D-Link DCS-5222L Device Type.

This Device Type will add expanded functionality which is missing from the default DTH. You will still need to use the default SmartThings integration in order to view live video and record using their video service. Both this and the default device type can be used concurrently.

Features:

  • In-App Video streaming w/ sound
  • Still Image Capture and Display
  • Full Pan/Tilt support
  • Move to ‘Home’ location
  • Move to Preset location (by name)
  • Turn on/off motion detection (Motion Only)
  • 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
  • left() - Move Camera Left
  • right() - Move Camera Right
  • up() - Move Camera Up
  • down() - Move Camera Down
  • home() - Move to ‘Home’ position
  • presetOne() - Move to Preset position 1 defined in DTH settings
  • presetTwo() - Move to Preset position 2 defined in DTH settings
  • presetThree() - Move to Preset position 3 defined in DTH settings
  • presetCommand( String preset-name ) - Move to Preset position (position name passed as a string)

Prerequisites:

  • Fully configured DCS-5222L camera on the same local network as your ST hub
  • Motion detection configured within local advanced camera settings (for motion detection / PIR sensor)
  • Events created in local advanced camera settings to respond to the motion trigger (email/FTP/SD Image/video)
  • SD Card installed (for local video recording)
  • Video settings configured within local advanced camera settings (defaults to profile 1)
  • Preset and Home positions configured within the local advanced camera settings

Installation Instructions:

  1. Copy the DeviceType below
  2. Go to ‘My Device Handlers’ in the SmartThings IDE
  3. Click the “Create New Device Handler” button in the upper right corner
  4. Click on the “From Code” tab and paste the GitHub code in the text box
  5. Click on the “Create” button in the bottom left corner
  6. Click on the “Save” and “Publish” → “For Me” buttons
  7. Go to the “My Devices” tab in the IDE
  8. Click on the “New Device” button in the upper right corner
  9. 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-5222L”
  • 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.
  1. Click the “Create” button
  2. Open the SmartThings App on your smartphone and go to the “Marketplace” tab
  3. 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
  4. Click on the Camera
  5. 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
  • Camera Preset 1-3 is the preset number which has been set up in the advanced settings
  1. All Done! Now enjoy the added functionality of your DCS-5222L camera!

Compatible Custom SmartApps:


5 Likes

This DTH has been updated to add full in-app video streaming support.

1 Like

Updated to fix an iOS bug which would cause the ST app to crash.

##DCS-5222L DeviceType is Obsolete, Please use the following SmartApp instead: