Ring Device integration via MQTT w/ Video Streaming

So when you add the camera entity as an entity to the picture glance card, and hit the entity icon, the default behaviour I see is the stream starts up in a popup media player. So what I want to do is override the tap action to call a script or something - no issue. In the script would first set the input select to the desired event, then call that stream popup media player. But what is the command to start the stream in the popup player like what happens when clicking the entity with default tap action.

Why wonā€™t the livestream switch stay off? If it stays on my Ring app fills up with live views and I donā€™t get motion alerts. I can turn it off either manually or by automation, but it comes on again in under two minutes. I would prefer it stay off unless my automation turns it on. Is this possible or must I start and stop the add-on entirely?

The switch, like most switches, isnā€™t just about turning the stream on and off, it also shows the state of the live stream so if itā€™s turning on when you are not manually changing it then something is starting a live stream via a connection to the RTSP server. Perhaps youā€™ve configured the picture glance card with camera view option set to ā€œliveā€ instead of ā€œautoā€, or perhaps youā€™ve selected the ā€œpreload streamā€ option, or maybe something else on your network is connecting to the RTSP server, but, whatever it is, the logs will show it the IP address of the connecting client.

I had one user that was clearly having something unknown on their network connect to the stream, although they didnā€™t know what, but setting a stream password stopped it, so clearly some application was finding the open RTSP path and connecting to it, which of course triggers a stream to start.

Basically if you configure anything that constantly tries to connect to the RTSP stream, then the addon will constantly start live streams because thatā€™s what itā€™s being requested to do. You need to make sure that configured clients only connect to the RTSP server when there is an active viewer.

That was absolutely it. I didnā€™t think about the other view that was being activated in addition to the one I was testing and it was set to live instead of auto. Thanks!

I was just suggesting that you can add another button to toggle the event selector between last ding and last motion events. You could do this easily by leveraging an input_boolean with an automation to toggle the selected event. Then the input_boolean can be added as an entity on the bottom of the card. This would require potentially two clicks instead of one to open your desired event stream, one to select the desired event (if not already selected) and a second to open the actual stream, but thatā€™s pretty light overall.

Personally, as I mentioned above, I just add the selector as a separate entity and use a stack-in-card to put the entities together. This gives me a card like this:

image

This way I can pretty much do everything from a single card with no automations required. The still image displayed is updated from snapshots so I can see the most recent motion snapshot if there is one, and clicking the image opens a live view. The little CCTV camera in the bottom right of the camera image is highlighted any time a live stream is active and allows toggling a recording on demand or turning off the stream immediately after viewing, rather than waiting on Home Assistants default 5 minute timeout. The motion and ding icons highlight if anything is detected.

The event selector at the bottom lets me pick an event and then clicking on the VHS tape icon in the bottom middle opens the event stream camera and plays back the recorded event from the selected drop down.

This image is actually from my dev system, my production setup is somewhat visually tweaked from this to have less empty space, but overall itā€™s the same. For what little I use the HA UI I find this setup quite usable.

Yeah Iā€™ll probably replicate that for the doorbell, was just trying to avoid the drop down and just have the button. For the floodlight only care about the first last motion so thats fine. Thanks for sharing your setup.

Actually, one more question. Please can you say what you have done to stop the glance card snapshot going black and white, its driving me nuts. I know it has on and off states but for the life of me I canā€™t make it go colour.

Please can you say what you have done to stop the glance card snapshot going black and white, its driving me nuts. I know it has on and off states but for the life of me I canā€™t make it go colour.

That sounds like you are selecting a state entity for the picture glance card. If you select a state entity, then the picture will be color when the state is on/true, and black and white when the state is off/false. So, for example, if the state entity is the stream switch entity then the image will be color when the stream is active, and black and white when the stream is inactive. The state entity is optional for the picture glance card so I just donā€™t use it at all, then the image will always be color.

1 Like

You can get really close to this with an input boolean and an automation. Just go to Configuration and select ā€œHelpersā€, click ā€œAdd helperā€ and choose ā€œToggleā€ and name it what you want (something like Doorbell Event Toggle, or whatever) and choose an icon (I choose the bell ringing icon so that, when itā€™s highlighted, it plays back the last ding, but whatever, itā€™s totally customizable so you can choose an icon that makes sense to you).

Once the boolean is created just build a simple automation that, whenever the input boolean is changed (it behaves just like a switch so state to on/off) the action is to set the event selector to ā€œMotion 1ā€ or ā€œDing 1ā€. Then you just add this input boolean as an entity to the glance card and a quick click switches between Motion or Ding events before you click the icon to open the stream. I ended up with something like this:

image

When the ringing bell icon is dim, as in this image, and I click the VHS icon, I get the most recent motion event, if I close it, click the bell icon, then click the VHS icon, I get the most recent ding event. Perhaps not perfect, but pretty simple to setup and use and at least close to what you are looking for.

LOL, I just saw this. I would argue this project has plenty of exposure because, if it had more, it would probably drive me crazy as there are already too many requests. Although I must admit that it has died back down to a more manageable level lately so I think Iā€™ve managed to claw it back to a reasonably stable state, which is good, because Iā€™ll likely have almost no time for this project in the next couple of months. But with all the stuff Ring is introducing, Iā€™m quite concerned about the maintainability of this project going forward.

My ring devices do not seem te be recognized.

ring-mqtt No devices found for location ID ā€¦

Any idea how to solve?

What devices do you have? If itā€™s just cameras then make sure youā€™ve actually enabled camera support.

I was looking for an alternative to the official integration as that bleeds my memory causing my system to crash every 1-2 days. I didnt read the application notes well enough to understand it doesnā€™t support doorbells and as you said for the camera I have i need to do some additional configuration.

It does support doorbells, you simply have to change the config option to enable it and if you want to stream live or recorded video, simply manually configure the required IP camera settings.

Got it, devices are now properly identified. Will start playing with later today.
Thanks for the heads up!

thanks for great work @tsightler , when I try to install the add-on on Raspbian GNU/Linux 10 (buster) I am getting error as [supervisor.docker.addon] Invalid build environment, can't build this add-on!

Do you think this is an issue with add-on configuration or a build restriction of HA? I am running on armv7l and it is not listed here: https://github.com/tsightler/ring-mqtt-ha-addon/blob/77ed6e44763bf081f3222ec4fb1595f7a0b0d8d9/config.json#L8 but I do not think this is a blocker, as I have many other add-ons without this and they are working fine.

It should not be attempting to build the addon, so I donā€™t understand the error message at all. it should be just pulling the image from docker hub. Are you saying you have manually installed the supervisor on Raspbian?

Yes i have supervised installation without hassos in Raspbian (not supported)

You might try just pulling the Docker image and seeing if it will run manually, my guess is it probably wonā€™t. Iā€™m thinking you are probably hitting https://github.com/tsightler/ring-mqtt/issues/237 which is causing the weird message from the supervisor since you are running Raspbian 32-bit, which has outdated Docker and libseccomp2 libs, unless youā€™ve already updated both of them manually.

Thanks, you are definitely right, i need move into a supported OS. I will try 4.7.2.

On a separate topic, i have an integration and add-on for eufy security cameras and asking users to install rtsp server as a separate add on. You can think about separation of concerns.

Enjoy your day

Hi there.
Great job with the ring-mqtt addon, @tsightler
I am using 4.8.5 (I guess latest release) on home-ass running on pi4, trying to figure out if I can totally rely on this addon, by saving the videos I record after motion is detected, potentially saving the money I am paying to Amazon.
I managed write an automation to save 30sec of video recorded to a local folder on sd-card, which works - sweet.
As Amazonā€™s sub expires in June next year, I have time to experiment with the addon, while checking what happens to the motion detection once I run my automation.

Perhaps it is a bit cumbersome as an automation, but this is what I do:

- id: '1634110578903'
  alias: Motion-RING
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.front_motion
    id: RingMotionDetected
    to: 'on'
  condition:
  - condition: time
    after: 00:00
    before: '23:59'
  action:
  - service: switch.turn_on
    target:
      entity_id: switch.front_live_stream
  - service: camera.record
    target:
      entity_id: camera.front
    data:
      duration: 30
      filename: /config/downloads/{{ now().strftime("%d%m%Y-%H%M%S") }}.mp4
  - service: switch.turn_off
    target:
      entity_id: switch.front_live_stream
  mode: single

So, I am basically turning the live_stream on, record 30 seconds and save, then turn the live_stream off.
I found elsewhere in this long but useful thread that keeping live_stream disables motion_detection in the Ring, hence why I am disabling it after recording is finished.

However, after the automation is finished, I noticed that Ring records 12min of video in the cloud (I have 60sec setup in the Ring app, and if I stop the ring-mqtt addon, I get recordings of 1min following motion), recorded by Ring after the same detection.
And only after those 12 minutes Ring becomes responsive to any further motion.

Questions from me:

  • Am I doing something I should not do in the settings?
  • Is there a way to make Ring motion responsive straight after disabling live_stream in the ring_mqtt?

Thanks
Giuseppe