Mastering IP Video Doorbell Integration: Two-Way Audio, Unlock, & Event-Driven Automations with Home Assistant

Represent Mastering IP Video Doorbell Integration: Two-Way Audio, Unlock, & Event-Driven Automations with Home Assistant article
3m read
Many smart home enthusiasts invest in video doorbells, but most cloud-dependent options limit local control and raise privacy concerns. Integrating an IP-based video doorbell directly into Home Assistant provides ultimate control, enabling two-way audio, remote door unlocking, and complex automations—all managed locally. This guide covers setting up video, SIP audio, event capture, and secure door access, creating a robust, private, and customizable security solution for your smart home.

1. Prerequisites & Network Configuration

First, assign a static IP address to your doorbell. Find its RTSP stream URL (e.g., rtsp://user:[email protected]:554/stream1) and any SIP credentials. Consider a dedicated IoT VLAN for security.

2. Integrating RTSP Stream for Live Video

Add your doorbell's RTSP stream to configuration.yaml using the generic camera integration:

camera:
  - platform: generic
    name: Front Doorbell Camera
    stream_source: rtsp://user:[email protected]:554/stream1
    still_image_url: http://192.168.1.100/snapshot.jpg # Optional
Restart HA. The camera.front_doorbell_camera entity provides a live feed for Lovelace.

Screenshot Placeholder: Lovelace card showing live doorbell video.

3. Enabling Two-Way Audio with SIP & go2rtc

go2rtc (HA Add-on or Docker) is excellent for two-way audio. Configure its sip section in go2rtc.yaml to register with your doorbell's SIP server or an external one.

sip:
  local_addr: 192.168.1.50 # HA/go2rtc IP
  listen: :5060
  auth:
    - name: ha_sip_user
      pass: ha_sip_pass
      # register: sip:doorbell_user:[email protected]:5060
Use the HACS SIP card in Lovelace for interactive video calls.

type: custom:sip-card
server: ws://192.168.1.50:8555/ws
video:
  url: 'rtsp://192.168.1.50:8555/doorbell'

Screenshot Placeholder: Lovelace SIP card for two-way audio and video.

4. Capturing Doorbell Button Events

Methods vary by doorbell. Choose based on your device's capabilities.
  • MQTT: (Recommended if supported)
    
    mqtt:
      binary_sensor:
        - name: "Front Doorbell Button"
          state_topic: "doorbell/front/button"
          payload_on: "pressed"
          device_class: "occupancy"
    
  • RESTful Sensor: (If doorbell has an API)
    
    sensor:
      - platform: rest
        name: "Doorbell Status"
        resource: http://192.168.1.100/api/status
        value_template: "{{ value_json.button_pressed }}"
        scan_interval: 5
    
These sensors enable event-driven automations.

5. Remote Door Unlocking (Securely)

Control an electric strike via a rest_command in configuration.yaml targeting a local relay (e.g., ESPHome).

rest_command:
  door_unlock_front:
    url: "http://192.168.1.200/relay/0?action=open" # ESPHome example
    method: POST
    headers: {Authorization: "Bearer YOUR_API_KEY"} # Security critical
Trigger with an input_button in Lovelace. Security Warning: Use strong authentication and network isolation for such critical actions.

Troubleshooting Section

  • Video: Check RTSP URL, credentials, IP. Test in VLC. HA logs.
  • Audio: go2rtc SIP registration, credentials, firewall for SIP/RTP ports.
  • Events: MQTT Explorer for topics, curl for REST API. HA automation traces.
  • Unlock: Test rest_command with curl. Verify relay. HA logs.

Advanced Configuration / Optimization

  • Intelligent Filtering: Use template binary sensors to combine/filter motion and button events for smarter triggers.
    
    binary_sensor:
      - platform: template
        sensors:
          visitor_alert:
            value_template: >
              {{ is_state('binary_sensor.button', 'on') and
                 (now() - states.binary_sensor.motion.last_changed).total_seconds() < 30 }}
    
  • Dynamic Notifications: Send snapshots with mobile notifications.
    
    # Automation action
    action:
      - service: camera.snapshot
        data: {entity_id: camera.front_doorbell_camera, filename: "/config/www/visitor.jpg"}
      - delay: "00:00:01"
      - service: notify.mobile_app_your_phone
        data: {message: "Visitor!", data: {image: "/local/visitor.jpg"}}
    

Real-World Example: Enhanced Front Door Security & Access


# automations.yaml
- alias: "Doorbell Press - Announce & Notify"
  trigger: {platform: state, entity_id: binary_sensor.front_doorbell_button, to: "on"}
  condition: "{{ is_state('input_boolean.doorbell_dnd', 'off') }}"
  action:
    - service: tts.google_translate_say
      data: {entity_id: media_player.google_home_mini, message: "Visitor at front door."}
    - service: camera.snapshot
      data: {entity_id: camera.front_doorbell_camera, filename: "/config/www/visitor.jpg"}
    - delay: "00:00:01"
    - service: notify.mobile_app_all_devices
      data: {message: "Visitor!", data: {image: "/local/visitor.jpg", clickAction: "/lovelace/doorbell-view"}}

- alias: "Lovelace Button - Unlock Gate"
  trigger: {platform: state, entity_id: input_button.unlock_gate, to: "on"}
  action:
    - service: rest_command.gate_unlock
    - service: persistent_notification.create
      data: {title: "Access Control", message: "Gate unlocked."}
This orchestrates alerts, proactive lighting (if configured), and secure remote access.

Best Practices / Wrap-up

  • Security: Strong passwords, IoT VLAN, disable cloud services, cautious port exposure.
  • Performance: Optimize video bitrate, minimize REST polling.
  • Reliability: Dedicated SIP server (if needed), persistent volumes, log monitoring.
  • Backup: Regular HA config backups, document doorbell settings.
Enjoy a highly integrated, secure, and feature-rich IP video doorbell experience with Home Assistant!
Avatar picture of NGC 224
Written by:

NGC 224

Author bio: DIY Smart Home Creator

There are no comments yet
loading...