Ring Device integration via MQTT w/ Video Streaming

Well, the siren switch is the same as the “test siren” option in the Ring app, it doesn’t actually trigger the alarm, it just sounds the siren. It makes sense you can’t test the siren while the system is armed.

Yeah you are right and now it’s clear for me as well. So the only way is to combine as I previously said Alarmo and Ring, in this way (with some automations) I will have 2 alarm systems.

Thanks for your help.

Well let me start by stating that I know this is going to be a dumb question. I have this addon configured, and it is “seeing” my front door ring camera in the logs. where I am getting caught up is the specifics of the rtsp address. Is the ip address/host name my “home assistant” instance? Like: “rtsp://192.168.254.35:1883/camera.front_door_live” do I need a port, if so…is it my mqtt listening port, or the port to my home assistant instance? I’ve tried every variation I can think of and can’t seem to get a stream to show up. Thank you for any help.

What does the Stream Source attribute on the info sensor show it should be? That’s the best place to start as normally it will need, at most, minor tweaks. The port is of course the port of the RTSP server (8554 by default). Think about it this way, you are attempting to tell Home Assistant what port it needs to connect to for the stream, so of course it’s not going to be pointing to Home Assistant itself, and it’s certainly not going to be the MQTT server (the port you have above) since that’s not a streaming server.

@tsightler, thank you very much. That helped clarify. I’m still having some problems. when I go to enter the generic camera, I pull that data from the info attribute of the entity and enter the stream source: rtsp://03cabcc9-ring-mqtt:8554/e04f43a1dad0_live and then the still image url: https://homeassistant:8123{{ states.camera.front_door_snapshot.attributes.entity_picture }} and I get an unknown error when I try to “submit”. The error seems related to the snapshot url, as I can get it to submit with the stream info only. Here is the snippit from the log when the snapshot times out:

Logger: aiohttp.server
Source: components/generic/config_flow.py:170
First occurred: 6:32:24 PM (2 occurrences)
Last logged: 6:34:01 PM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 82, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper
    result = await method(view, request, data, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 280, in async_configure
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/generic/config_flow.py", line 317, in async_step_user
    errors, still_format = await async_test_still(hass, user_input)
  File "/usr/src/homeassistant/homeassistant/components/generic/config_flow.py", line 170, in async_test_still
    response = await async_client.get(url, auth=auth, timeout=GET_IMAGE_TIMEOUT)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1751, in get
    return await self.request(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1527, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1614, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1642, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1679, in _send_handling_redirects
    response = await self._send_single_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1716, in _send_single_request
    response = await transport.handle_async_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 353, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request
    response = await connection.handle_async_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 86, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 63, in handle_async_request
    stream = await self._connect(request)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 150, in _connect
    stream = await stream.start_tls(**kwargs)
  File "/usr/local/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 76, in start_tls
    raise exc
  File "/usr/local/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 67, in start_tls
    ssl_stream = await anyio.streams.tls.TLSStream.wrap(
  File "/usr/local/lib/python3.10/site-packages/anyio/streams/tls.py", line 122, in wrap
    await wrapper._call_sslobject_method(ssl_object.do_handshake)
  File "/usr/local/lib/python3.10/site-packages/anyio/streams/tls.py", line 130, in _call_sslobject_method
    result = func(*args)
  File "/usr/local/lib/python3.10/ssl.py", line 975, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:997)

Now, if I enter the generic camera without a snapshot url, it will go through, and video seems to be working but I need to play with some automations related to the “ding”. On the flipside, the ring app will create a camera snapshot entity listed as: camera.front_door_snapshot which appears to work as expected. When you say “tweak” should I use that in my https: for snapshot? Thank you.

As noted in the documentation, the first part of this URL should be the same URL you use to access the HA UI. Unfortunately, I haven’t found any method to reliably guess this for all environments.

1 Like

I have an interesting issue that I haven’t been able to figure out.
I am running the following shell script in an automation when the ring is rung:
ffmpeg -rtsp_transport tcp -y -i rtsp://10.0.0.26:8123:[email protected]:8554/xxxxxx_live -frames:v 1 -ss 00:00:01 /config/www/ring_ding.jpg
This captures 1 frame at the 1 second mark on the RTSP stream. However, I am getting what looks like a corrupted image. I have tried increased the time to 2-3 seconds and am still seeing a corrupted image. However, when I run the shell script on my server or through call service in developer tools, the image is fine.

This used to work fine, up until a few months ago, but I haven’t had a chance to properly troubleshoot it.

Does anyone know what is different when the doorbell is rung? Is the ring preventing me from grabbing the RTSP stream properly when it’s rung? (Note: I do not have a ring subscription.)
Thanks!

1 Like

@tsightler, thank you again. That got me going. I swear I tried all those combos, but clearly I was missing something. Thank you for the nudge. We seem to be all good now.

An example image would help, but the most common issue is that the initial RTP packets are delivered in a burst (because they include a short section of buffer) and it overruns the UDP buffer on Linux which is incredibly small by default. This can regularly cause the first few seconds of video to be corrupt and it won’t clear until the next keyframe is sent. The symptom is usually that a small portion of the image at the top looks OK, but the remainder of the image looks like a smear or, in some cases, a solid color (green seems common for some reason).

If this is what you are seeing then the “fix” such as there is, it to increase the default Linux receive buffer. This is actually covered in the FAQ section of the ring-mqtt wiki. Good luck!

2 Likes

Glad you got it working, I need to figure out a better way to describe this in the docs as clearly this is one of the trickiest parts for users not familiar with the technologies in use and how they all glue together. Suggestions are welcome.

Probably, what I really need to do is make a small companion custom integration that can be installed with HACS that would automatically create WebRTC cameras in HA but I just don’t know when I will have time for that.

2 Likes

Ah yes, that’s exactly that it looks like. A smear, and then sometimes green.

Thank you for pointing that out to me, I’ve updated the receive buffer and it seems to work now.

Thank you!!

Did this ever get fixed? I’m on the latest HA build but livestream goes unavailable very frequently.
I’m thinking of replacing the damn thing with Ubiquiti or whatever that doesn’t need a subscription.

I’m not sure what you are asking, but if the question is if Ring ever implemented 24x7 streaming, the answer is simply no. If you want anything more than on-demand streaming, the best suggestion is to get a different camera system.

Have you found a solution. I’m facing the same issue.

Thanks

@crankycowboy

Regarding the error when trying to set up the still image url in generic camera -
I had the same issue, although my Still Image URL is listed as:
https://localhost:8123{{ states.camera.door_ring_snapshot.attributes.entity_picture }

I tried different IP addresses (HA address 192.168.0.xx, docker address 172.15.0.xx) but they gave the same error.

The only way I could make it work was to change “https” to “http” in the URL. I’m not sure if that’s the right way to do it but at least it works for me.

(FYI I’m running ring-mqtt and HA in docker containers)

It’s really pretty simple, the portion of the URL before the template should be the same as the base URL to access the HA instance.

1 Like

Hi. I noticed in my supervisor logs it is full of warnings about mqtt host, port, user, password, beam duration, snapshot mode and ring token ‘does not exist in the schema’. What have I done here? The addon seems to function fine and has for a long time.

Pulling my hair out here, I have 9 locations I monitor with RIng…I am setting this up all over again and fresh, but when I go to filter out just my home location (edit in yaml option as I dont see location ids option in ui) I get this error

Failed to save add-on configuration, Invalid list for option ‘location_ids’ in Ring-MQTT with Video Streaming (03cabcc9_ring_mqtt). Got {‘mqtt_url’: ‘mqtt://auto_username:auto_password@auto_hostname’, ‘mqtt_options’: ‘’, ‘livestream_user’: ‘’, ‘livestream_pass’: ‘’, ‘disarm_code’: ‘’, ‘enable_cameras’: True, ‘enable_modes’: True, ‘enable_panic’: False, ‘branch’: ‘addon’, ‘debug’: ‘ring-*’, ‘location_ids’: ‘(redacted loc id)- “”’}

Please someone help me get just my home location, what am I doing wrong… Ithought there was a way to get location id in ui filtered out.

Based on the error message it looks like you are not putting the id between the quotes as that’s really all you have to do as it’s YAML syntax for an array. The error makes it look like you did something like:

location_ids: <location_id>
  - ""

While it should be:

location_ids:
  - <location_id>
1 Like

Mark this up to too much thanksgiving cooking and not enough coffeee…I didnt even see the dash and quotations in the line below location id…Up and running now! thank you so much!!