Ring Device integration via MQTT w/ Video Streaming

The ding snapshot is no different than any other snapshot, it simply updates the snapshot camera with an image when a ding occurs. It’s not really clear to me how this could be any less immediate than other snapshots as, generally, motion is detected before someone actually rings the doorbell, so the motion snapshot should almost certainly be sent prior to ding snapshots, unless you are not using motion detection.

Ding snapshots have all the same limitations as motion snapshots, i.e. if you have a battery/low-power camera and no Ring subscription, they will suck because the camera can’t take a snapshot while recording. With a subscription, you’ll get the same image as the Ring app provides in the rich notification, but, in my experience, ding snapshots are usually a picture of an arm pressing your doorbell. Still, I had requests for this, so I added it.

I’ve had Ring MQTT running for a while with an alarm and it’s great, everything works flawlessly.

I’ve now added a camera and doorbell and having issues where I don’t get events on motion etc from the camera or motion and ‘ding’ events from the Doorbell.

I get the regular interval snapshot images from the camera and doorbell as well as wifi signal etc, just no actual events on anything happening.

Anyone have any ideas where I should look?

Hey Guys,

sorry this is like the 5. Time a similar question has been asked but I cannot get this to work for some reason.
My Error is always that it cannot establish a connection to my mqtt broker:

2023-09-05T12:08:04.922Z ring-mqtt Attempting to reconnect to MQTT broker...
  1. Question: Yes my MQTT Broker is running (I can connect to it using MQTT Explorer from my laptop)

  2. This is my docker compose:

  ring-mqtt:
    container_name: ring-mqtt
    restart: unless-stopped
    image: tsightler/ring-mqtt
    volumes:
     - /home/documents/ring-mqtt:/data


  mosquitto:
    container_name: mosquitto
    image: eclipse-mosquitto:2
    ports:
     - 1883:1883
     - 8883:8883
     - 9001:9001
    volumes:
     - /home/documents/mosquitto/config:/mosquitto/config
     - /home/documents/mosquitto/data:/mosquitto/data
  1. This is my config.json:
  GNU nano 6.2                                                                                                                      ring-mqtt/config.json
{
    "mqtt_url": "mqtt://192.168.178.214:1883",
    "mqtt_options": "",
    "livestream_user": "",
    "livestream_pass": "",
    "disarm_code": "",
    "enable_cameras": false,
    "enable_modes": false,
    "enable_panic": false,
    "hass_topic": "hass/status",
    "ring_topic": "ring",
    "location_ids": [
        ""
    ]
}

  1. This is my mosquitto.conf:
  GNU nano 6.2                                                                                                                 mosquitto/config/mosquitto.conf                                                                                                                          persistence true
persistence_location home/documents/mosquitto/data/

allow_anonymous true

# Port to use for the default listener.
#port 1883
listener 1883

log_dest stdout

connection dte
address 192.168.178.214:2883

try_private false
start_type automatic

topic # in 0

Does anyone know why this wont work?
If I change the mqtt_url in the config.json from my IP to Localhost it will just give me the econnrefused to 127.0.0.1 error and not connect aswell.
Trying the Docker IP (172.0.0.8 or similar I think) will not work as its not static I think. Might this be the way to go? I have no clue.

Can you please help me how you did your automation regarding Ring-MQTT? I can’t seem to get it to work for me.

You will see in my case the image is not current (due to the reasons explained by tsightler.
But for you info:-

Trigger : 
   Entity: Front Door Ding
   From: Clear
   To: Detected

Action:
   Call service: 
    Service : Camera: Take snapshot
    Target: camera.front_door (entity)
    Filename: /config/www/tmp/snapshot-doorbell.jpg
  Call Service:
    Service: Notifications: Send a notification via mobile_app_sm_s901b
    Message: Somebody at the door
    Title: Doorbell ring
    data: 
image: http://<External-accessible-server-URL>/local/tmp/snapshot-doorbell.jpg
entity_id: camera.front_door
actions:
  - action: URI
    title: Open Cameras
    uri: http://<External-accessible-server-URL>/lovelace/security   (link to the page  in the app)

Hi
I have tried to integrate the Ring Mqtt but I get some errors when the integration connects to the Mqtt broker so it dosnt detects no devices. Mqtt is a bit of a new magic for me it took me few days and research to finally start using zigbee2Mqtt. If anyone willing to help PLEASE :pray:t3:

Forgot to mention. For now, I integrated my ring intercom with a home assistant via Homebridge. They have an amazing plug-in. The downside is I have to run both. Homeassistant and Homebridge :disappointed: if I only knew how to create the integrations I would definitely use the Homeassistant plug-in and redo to Homeassistant addon.

I didn’t read through all 1200 posts on this thread but my question is: Is it possible to get Ring camera integrations completely locally? I want to get local motion alerts and motion video capture and review without dependence on the internet being up. Is this possible?

You have two docker containers running, ring-mqtt and mosquitto. These two containers can ‘see’ each other on the docker network (172.x.x.x), but things outside of docker cannot see these two. You poke some holes in this with the

    ports:
     - 1883:1883
     - 8883:8883
     - 9001:9001

Here, when your host computer (192.168.178.214) receives a packet on a left-hand port, it is forwarded to the docker container on the right-hand port. So, when 192.168.178.214:1883 receives a packet it forwards it to mosquitto:1883 .

Here’s the changes I would make:

mosquitto.conf:
Throw away your listener, address, connection lines. Add the line

bind_address 0.0.0.0

ring-mqtt config.json:

"mqtt_url": "mqtt://mosquitto:1883"

This tells mosquitto "listen on every available interface.’ mosquitto is a docker container, so ‘every available interface’ is just the virtual docker interface. The default port is 1883. So now your mosquitto docker container is listening for connections to anyone that can see it. Who can see this container? Well, other Docker containers can see this container at its docker name, mosquitto.

Note that ‘mosquitto’ only works within docker. No one outside of Docker can see these containers, except through the holes you punched with the ‘ports’ command. Your ‘ports’ list defines a list of ports on your host computer that it will forward to the specified docker container. Anything your host computer gets at 1883, 8883 or 9001 ends up at ‘mosquitto:port’.

mosquitto and ring-mqtt can happily talk to eachother internal to the docker network. ring-mqtt will talk to mosquitto via the address ‘moquitto:1883’ . Note that internal to the docker network you do not have to forward ports. mosquitto and ring-mqtt are fully visible to each other even in the absence of your ‘port’ list. The port forwarding only affects what is visible outside of docker.

Anything external to the docker network will talk to mosquitto via ‘192.168.178.214:1883’ (assuming this is your host’s real IP). When it receives a connection on 1883 it will forward it to the mosquitto container.

edit:
I noticed your ‘persistence_location’ is wrong as well:

persistence_location home/documents/mosquitto/data/

Your mosquitto.conf is being read from inside docker. You listed this path mapping in your docker config:

volumes:
     - /home/documents/mosquitto/config:/mosquitto/config
     - /home/documents/mosquitto/data:/mosquitto/data

These volume mappings are host_path:container_path. For example, internal to your mosquitto docker container the path /mosquitto/config is actually going to be /home/documents/mosquitto/config on your host machine.

Since everything in your mosquitto.conf is from the point of view of inside the docker container, the host path of /home/documents/mosquitto/data is actually /mosquitto/data thanks to the volume mapping.

I think the important concept to grasp here is that paths and IP addresses within a docker container are separate from outside of the docker container, and that port/volume mappings can create links between the two. You need to be sure you are referring to things from the correct ‘perspective’.

1 Like

I do not think so. Everything Ring goes through Ring’s servers. If you want to watch a video stream from your doorbell 20 feet away it is going to have to take a cross-country journey first.

Thanks …Yeah … I figured that out after digging around. Now looking for a video doorbell and cameras that work well with HA off the internet.

Hi all, since it takes about 10 seconds to start a livestream after someone is ringing at the door I figured to take a snapshot and use it on the camera popup until the livestream is started. Problem is I can’t seem to get it working.
Is it possible to take a ‘live’ snapshot when the doorbell is pressed? I noticed the take snapshot button (which doesn’t seem to work also) so I assumed it would be possible.

I have a wired ring video doorbell with the basic plan. I also did the restart for the new update.
If someone as some tips to start the livestream faster that would be appreciated too.

Thanks!

Pretty much every question you asked is already covered in the project documentation or FAQ, I’d suggest reviewing it carefully. If you implement any of the available WebRTC options for HA you should be able to get camera startup down to 2-3 seconds, again, this is covered in the camera docs and there’s plenty of HA docs on this as well.

Hello guys, i am a newbie in HA and also my programming skills are not the best:smiley:
Has somebody from you created a video or little tutorial how to configure this Addon?
This project looks like very interested and hopefully a guy like me can also use it :smiley:
Thank you very much in advance.

Hi @tsightler

Ok firstly, this integration is brilliant. Thanks for taking your time on this one, it’s really really useful!.. I am being really dense here. I have read the instructions on the events stream and can see that you need to get the feed from the info section on the camera (which I have done) I have also replaced the end of the URL with “_event” and created a second generic camera for my front door. I just can’t seem to understand how to link that event camera to the event picker I have made?

I can pick the event I want for any event stream camera at any time. That, way I click the live stream image to bring up the live camera view, or I click the event stream image to bring up the selected event camera with the selected event recording.

Any screenshots or examples you can show that will help my tiny brain understand this?

Hi All, Firstly such an excellent add-on thank you tsightler and all the contributors.

I have had this installed for a while and just got the video streaming up and working as per the docs. The camera streams and works as expected. I did see this error in the logs tho when streaming the camera live… Any ideas here?

2023-10-26T20:15:20.726Z ring-rtsp [go2rtc] WRN github.com/AlexxIT/go2rtc/internal/rtsp/rtsp.go:225 > error="read tcp 172.30.33.8:8554->172.30.32.1:55002: i/o timeout"

When you mean “Stop/start” the addon, do you mean disable then re-enable MQTT?

Thanks

I’ve had a problem when my Ring camera fires live stream all the time… like every 20sec or so… drains the batteries.

It just started happening out of the blue like a few days back - was working flawlessly for months

When I go into MQTT ring, I can’t switch off the live stream button and motion detection button. They keep flicking back on by themselves.

This happens even if the Ring is not powered up - whcih makes me think it’s MQTT that is the problem
Is there an upgrade path for this add on?
Is there any way to disable the addon rather than the whole MQTT app (I use MQTT for two devices) so I just want to disable RING MQTT… see a while if this stops the unwanted behaviour from the camera…
Any suggestions… I’ve tried stop start the addon as advised above - no help

Thanks

I’ve had the same issues previously and was using the RTCtoWeb add-on, this seemed to provide a constant stream and would restart each time out. Maybe check out your video integrations?

Ive got the same issue. The live stream is constantly on. I have tried rebooting HA, stop/start MQTT and it always just comes straight back on and drains the battery.

Did you find a resolution to this or open a ticket?