Ring Device integration via MQTT w/ Video Streaming

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.

Why aren’t you using the snapshot camera entry for sending the picture? The thing is when there is motion detected or a ding press the native Ring service will get a picture. This takes some time, the camera is locked for that moment. So when you want to pull a picture from the active stream it first has to get available again, has to get started and only then it is possible to get a picture out of it. So in my experience the best experience is using the snapshot camera for pulling the picture.

I hadn’t thought about the camera being locked upon motion/ding! I switched to the mqtt snapshot camera so hopefully things will work better. Thanks for the push in the right direction!

Hmmm… still no dice. Would someone mind sharing their automation that includes the snapshot being sent? I’ve tried so many different things and nothing seems to send me the correct image.

What is strange is that I can use the same URL in lovelace and display the latest snapshot no problem but when I send that same URL as a notification attachment it’s a different photo.

alias: Notification - Deurbel gaat (foto) -> Martijn
description: ''
use_blueprint:
  path: aceindy/send-camera-snapshot-notification-on-doorbell.yaml
  input:
    binary_sensor: binary_sensor.voordeur_ding
    camera: camera.voordeur_snapshot
    notify_device: 1ce4279de123aa52cafbb42d44b16e5c
    is_ios: true
    delay: 1
    notification_title: De deurbel gaat af
    notification_message: Er is op de deurbel gedrukt. Dit staat er aan de deur.

My automation, based on a blueprint of which I believe is the following: 📸 Send camera snapshot notification on motion

Thanks again! This thing is driving me nuts :rofl:

You have a lot of options that seem unneccessary so it’s really difficult to know what might be the problem. Literally it should only take something as simple as:

camera_view: auto
type: picture-glance
entities: []
camera_image: camera.back_bedroom_side_live

I appreciate the response and all the hard work you have put into this project - it’s incredible!!

Unfortunately though i have tried this as well and the issue persists. What’s odd to me is that it is as soon as I enable any of the Generic Cameras - even if there are zero cards or anything related to them anywhere in my system. I can send a video of this later tonight if you would like.

I don’t need any screenshots or videos, it really doesn’t matter to me as this problem cannot be caused by ring-mqtt. The ring-mqtt addon simply starts a stream when a client is connected, if a client is connecting, you have to figure out what is causing it.

When you initially add the camera it will always run for 5 minutes, as well as any time you view the camera. I’ve found that many people get carried away with testing when initially adding cameras and think that they camera is running all the time when, in reality, it’s their constant fiddling that constantly causes the 5 minute timeout to reset.

My suggestion is to simply add the camera, but do nothing else, just wait 10-15 minutes, and see what happens at that point. If it’s really still starting on its own at that point, then you’ll need to figure out what in Home Assistant is starting the stream, but it will almost certainly have to be some type of media player, service or UI component. You can enable debug in Home Assistant to see the stream component starting to at least prove that it is coming from HA.

If it’s not coming from HA, then it has to be something else connecting to the RTSP server, one of the other addons perhaps, but there’s really nothing that I can help with at this point.

It ran for 4+ hours while I was away, so I know it’s not anything from testing. Nonetheless, thanks again for everything you do! I’ll see what I can discover may be causing it.

I know this is going to come across as me sounding like a jerk, but as I’ve been maintaining this addon with streaming for about a year now, I’ve probably had 20-30 people open issues about this. In every single case it’s been something in their configuration. The first step is to enable debug for the HA stream component and prove that it is coming from that. If it is, then at least you know that you need to figure out what is triggering the stream component to start.

I’ve seen several cases that weren’t easy to explain, and I wonder if it’s from things like auto discovery (which I don’t use) or automatic UI setup which is the HA default (which I also don’t use), but I really have no idea. The easiest thing to do is just go step-by-step. Configure ring-mqtt with a livestream username/password to make sure that only things you explicitly configure can start the stream. Then add the stream to HA using this username/password. If it definitely starts after the timeout then you have to figure out what in HA is triggering it.

Good luck, I’ll be interested in what you find.

It doesn’t make you sound like a jerk at all! I completely understand where you’re coming from if you know it’s not related to your integration - I figured I would check to see if it was a known issue or not. I appreciate you taking the time to discuss with me - I’ll do some troubleshooting on my own at some point here and report back if I find a solution just for the sake of it.

Thanks again!

  • post deleted due finding out myself. -

Can you tell me how you did this? I’m at the same point you were when you posted :slight_smile: Thanks!

Well, found the RTSP URL, but can’t open it in any way. Do I need to forward ports? don’t think so, as it’s all in my local network, right.

There is no username or password in url. What did u use in the config of your docker? Assuming you use docker. rtsp://username:pass@192……

Hey Martijn,

No I just use HA on my Pi, no Docker.
I’ve now just set a username and password in the config of the addon, but also then, no luck connecting.

So, just to sum up.

  1. Installed the Addon
  2. Made sure I coud find the Ring Wired and Chime through MQTT
    2.1 Chime can be toggled from MQTT and sensors of the Ring Wired also show correctly.
  3. Did dug through the docs and found the RSTP source and still image source in the attributes of the camera
  4. Can’t connect with VLC to the ‘live stream’ of the camera
    4.1 I’ve set a username and password, still can’t connect to the camera. Tried the RTSP source URL like in the attributes of the camera and tried the local IP of the device, no luck however.

Even when I copy the link from the addon log, it can’t connect…

Not sure what I’m doing wrong here :frowning:

When debugging in VLC I can see the Ring device is refusing my RTSP.

image

Would you happen to know if an old (2014) ZWAVE Schlage lock through the Ring hub which is supposedly supported, would work in home assistant now that I’ve set everything up for live view with Ring-MQTT? I dont care about it being integrated into the liveview feed. I actually just want an entity to put as a seperate button for lock/unlock. Having trouble deciding between hub or usb stick, and I just read that Ring hub works and it seems lower in price.