Ring Device integration via MQTT w/ Video Streaming

Hello. I I am using webrtc with ring camera abs the stream will not stop. Is there a simple line of code I need to allow it to time out?

Thank you for ring-Mqtt it’s all work it’s just not timing out

Not sure what you mean exactly, what webrtc are you using specifically? If you are just using the normal Home Assistant UI then it uses stream backend which is based on HLS, this times out after 5 minutes (too long, but hard coded, I can’t do anything about it), as long as you have followed the recommended setup and not enabled pre-load stream or “live” settings in UI.

Thanks, I actually had it open in my computer browser along with my iPhone. That’s why it kept streaming lol

One more quick question is there a way to integrate the microphone into this that you would normally see on the Ring app? If not it’s not a big deal I just figured I would ask

Not currently. The native HLS stream component in HA is not bi-directional. Now, in the future, if the Home Assistant WebRTC support continues to improve, then I’m guessing they could just use the native stream directly from Ring.com and not even need anything in ring-mqtt and, in that case, microphone support could come, but that day is not today!

1 Like

Live stream is no longer working. This from the logs:

2022-05-20T19:56:19.122Z ring-rtsp INF [RTSP] [conn 172.30.32.1:50340] opened
2022-05-20T19:56:19.504Z ring-rtsp INF [API] [conn 127.0.0.1:49198] GET /v1/paths/list
2022-05-20T19:56:19.507Z ring-mqtt [Front Door] Ring live stream has stopped publishing, killing the keepalive stream
2022-05-20T19:56:19.511Z ring-mqtt [Front Door] The keepalive stream has stopped
2022-05-20T19:56:24.503Z ring-rtsp INF [path e04f43a47a81_live] runOnDemand command stopped
2022-05-20T19:56:24.504Z ring-rtsp INF [RTSP] [conn 172.30.32.1:50340] closed (source of path 'e04f43a47a81_live' has timed out)
2022-05-20T19:56:24.504Z ring-rtsp INF [RTSP] [conn 127.0.0.1:51576] closed (source of path 'e04f43a47a81_live' has timed out)
2022-05-20T19:56:24.505Z ring-rtsp [Front Door] Deactivating live stream due to signal from RTSP server (no more active clients or publisher ended stream)
2022-05-20T19:56:24.517Z ring-mqtt [Front Door] Received set live stream state OFF
2022-05-20T19:56:24.517Z ring-mqtt [Front Door] Stopping live stream session on workerId 1

Any ideas?

Hopefully someone can help me. I’m trying to set a generic camera with rtsp, but I can’t figure it out.
I’m using the docker install along with mosquitto in docker. The device is found and snapshots work just fine.

The logs show this when starting the container

2022-05-23T14:05:46.080Z ring-mqtt Detected 8 CPU cores, starting 4 live stream workers
2022-05-23T14:05:47.096Z ring-rtsp ------------------------------------------------------------------------------------------
2022-05-23T14:05:47.096Z ring-rtsp Starting rtsp-simple-server process...
2022-05-23T14:05:47.162Z ring-rtsp INF rtsp-simple-server v0.18.2
2022-05-23T14:05:47.163Z ring-rtsp INF [RTSP] listener opened on 0.0.0.0:8554 (TCP)
2022-05-23T14:05:47.163Z ring-rtsp INF [API] listener opened on 127.0.0.1:8880
2022-05-23T14:05:48.143Z ring-rtsp Creating RTSP paths for all cameras...
2022-05-23T14:05:48.157Z ring-rtsp INF [API] [conn 127.0.0.1:45662] POST /v1/config/paths/add/9c7613398876_live
2022-05-23T14:05:48.159Z ring-rtsp INF reloading configuration (API request)
2022-05-23T14:05:48.173Z ring-rtsp INF [API] [conn 127.0.0.1:45664] POST /v1/config/paths/add/9c7613398876_event
2022-05-23T14:05:48.174Z ring-rtsp INF reloading configuration (API request)

And the the info sensor show the following data:

rtsp://user:[email protected]:8554/9c7613398876_live

When using this info with the generic camera component it throws an unknown error ocurred.

Can someone give me a hand here please?

Cheers

Edit: For completion, this is what the logs say about the RTSP service

2022-05-24T10:12:06.784Z ring-mqtt [Front Door] Received set live stream state ON
2022-05-24T10:12:06.784Z ring-mqtt [Front Door] Starting a keepalive stream for camera
2022-05-24T10:12:06.811Z ring-mqtt [Front Door] The keepalive stream has started
2022-05-24T10:12:06.821Z ring-rtsp INF [RTSP] [conn 127.0.0.1:40772] opened
2022-05-24T10:12:06.822Z ring-rtsp INF [path 9c7613398876_live] runOnDemand command started
2022-05-24T10:12:06.826Z ring-rtsp [Front Door] Sending command to activate live stream ON-DEMAND
2022-05-24T10:12:06.841Z ring-mqtt [Front Door] Received set live stream state ON-DEMAND
2022-05-24T10:12:06.842Z ring-mqtt [Front Door] ring/ad5195e5-48d9-4198-84d1-6893943d3f1a/camera/9c7613398876/stream/state ON
2022-05-24T10:12:06.842Z ring-attr [Front Door] ring/ad5195e5-48d9-4198-84d1-6893943d3f1a/camera/9c7613398876/stream/attributes {"status":"activating"}
2022-05-24T10:12:06.846Z ring-mqtt [Front Door] Starting a live stream session via Ring servers
2022-05-24T10:12:06.946Z ring-rtsp [Front Door] State indicates live stream is activating
2022-05-24T10:12:07.470Z ring-mqtt [Front Door] Live stream assigned to worker 1 with 0 current active sessions
2022-05-24T10:12:11.817Z ring-rtsp INF [API] [conn 127.0.0.1:43038] GET /v1/paths/list
2022-05-24T10:12:11.819Z ring-mqtt [Front Door] Ring live stream has stopped publishing, killing the keepalive stream
2022-05-24T10:12:11.822Z ring-mqtt [Front Door] The keepalive stream has stopped
2022-05-24T10:12:14.897Z ring-mqtt [Front Door] Requesting an updated interval snapshot
2022-05-24T10:12:15.508Z ring-mqtt [Front Door] Successfully retrieved updated snapshot
2022-05-24T10:12:15.508Z ring-mqtt [Front Door] ring/ad5195e5-48d9-4198-84d1-6893943d3f1a/camera/9c7613398876/snapshot/image <binary_image_data>
2022-05-24T10:12:15.508Z ring-attr [Front Door] ring/ad5195e5-48d9-4198-84d1-6893943d3f1a/camera/9c7613398876/snapshot/attributes {"timestamp":1653387136}
2022-05-24T10:12:16.823Z ring-rtsp INF [path 9c7613398876_live] runOnDemand command stopped
2022-05-24T10:12:16.823Z ring-rtsp INF [RTSP] [conn 127.0.0.1:40772] closed (source of path '9c7613398876_live' has timed out)
2022-05-24T10:12:16.824Z ring-rtsp [Front Door] Deactivating live stream due to signal from RTSP server (no more active clients or publisher ended stream)
2022-05-24T10:12:16.836Z ring-mqtt [Front Door] Received set live stream state OFF
2022-05-24T10:12:16.836Z ring-mqtt [Front Door] Stopping live stream session on workerId 1
2022-05-24T10:12:44.903Z ring-mqtt [Front Door] Requesting an updated interval snapshot
2022-05-24T10:12:56.652Z ring-rtsp INF [RTSP] [conn 127.0.0.1:39506] opened
2022-05-24T10:12:56.656Z ring-rtsp INF [path 9c7613398876_live] runOnDemand command started
2022-05-24T10:12:56.662Z ring-rtsp [Front Door] Sending command to activate live stream ON-DEMAND
2022-05-24T10:12:56.678Z ring-mqtt [Front Door] Received set live stream state ON-DEMAND
2022-05-24T10:12:59.904Z ring-mqtt [Front Door] Error: Snapshot for Front Door (doorbell_graham_cracker - Doorbell Wired) failed to refresh after 15 seconds
2022-05-24T10:12:59.904Z ring-mqtt [Front Door] Failed to retrieve updated snapshot
2022-05-24T10:13:06.659Z ring-rtsp INF [path 9c7613398876_live] runOnDemand command stopped
2022-05-24T10:13:06.659Z ring-rtsp INF [RTSP] [conn 127.0.0.1:39506] closed (source of path '9c7613398876_live' has timed out)
2022-05-24T10:13:06.659Z ring-rtsp [Front Door] Deactivating live stream due to signal from RTSP server (no more active clients or publisher ended stream)
2022-05-24T10:13:06.667Z ring-mqtt [Front Door] Received set live stream state OFF
2022-05-24T10:13:06.667Z ring-mqtt [Front Door] Stopping live stream session on workerId 1
2022-05-24T10:13:13.478Z ring-rtsp INF [RTSP] [conn 127.0.0.1:40990] opened

This has something to do with MQTT no passing the data? I’ve read somewhere in this post about this possibility.

1 Like

Hi could anyone help? Getting error on my log “s6-overlay-suexec: fatal: can only run as pid 1” fresh install with latest vestion HA

Thanks Steve

Mine closes from time to time and I have to restart the addon and then it works again.

This is the log, when it crashes:

2022-05-25T04:44:30.029Z ring-rtsp INF [RTSP] [conn 172.30.32.1:59200] opened
2022-05-25T04:44:30.030Z ring-rtsp INF [path 9c7613348770_live] runOnDemand command started
2022-05-25T04:44:30.032Z ring-rtsp [Haustür] Sending command to activate live stream ON-DEMAND
2022-05-25T04:44:30.036Z ring-mqtt [Haustür] Received set live stream state ON-DEMAND
2022-05-25T04:44:40.031Z ring-rtsp INF [path 9c7613348770_live] runOnDemand command stopped
2022-05-25T04:44:40.034Z ring-rtsp INF [RTSP] [conn 172.30.32.1:59200] closed (source of path '9c7613348770_live' has timed out)
2022-05-25T04:44:40.034Z ring-rtsp [Haustür] Deactivating live stream due to signal from RTSP server (no more active clients or publisher ended stream)
2022-05-25T04:44:40.037Z ring-mqtt [Haustür] Received set live stream state OFF
2022-05-25T04:44:40.037Z ring-mqtt [Haustür] Stopping live stream session on workerId 1
2022-05-25T04:44:50.065Z ring-mqtt [Haustür] Snapshots are unavailable, check if motion capture is disabled manually or via modes settings
2022-05-25T04:45:20.065Z ring-mqtt [Haustür] Snapshots are unavailable, check if motion capture is disabled manually or via modes settings

It looks like Timed out… Any ideas what could solve this? This happens every day once but not on the same time.

Currently running version 5.0.1, and curious if live streaming of video from Ring door bells still works, or is it just snapshot support on the latest versions?

For me everything works just like before. What are you experiencing?

@mhoogenbosch previously I had the camera video entity added to a picture glance card, and when you clicked on it it would open the live feed in a pop-up. Now the pop-up opens with the title bar, but no video loads. Nothing has changed on my Ring setup, just various HA updates, etc.

I’m getting the error below in the logs:

Logger: homeassistant.components.stream.stream.camera.front_door_video
Source: components/stream/__init__.py:347
Integration: Stream ([documentation](https://www.home-assistant.io/integrations/stream), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+stream%22))
First occurred: 26 May 2022, 19:04:44 (113 occurrences)
Last logged: 12:48:58

Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsp://xxx-ring-mqtt:8554/f8369b2e97f7_live

But I have confirmed that the stream URL matches what is under the camera attributes:

Attributes

BatteryLevel
97

FirmwareStatus
Up to Date

LastUpdate
27 May 2022, 05:27:09

WirelessNetwork
xxx-iot

WirelessSignal
-51

Stream Source
rtsp://xxx-ring-mqtt:8554/f8369b2e97f7_live

Still Image URL
https://homeassistant:8123{{ states.camera.front_door_snapshot.attributes.entity_picture }}

I did also spot this in the logs:

Loading generic IP camera via configuration.yaml is deprecated, it will be automatically imported. Once you have confirmed correct operation, please remove 'generic' (IP camera) section(s) from configuration.yaml

But the doco still mentions configuring the generic camera, so I assume that is still the recommended option? Video Streaming · tsightler/ring-mqtt Wiki · GitHub

Cheers,
Zolt

@tsightler - Any idea why adding Generic Cameras (various different ring cameras) to a lovelace card for live streaming on-demand actually ends up causing my ring cameras to live stream 24/7 (in chunks of 10-12minutes)? It’s odd, and removing the card from my lovelace ends the 24/7 live stream for the cameras. Ideally I want to have the latest snapshot displayed, then click on it to start a live stream.

Here is my card (tried with pre-load stream both enabled and disabled):

show_state: true
show_name: true
camera_view: auto
type: picture-entity
entity: camera.front_door_live
camera_image: camera.front_door_live
tap_action:
  action: more-info
hold_action:
  action: none

This is because the live camera is used for the picture. You should use the snapshot camera for the image.

Generic camera has been moved to gui now. But essentially it is the same, just a different approach. You should move to gui because yaml config will get depreciated. Don’t however think it will solve your issues. I’m getting a few errors too when trying to connect to the live cam but after a few retires it does work. I’ll check is my errors are the same s as yours.

Yup, same error:

Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsp://****:****@192.168.20.30:8554/3ce1a1b06608_live

but after a retry it works for me.

I assume at a basic level, the stream should work in VLC? Can’t get it to open via the hostname or IP. Can ping the camera and still works via the Ring app no problem.

ring

What’s odd is that the camera is actually doing a “Live View” 24/7 according to ring, even when I completely delete the card and reboot HA. I also tried with the snapshot as you mentioned and it is still a 24/7 live view.

And what did you do for the still image config in your config?

See below:

http://homeassistant:8123{{ states.camera.front_door_snapshot.attributes.entity_picture }}

I had to disable the Generic Camera to stop it, nothing else was working.
Edit - added more info

I am curious what others are using to get snapshots sent in notifications? No matter what I have tried I seem to get stale images sent in the notifications.

I read in another couple of threads that the stale image doesn’t happen if you treat the snapshot as a camera so I started doing it that way but I still get stale/cached images.

I’ve even implemented a function to delete the old image before sending anything and no matter what I get old images.

My current flow is:

Detect motion or doorbell > delete old image > save a snapshot from the camera > send notification (iOS) with that image attached.

Here is my yaml:

alias: Doorbell Notification
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.front_door_ding
    to: 'on'
  - platform: state
    entity_id: binary_sensor.front_door_motion
    to: 'on'
condition: []
action:
  - service: shell_command.erase_temp_jpeg
    data: {}
  - service: camera.snapshot
    data:
      filename: /config/www/tmp/last_motion.jpeg
    target:
      entity_id: camera.front_porch_ring_video
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - service: notify.family
    data:
      title: Front Porch Activity Detected
      message: Someone is at the front porch and/or rang the doorbell
      data:
        entity_id: camera.cam_frontdoor_latest
mode: single

The thing is; i was experiencing the same thing. Changed lot’s of settings and now it’s not live anymore, for my Dashboard i’m using:

camera_view: auto
type: picture-glance
title: Voordeur
entities:
  - entity: select.voordeur_event_select # event select
  - entity: camera.voordeur_mqtt # button to activate live stream
  - entity: binary_sensor.voordeur_motion # motion sensor of the Ring
  - entity: light.voordeur_spots # my spots above the door, nothing related to Ring
  - entity: binary_sensor.voordeur_ding # the ding, only active it is being pressed, not very useful here 
  - entity: switch.voordeur_event_stream # Just a switch to show if the event stream is begin used
  - entity: switch.voordeur_live_stream # Just a switch to show if the live stream is being used
camera_image: camera.voordeur_event_mqtt  # Event camera

I switched inside the native Ring app on my phone the snapshot feature to only do snapshots every 3 minutes. Don’t know if that even does anything but did it anyway.

For both the Event and live cam i’ve created a Generic camera with the following settings:

http://192.168.21.9:8123{{ states.camera.voordeur_snapshot.attributes.entity_picture }} ← Works only on 2022.5.4 and above (and below 2022.5.1).
rtsp://username:[email protected]:8554/3ce1a1b06608_live

To be perfectly clear; every Ring device has 2 generic camera entries and one camera entry created through MQTT (snapshot).

Furthermore it is important to leave ‘preload stream’ unchecked.

With these settings the ‘live view’ is not active anymore, at least, not when I check. Hopefully you can check your settings.
Oh and I’ve been experimenting with RTSPtoWebRTC docker image, this imports RTSP camera’s automatically which means they run 100% of the time. Don’t know if it is applicable to your situation but maybe there is something else ‘watching’ the stream.

But as mentioned before, I’m getting your Error messages in my logs too. But I’m almost not using the live camera anymore. I’m using the latest docker image, which is 5.0.1 I believe.