Skip to content

Instantly share code, notes, and snippets.

@andersevenrud
Last active November 16, 2025 17:49
Show Gist options
  • Select an option

  • Save andersevenrud/55802c3b1996902fe45bf4a778a5ed07 to your computer and use it in GitHub Desktop.

Select an option

Save andersevenrud/55802c3b1996902fe45bf4a778a5ed07 to your computer and use it in GitHub Desktop.
D-Link DCS-5030L IP-Camera in Home Assistant

D-Link DCS-5030L IP-Camera in Home Assistant

This is a brief guide on how to set up this Camera in Home Assistant, including controls.

Might work with other models as well.

Screenshot 2025-11-16 at 18 09 46

Requirements

Assumes it has been set up on your local network either via the D-Link app or the integrated Web UI. Note that the integrated Web UI does not load on most modern browsers and requires changing the user agent using a user agent switcher (like uaswitcher on Firefox) and a Internet Explorer profile.

These are the required integrations:

Stream Setup

The camera provides endpoints with a video stream and still image. However the video will not work in HA using the Generic Camera integration.

A middleman is required to convert the stream into a useable format.

Set up go2rtc using the following configuration:

There is a H264 endpoint (/h264.mpt), but it doesn't seem to work properly. Endpoint below is MJPEG and quality can be turned up in the camera configuration utility.

  streams:
    dlink5030: http://admin:your_password_here@192.168.0.242/video.cgi

Dashboard Setup

Install WebRTC Camera and Button Card.

You have to set up go2rtc to be able to view the camera stream.

Configuration

In configuration.yaml set up the REST commands to control the camera:

rest_command:
  dsc5030_pan_tilt:
    authentication: digest
    username: !secret dlink5030_username
    password: !secret dlink5030_password
    url: "http://192.168.0.242/setControlPanTilt"
    method: post
    content_type: "application/x-www-form-urlencoded"
    payload: 'PanSingleMoveDegree={{ degrees }}&TiltSingleMoveDegree={{ degrees }}&PanTiltSingleMove={{ direction }}'
    headers:
      Referer: "http://192.168.0.242"
  dsc5030_set_home:
    authentication: digest
    username: !secret dlink5030_username
    password: !secret dlink5030_password
    url: "http://192.168.0.242/setControlPanTilt"
    method: post
    content_type: "application/x-www-form-urlencoded"
    payload: 'SetHomePosition='
    headers:
      Referer: "http://192.168.0.242"
  dsc5030_reset_home:
    authentication: digest
    username: !secret dlink5030_username
    password: !secret dlink5030_password
    url: "http://192.168.0.242/setControlPanTilt"
    method: post
    content_type: "application/x-www-form-urlencoded"
    payload: 'ResetHomePosition='
    headers:
      Referer: "http://192.168.0.242"

In secrets.yaml:

dlink5030_username: admin
dlink5030_password: your_password_here

Lovelance Video Card

Create a new "Manual" card with the following YAML:

type: custom:webrtc-camera
url: dlink5030

Lovelance Control Card

These controls will adjust the pan/tilt of the camera (home position / directions / set home / reset home) using a stack to show buttons in a single row.

Create a new "Manual" card with the following YAML:

type: horizontal-stack
cards:
  - type: custom:button-card
    icon: mdi:crosshairs
    tap_action:
      action: call-service
      service: rest_command.dsc5030_pan_tilt
      data:
        degrees: 4
        direction: 4
  - type: custom:button-card
    icon: mdi:arrow-bottom-left
    tap_action:
      action: call-service
      service: rest_command.dsc5030_pan_tilt
      data:
        degrees: 4
        direction: 6
  - type: custom:button-card
    icon: mdi:arrow-left
    tap_action:
      action: call-service
      service: rest_command.dsc5030_pan_tilt
      data:
        degrees: 4
        direction: 3
  - type: custom:button-card
    icon: mdi:arrow-top-left
    tap_action:
      action: call-service
      service: rest_command.dsc5030_pan_tilt
      data:
        degrees: 4
        direction: 0
  - type: custom:button-card
    icon: mdi:arrow-up
    tap_action:
      action: call-service
      service: rest_command.dsc5030_pan_tilt
      data:
        degrees: 4
        direction: 1
  - type: custom:button-card
    icon: mdi:arrow-down
    tap_action:
      action: call-service
      service: rest_command.dsc5030_pan_tilt
      data:
        degrees: 4
        direction: 7
  - type: custom:button-card
    icon: mdi:arrow-top-right
    tap_action:
      action: call-service
      service: rest_command.dsc5030_pan_tilt
      data:
        degrees: 4
        direction: 2
  - type: custom:button-card
    icon: mdi:arrow-right
    tap_action:
      action: call-service
      service: rest_command.dsc5030_pan_tilt
      data:
        degrees: 4
        direction: 5
  - type: custom:button-card
    icon: mdi:arrow-bottom-right
    tap_action:
      action: call-service
      service: rest_command.dsc5030_pan_tilt
      data:
        degrees: 4
        direction: 8
  - type: custom:button-card
    icon: mdi:target
    tap_action:
      action: call-service
      service: rest_command.dsc5030_set_home
  - type: custom:button-card
    icon: mdi:crosshairs-off
    tap_action:
      action: call-service
      service: rest_command.dsc5030_reset_home
grid_options:
  columns: full
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment