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.