Reolink doorbell press button stream to chromecast now working but 23 sec till stream plays

My first automation and I was a little bit stuck. But answered my own question, so posted this in case it may help someone.

Although automation now working, it does take 23 seconds from doorbell pressed till stream playing. Changing ambient screen to black screen ahead of stream only takes 2 seconds. If I press the doorbell again shortly after, stream is nearly instant, presumable because it was still connected to the Chromecast.
Any suggestions how to start playing stream faster? Or make it cast permanently but only flip from ambient to fluent stream till doorbell pressed?

My setup is

  • Reolink POE doorbell with FTP enabled
  • Raspberry Pi 4b running Home Assistant
  • Chromecast 2nd gen
  • All running latest firmware, HA and Reolink integration versions

Objective

  • Press doorbell, display video stream to monitor connected to Chromecast device for a few minutes then return to ambient slide show.

My automation

  • When: doorbell pressed turned on
  • Then do: Play Fluent on Hall Screen
    Delay for 300 seconds (30 during testing)
    Mediaplayer “Turn off” on Hall Screen

What happens

  • If I press the doorbell, the ambient screen turns to a blue cast logo on black screen, then black screen with a line at the bottom indicating about to stream a video. Then a few seconds later just black screen. After 2 minutes back to casting logo, then after 7m7s back to ambient screen.

My trace timeline (anonymised) shows

Triggered by the state of binary_sensor.doorbell_visitor at 12 March 2024 at 22:15:33

Play Fluent on Hall Screen

3 seconds later

(media_player.hall_screen) turned idle

1 second later

(media_player.hall_screen) turned buffering

Stopped because an error was encountered at 12 March 2024 at 22:16:03 (runtime: 30.06 seconds)

Execution of quick play http://192.168.xxx.xxx:8123/api/hls/xxx/master_playlist.m3u8?authSig=xxx timed out after 30.0 s.

How I fixed it

  • A simple setting I must have set at some point. Device > Reolink IP NVR/camera > Configure > Protocol = RTMP. Changing to RTSP made it all come alive. But a bit slow to get going.

So solved my 23 sec delay to cast to my screen. It is now <1 sec.

Settings > Devices & Services > Reolink IP NVR/Camera > 1 Device > Fluent > * > Preload camera stream = On

Video displayed but time shifted by about 30 seconds earlier. Does not bother me and quite useful.

What a great device. FTP to my own NAS, announcements and video on an old monitor, new use of my old RPi.

HA has opened a whole new world. My To-do lists is growing :slight_smile:

1 Like

Thanks for posting !

do you mind sharing your script?

Sure. But be aware I only used the visual editor to configure this.

alias: Doorbell Pressed
description: If doorbell is pressed, show video on hall screen
trigger:
  - type: turned_on
    platform: device
    device_id: [your device]
    entity_id: [your entity]
    domain: binary_sensor
    for:
      hours: 0
      minutes: 0
      seconds: 0
condition: []
action:
  - service: media_player.play_media
    target:
      entity_id: media_player.hall_screen
    data:
      media_content_id: media-source://camera/camera.doorbell_fluent
      media_content_type: application/vnd.apple.mpegurl
    metadata:
      title: Fluent
      thumbnail: /api/camera_proxy/camera.doorbell_fluent
      media_class: video
      children_media_class: null
      navigateIds:
        - {}
        - media_content_type: app
          media_content_id: media-source://camera
  - delay:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0
  - service: media_player.turn_off
    metadata: {}
    data: {}
    target:
      device_id: [your device]
mode: single