Ring Device integration via MQTT w/ Video Streaming

Thank you I’ve been struggling to find this info or get a reply from someone. My main dilema with a stick is that I am using a synology box for everything.

  1. both USB ports are being used already
  2. DMS 7 makes it difficult to recognize sticks.

Thats why I wanted to find a hub. Is there a local way to do it with a hub?

It’s a fair reason for wanting a hub I guess, but, unfortunately, I have no experience with hubs other than the Ring Alarm base station. My guess is that it would work, the lock code in ring-mqtt has been in there for years now and I’ve only had one or two issues opened for breakage along the way, which shows me a) people do use it because they almost immediately report when in breaks, b) it’s probably pretty reliable.

Maybe you could just buy a USB hub to give yourself some more ports on your Synology? But again, this is outside of my experience so I really can’t help here. I personally run HA on the RPi4b with a GoControl HUSBZB-1 combo Zigbee/Z-wave USB stick and it works great for me. I’ve had this setup for a year now when I moved all of my Z-wave devices off of the Ring hub and it’s been 100% reliable for both the Z-wave and Zigbee functions.

Good luck!

1 Like

thanks for the help :slight_smile:

anyone? it seems its starting the live stream but it not showing up on vlc/ home assistant

it looks like the path from the live view is not valid?

Yep I get that same VLC error. Might be a bug with the addon, might need to post on gitbub. @mhoogenbosch might know the issue. I think this is his addon as he seems the most helpful contributor on this thread.

No no @tsightler deserves this honor. I’m just a huge fan.

1 Like

when i try to watch /event this is working, but when i try to go /live i dont get a stream somebody?

Sooo, I got it working. Unfortunatly I spend so much time trying to get it work in VLC but it just gets refused in there, it will work from HomeAssistant.

  1. Install Addon
  2. Prep device so it is picked up by MQTT
  3. Make a RTSP user in the configuration of the addon.
  4. Go into the attributes and copy the RTSP and still image URL.
  5. In HA: Settings > Apps and registrations > Generic camera
    6: Paste the RTSP url and still image url (check your still image url as the addon tries to ‘guess’ the right IP/hostname, sometimes this is not right. Change it to your local IP for MQTT to work or you need to forward MQTT requests to your server.
  6. Select the TCP protocol
  7. Add the camera card to your HA and test.
  8. It can take a while for the stream to load (~5/6 secs)
  9. Voillaaaaaaaaa

1 Like

Can Someone please help me. I am pretty sure if my install was working correctly I would see all my devices under the Mosquitto broker in integrations correct? I am running Home assistant on a raspberry pi 3B

I have installed mosquitto, created a user, configured mosquitto, installed Ring MQTT from add on store, open web ui get auth and see if start up, here are my logs from Mosquitto and ring
mosquitto
[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] mosquitto.sh: executing…
[11:21:00] INFO: SSL is not enabled
[cont-init.d] mosquitto.sh: exited 0.
[cont-init.d] nginx.sh: executing…
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[11:21:04] INFO: Starting NGINX for authentication handling…
[11:21:05] INFO: Starting mosquitto MQTT broker…
1654356065: Warning: Mosquitto should not be run as root/administrator.
[11:21:09] INFO: Successfully send discovery information to Home Assistant.
[11:21:11] INFO: Successfully send service information to the Supervisor.

Ring:[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] ring-mqtt.sh: executing…

| Ring-MQTT with Video Streaming |
| Addon for Home Assistant |
| |
| Report issues at: |

[cont-init.d] ring-mqtt.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.

ring-mqtt.js version: 5.0.1
Node version v16.14.2
NPM version 8.1.3
git version 2.34.2

Running ring-mqtt…
2022-06-04T15:33:51.031Z ring-mqtt Detected runmode: addon
2022-06-04T15:33:51.050Z ring-mqtt Configuration file: /data/options.json
2022-06-04T15:33:51.069Z ring-mqtt Discovered MQTT Host: core-mosquitto
2022-06-04T15:33:51.073Z ring-mqtt Discovered MQTT Port: 1883
2022-06-04T15:33:51.075Z ring-mqtt Discovered MQTT User: addons
2022-06-04T15:33:51.077Z ring-mqtt Discovered MQTT password:
2022-06-04T15:33:51.081Z ring-mqtt MQTT URL: mqtt://addons:********@core-mosquitto:1883
2022-06-04T15:34:04.555Z ring-mqtt Reading latest data from state file: /data/ring-state.json
2022-06-04T15:34:04.581Z ring-mqtt Succesfully started the token generator web UI
2022-06-04T15:34:05.521Z ring-mqtt Attempting connection to Ring API using saved refresh token…
2022-06-04T15:34:06.425Z ring-mqtt Successfully established connection to Ring API using saved token
2022-06-04T15:34:07.513Z ring-mqtt Successfully saved updated state file: /data/ring-state.json
2022-06-04T15:34:08.427Z ring-mqtt Attempting connection to MQTT broker…
2022-06-04T15:34:11.360Z ring-mqtt MQTT connection established, processing Ring locations…
2022-06-04T15:34:13.375Z ring-mqtt ------------------------------------------------------------------------------------------
2022-06-04T15:34:13.376Z ring-mqtt This account has access to the following locations:
2022-06-04T15:34:13.378Z ring-mqtt Home (edited out)
2022-06-04T15:34:13.379Z ring-mqtt Office (edited out)
2022-06-04T15:34:13.380Z ring-mqtt 7729 (edited out)
2022-06-04T15:34:13.384Z ring-mqtt 27909 (edited out)
2022-06-04T15:34:13.384Z ring-mqtt 25151 (edited out)
2022-06-04T15:34:13.385Z ring-mqtt 12469 (edited out)
2022-06-04T15:34:13.386Z ring-mqtt 4970 (edited out)
2022-06-04T15:34:13.387Z ring-mqtt
2022-06-04T15:34:13.387Z ring-mqtt IMPORTANT: All alarm and smart lighting hubs at these locations MUST be online
2022-06-04T15:34:13.388Z ring-mqtt or device discovery for that location will hang indefinitely!
2022-06-04T15:34:13.388Z ring-mqtt If desired, use the “location_ids” config option to restrict discovery
2022-06-04T15:34:13.389Z ring-mqtt to specific locations. Please see the documentation for more details.
2022-06-04T15:34:13.389Z ring-mqtt ------------------------------------------------------------------------------------------
2022-06-04T15:34:13.390Z ring-mqtt New location: Home (redacted)

is there somewhere else I need to look? I am just trying to get this up and running. I will post whatever you need, or do whatever please help…also yes I am new so be easy

Nevermind I got it after two days…and for those keeping score at home…When it says all alarm devices must be online, they mean it…I didnt realize my alarm was on cell backup…got it backonline and everything fired right up!!

Glad you got it working. The 5-6 seconds is because it takes about 2-3 seconds for the stream to start normally, but then another 3 seconds or so due to the use of LL-HLS by the HA frontend. You can cut this down significantly by using something like RTSPtoWeb or VLC.

I’m not sure why you wouldn’t be able to get it to work in VLC, unless you didn’t follow the setup guide and enable forwarding for the RTSP port. I use this project with VLC all the time, so I know it works, but it of course won’t work unless you explicitly enable the external RTSP port.

1 Like

Unfortunately, the API call needed to return devices simply never returns if the hub for a given location is not online. I’m constantly surprised at how many people have offline hubs and don’t know it especially since it clearly sends notifications in the Ring app when this happens.

If you have a suggestion on how I can make the wording in the log more clear around this I’m happy to hear it as it seems this trips people up all the time. I tried to add the warning in the log to make it as clear as possible but it seems this still isn’t enough. Maybe I could somehow add a wrapper function that logged a message that it was still waiting for the device list and uses should check of the given location had any offline hubs. Do you think this would make it more clear?

1 Like

That’s a weird one as it looks like the local connection is failing before there is even time for the actual stream to start. I’ve not seen this before. What client are you attempting to use for the RTSP stream? Are you connecting from the same host that is running ring-mqtt or another host?

In the install instructions I would out to go into ring app and make sure no alarm items are offline…also I have 8 different locations I monitor so some notifications get lost. Thanks for all your work love the add on

1 Like

hi , i use the generic camera from home assistant, in this the event is working but not the live steam :s

Hi everybody ! Thank you @tsightler for this wonderful v5. It runs sloothly in my side.

As I al digging again with node-red automations based on your devices/entities, I notice that I have 5 times Dign Event or Motion Event or OnDemand Event for the same device camera (with corresponding number in the end of the attribute. Is it the normal behavior og the add-on ?

Sorry ! I found the explanation in the wiki :slight_smile:

On initial setup the default event is set to the most recent motion (Motion 1) but the play back event can be selected using the Event Selector entity in Home Assistant or the equivalent MQTT command topic and this setting is saved as part of the device state so it will be persistent across restarts of ring-mqtt. Each camera allows selecting from any of the last five motion, ding, or on-demand events (ding events are available only for doorbells). For example, selecting “Ding 1” will cause the event stream to play back the recording of the most recent doorbell ding event, while selecting “Motion 3” would play back the 3rd most recently recorded motion event. On-demand recording events occur any time a video stream is started for on-demand viewing without a motion/ding event.

You are right regarding the forwarding, after that it’s working succesfully :slight_smile:

1 Like

Glad it is working well for you. I’ve been pretty surprised at its stability has been given the fact that it contains tons of changes. There are still a couple of issues that need to be addressed before I’m 100% comfortable with it, but those issues seem to be mostly in the underlying ring-client-api and not ring-mqtt itself.

1 Like

As I am more and more comfortable with this wonderful integration, I have tuned a Node-Red Flow to triggering video capture and sending it through Telegram (I have been seduced by Node-Red and I am reluctant to the HA automations way everytime I try).

Video is downloaded with a filename including date and hour then sent through Telegram with the excellent node-red-contrib-chatbot nodes.

The good news is that the lookback option in the video recording is able to catch the first 1 to 3 sec (or more ? I put 15 sec lookback in case!) that miss if you don’t activate it. As such, the start of recording is less than 1 sec after of the trigerring motion.

It may be simplified ; I cannot tell as I just finished the tuning yesterday night.

Tested with yesterday v5.0.1, with a battery camera without Ring Protect Plan, and with the corresponding door sensor for triggering.

[
    {
        "id": "30c33f8ce5a0630a",
        "type": "tab",
        "label": "Ring",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "93abe672cd8a3d7b",
        "type": "moment",
        "z": "30c33f8ce5a0630a",
        "name": "",
        "topic": "",
        "input": "",
        "inputType": "date",
        "inTz": "Europe/Paris",
        "adjAmount": 0,
        "adjType": "days",
        "adjDir": "add",
        "format": "[/media/Ring/node-red-shot_(]YYYY-MM-DD_kk.mm.ss[)]",
        "locale": "fr_fr",
        "output": "filebase",
        "outputType": "msg",
        "outTz": "Europe/Paris",
        "x": 140,
        "y": 300,
        "wires": [
            [
                "07033e958eac3740"
            ]
        ]
    },
    {
        "id": "07033e958eac3740",
        "type": "api-call-service",
        "z": "30c33f8ce5a0630a",
        "name": "",
        "server": "eb612605.cd9cc8",
        "version": 5,
        "debugenabled": false,
        "domain": "camera",
        "service": "record",
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "camera.portier_live"
        ],
        "data": "{\t   \"filename\": msg.filebase & \".mp4\",\t   \"duration\": 25,\t   \"lookback\" : 15\t}",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "data"
            }
        ],
        "queue": "all",
        "x": 400,
        "y": 300,
        "wires": [
            [
                "75af2bad98f0227b"
            ]
        ]
    },
    {
        "id": "723b2be5d9208670",
        "type": "server-state-changed",
        "z": "30c33f8ce5a0630a",
        "name": "Motion",
        "server": "eb612605.cd9cc8",
        "version": 4,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfilter": "binary_sensor.porte_principale",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "str",
        "haltifstate": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "outputs": 2,
        "output_only_on_state_change": true,
        "for": 0,
        "forType": "num",
        "forUnits": "minutes",
        "ignorePrevStateNull": false,
        "ignorePrevStateUnknown": false,
        "ignorePrevStateUnavailable": false,
        "ignoreCurrentStateUnknown": false,
        "ignoreCurrentStateUnavailable": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "eventData"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "",
                "valueType": "triggerId"
            }
        ],
        "x": 90,
        "y": 220,
        "wires": [
            [
                "be980d7baa0052e7"
            ],
            []
        ]
    },
    {
        "id": "be980d7baa0052e7",
        "type": "api-call-service",
        "z": "30c33f8ce5a0630a",
        "name": "",
        "server": "eb612605.cd9cc8",
        "version": 5,
        "debugenabled": false,
        "domain": "switch",
        "service": "turn_on",
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "switch.portier_stream"
        ],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "all",
        "x": 300,
        "y": 220,
        "wires": [
            [
                "b0bf5a56a730161c"
            ]
        ]
    },
    {
        "id": "b0bf5a56a730161c",
        "type": "delay",
        "z": "30c33f8ce5a0630a",
        "name": "Tempo 1 s",
        "pauseType": "delay",
        "timeout": "1000",
        "timeoutUnits": "milliseconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 530,
        "y": 220,
        "wires": [
            [
                "93abe672cd8a3d7b"
            ]
        ]
    },
    {
        "id": "75af2bad98f0227b",
        "type": "delay",
        "z": "30c33f8ce5a0630a",
        "name": "Tempo 30 s",
        "pauseType": "delay",
        "timeout": "30000",
        "timeoutUnits": "milliseconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 630,
        "y": 300,
        "wires": [
            [
                "ab4d4e980d7621d1"
            ]
        ]
    },
    {
        "id": "316466db9c1a1581",
        "type": "chatbot-video",
        "z": "30c33f8ce5a0630a",
        "name": "",
        "filename": "",
        "video": "/media/Ring/node-red-shot_xxxx.mp4",
        "caption": "",
        "x": 510,
        "y": 380,
        "wires": [
            [
                "2336dbdc20213a20"
            ]
        ]
    },
    {
        "id": "0704bcf1c39805be",
        "type": "chatbot-conversation",
        "z": "30c33f8ce5a0630a",
        "name": "Chez nous",
        "botDevelopment": "xxxx",
        "botProduction": "",
        "chatId": "xxxx",
        "userId": "",
        "transport": "telegram",
        "store": "",
        "x": 310,
        "y": 380,
        "wires": [
            [
                "316466db9c1a1581"
            ]
        ]
    },
    {
        "id": "ab4d4e980d7621d1",
        "type": "function",
        "z": "30c33f8ce5a0630a",
        "name": "",
        "func": "msg.video = msg.filebase + '.mp4';\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 100,
        "y": 380,
        "wires": [
            [
                "0704bcf1c39805be"
            ]
        ]
    },
    {
        "id": "2336dbdc20213a20",
        "type": "chatbot-telegram-send",
        "z": "30c33f8ce5a0630a",
        "bot": "12565dff063d0a75",
        "botProduction": "",
        "track": false,
        "passThrough": false,
        "errorOutput": true,
        "outputs": 1,
        "x": 730,
        "y": 380,
        "wires": [
            []
        ]
    },
    {
        "id": "eb612605.cd9cc8",
        "type": "server",
        "name": "Home Assistant",
        "version": 2,
        "addon": true,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true,
        "heartbeat": false,
        "heartbeatInterval": 30
    },
    {
        "id": "12565dff063d0a75",
        "type": "chatbot-telegram-node",
        "botname": "xxxx",
        "usernames": "xxxx",
        "polling": "1000",
        "store": "",
        "log": "/config/www/logs/xxxx_logs",
        "debug": true,
        "skipMediaFiles": false,
        "webHook": "",
        "connectMode": "polling"
    }
]
3 Likes