Skip to content

Ring WebRTC live-view sessions remain active after frontend closes, suppressing subsequent doorbell events #177014

Description

@ben79

The problem

A Ring live-view WebRTC session created by the Home Assistant Ring camera integration remains active after the frontend camera viewer has been dismissed.

The WebRTC signalling session continues sending keepalive pings indefinitely because the Ring camera platform passes keep_alive_timeout=None to generate_async_webrtc_stream().

This leaves the Ring device in an active on-demand live-view state. While that session remains active, subsequent physical doorbell presses do not produce usable ding events. Multiple abandoned live-view sessions can accumulate.

Restarting Home Assistant closes the abandoned sessions and restores normal ding-event behaviour.

Changing the Home Assistant Ring camera implementation locally from:

keep_alive_timeout=None

to:

keep_alive_timeout=45

causes the abandoned session to stop receiving keepalive pings. Ring then closes the session with:

Close message received: {'code': 6, 'text': 'Timeout waiting for ping'}
Closing the RTC Stream

This demonstrates that the unlimited Home Assistant keepalive is material to the problem.

The ideal fix may be to ensure that a Ring WebRTC stream is closed immediately when the final frontend consumer unsubscribes. A finite timeout would also provide a safety net where a frontend disconnects uncleanly.

What version of Home Assistant Core has the issue?

2026.7.2

What was the last working version of Home Assistant Core?

Unknown — this is the first version tested with this Ring device.

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Ring

Link to integration documentation on our website

https://www.home-assistant.io/integrations/ring/

Diagnostics information

config_entry-ring-01KXRR894MG0V6NS300VW7KSDN.json

Example YAML snippet

alias: Doorbell fullscreen popup
description: Show Ring live view on iPad for 45 seconds

triggers:
  - trigger: state
    entity_id: event.driveway_front_door_ding
    not_from:
      - unavailable
      - unknown

  - trigger: state
    entity_id: input_button.doorbell_test

conditions: []

actions:
  - action: notify.mobile_app_mums_ipad
    data:
      message: kiosk_hide_screensaver

  - delay:
      seconds: 1

  - action: notify.mobile_app_mums_ipad
    data:
      message: kiosk_show_camera
      data:
        entity_id: camera.front_door_live_view

  - delay:
      seconds: 45

  - action: notify.mobile_app_mums_ipad
    data:
      message: kiosk_hide_camera

  - delay:
      seconds: 2

  - action: notify.mobile_app_mums_ipad
    data:
      message: kiosk_show_screensaver

mode: single
max_exceeded: silent

Anything in the logs that might be useful for us?

DEBUG [ring_doorbell.webrtcstream] camera_started message received
DEBUG [ring_doorbell.webrtcstream] Pong message received
DEBUG [ring_doorbell.webrtcstream] Pong message received
...
# Pongs continued indefinitely after the frontend camera overlay disappeared.
# No "Closing the RTC Stream" message was produced.

# After a second live-view test, two independent five-second pong sequences
# were visible simultaneously, indicating two active WebRTC sessions.

# Restarting Home Assistant:
DEBUG [ring_doorbell.webrtcstream] Closing the RTC Stream
DEBUG [ring_doorbell.webrtcstream] Closing the RTC Stream

# With local camera.py patch:
# keep_alive_timeout=None -> keep_alive_timeout=45

DEBUG [ring_doorbell.webrtcstream] camera_started message received
DEBUG [ring_doorbell.webrtcstream] Pong message received
...
DEBUG [ring_doorbell.webrtcstream] Close message received: {'code': 6, 'text': 'Timeout waiting for ping'}
DEBUG [ring_doorbell.webrtcstream] Closing the RTC Stream


RuntimeError: Task cannot await on itself:
<Task pending ... coro=<RingWebRtcStream.reader()>>

Call path:
RingWebRtcStream.reader
handle_message
handle_close_message
_close
_close_callback
close_webrtc_stream
RingWebRtcStream.close
RingWebRtcStream._close

Additional information

The Ring device is a 2026 Ring Wired Video Doorbell, marketed as “Retinal 2K”. Its API device kind is doorbell_tahoe, and its firmware is cam-20.4.600.

The device-kind classification issue is separate from this report. I locally added doorbell_tahoe to DOORBELL_WIRED_KINDS, after which the ding and motion event entities were created and worked correctly.

Reproduction steps:

  1. Start Home Assistant with the unmodified Ring camera integration, where keep_alive_timeout=None.
  2. Open camera.front_door_live_view through a frontend WebRTC camera viewer.
  3. Close or dismiss the frontend camera viewer after approximately 45 seconds.
  4. Observe that ring_doorbell.webrtcstream continues receiving pong messages indefinitely.
  5. Start live view again and observe that another session can be created while the first continues.
  6. Press the physical doorbell while an abandoned live-view session is active. The normal ding event is not received.
  7. Restart Home Assistant. The active streams are closed and ding events resume.
  8. Modify homeassistant/components/ring/camera.py to pass a finite keep_alive_timeout.
  9. Repeat the test. Ring closes the session after keepalive messages cease.

The local finite-timeout patch is a workaround rather than necessarily the final design. A robust fix would ideally:

  • close a Ring WebRTC session when its last Home Assistant frontend consumer unsubscribes;
  • prevent abandoned sessions if the frontend disconnects unexpectedly;
  • use a finite failsafe rather than an unlimited keepalive;
  • avoid the Task cannot await on itself error during server-initiated closure.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions