Ring Device integration via MQTT w/ Video Streaming

Also, recent versions of the addon support setting a disarm pin in the config (look at disarm_code option in the addon configuration). The option does not enforce requiring a code for arming though, only disarming. With the manual configuration method you can do whatever you want.

1 Like

@tsightler nice work you did with the Ring addon, thanks a lot!!

I have googled and read a lot, but didnā€™t find the answer anywhere. I want to trigger the alarm from HA but I cant get it to work.

Is it possible to trigger the alarm from HA through a automation? I tried the alarm_control_panel.alarm_trigger service but nothing will happen.

I donā€™t think that attempting to call the alarm_trigger server will work because it wonā€™t send a recognized command to ring-mqtt. However, there is a switch for the siren (if you want siren only), which you can trigger using any automation, but this doesnā€™t trigger an actual alarm event (itā€™s the same as the test siren option in the Ring app). If you are wanting to trigger an actual alarm event (i.e. fire or police), then youā€™d have to enable support for the panic switches, however, itā€™s likely a violation of your terms of service to trigger this automatically if you have Ring professional monitoring, which I believe is required to get the panic switches to work (Iā€™ve had conflicting reports on this, I have professional monitoring and they work). Outside of using the panic switches I donā€™t believe there is any way for the API to trigger an alarm event.

Thanks for your quick reply :slight_smile:

I will use the panic switches for now, as you might know we dont have the professional monitoring in Europe, so I wont violate any terms!

I have tested the panic buttons, its working as it should :).

Hi, I have a weird issue that started up about a week ago. I noticed that ring-mqtt stopped working and looked at the log file, and the last entry in the log (/var/log/ring-mqtt.log) was on aug 16th. Not sure if thatā€™s when it stopped, but probably.

I have a ā€œstandardā€ install, where ring-mqtt is installed in a directory and run using systemctl.

When I run it in ā€œdebugā€ mode off the command lineā€“it works! It starts up, the entities re-appear in the HA dashboard, and everything appears fine. I see traffic in the debug output, etc., this is basically running ā€œ/usr/bin/node ring-mqtt.jsā€ on the command line. Working fine.

But somehow around Aug 16(?) it just stopped working with systemctl. Rebooting, etc., doesnā€™t change anything. I looked at systemctl and it CLAIMS that the service is running, but, nothing is happening.

If I do systemctl list-units it even shows it ā€œloaded active running ring-mqttā€ ā€“ but nothing. Nothing in the ring-mqtt.log, and no entities in HA, unless I run it off the command line.

I will keep looking into this later - but itā€™s weird. Is there any reason why anything would have broken that recently? Iā€™m running Ubuntu 20.04.1 and it was working fine for months and months. I was actually on vacation the day it broke so Iā€™m pretty sure itā€™s not something I did? But maybe some auto-update happened? Or it broke earlier and just restarted that day?

Anyway wondering if you have ideas why the systemctl script would have suddenly stopped.

For now itā€™s working, Iā€™m leaving a shell open with the debug version running! But obviously Iā€™d like to to restart automatically when the machine reboots, etc.

Thereā€™s certainly no auto updates of ring-mqtt with the standard install, maybe some update of Ubuntu, but unit files havenā€™t changed much. I have to say that you are in the super-slim minority running this project with a standard install at this point so I donā€™t have much experience. I was a long time holdout, but even I use only Docker and the addon these days, and have been considering dropping support for the standard install method in 5.x where I plan to introduce video streaming support which has some dependencies on additional binaries that would make manual install more annoying.

That being said, the unit file is super simple, if you are using the one from the ring-mqtt Github repo it sends logs to /var/log/ring-mqtt.log when run under systemd so that might provide some clue. Also, while systemctl says itā€™s running, do you actually see a node process with ring-mqtt.js in the ps output? It could possibly be that itā€™s somehow become confused and there is a lockfile or something stuck for the process. Feel free to open an issue on Github ring-mqtt project and we can try to troubleshoot.

I have a bit of a strange one and before I build a new install on a machine from scratch to test I wanted to check in here.

I had Ring-MQTT running on an RPi3 for a while and all good but a few months ago it stopped working and couldnā€™t get it operational again. Iā€™ve now taken the time to move everything over to a NUC running Proxmox and the Hass image on a VM. Everything is really snappy now but no luck on Ring-MQTT (I did restore a snapshot so any bad config would have carried over!!).

This is the first thing Iā€™m using MQTT for so wasnā€™t certain that my config is correct but have uninstalled and re-installed both Mosquitto and Ring-MQTT and reconfigured including adding a new MQTT user. It seems to be working as I can test topics and can also attach an external MQTT client and receive/publish topics both ways from Mosquitto.

The Ring-MQTT log is showing me having a successful connection to Ring API and from what I can tell, the MQTT broker but no devices are created (although they were there previously). One thing that occurred to me today is that I am a shared user on another Ring account but that is offline at the moment (and I donā€™t have access to fix that right now). I tried to log in to remove myself as a shared user but as all devices are currently offline, the Ring app wonā€™t allow me to.

So my question is, would discovering a valid second location but with no active devices cause the process to ā€˜hangā€™ and not create devices for my primary location? Also, what MQTT topic should I be expecting to see sending data on setup of device and/or status updates?

PS: love the add-on and the constant updates. If only Amazon would release the Ring lighting over this side of the world (Ireland) it would be greatā€¦

Yes, unfortunately the API has an expectation that all locations be online during startup so thatā€™s almost certainly your problem as it will hang forever waiting for that location to come online. Technically I could work around this by adding some type of timeout the the getDevices() request, and itā€™s on my forever long to-do list, but itā€™s just been a low priority.

You can easily restrict locations to only the one you want to monitor using the ā€œlocation_idsā€ configuration option. Just copy the location ID as shown in your log (you can also get it easily by logging into the Ring web app) and paste it between the quotes and restart, then the addon will restrict itā€™s view to only that specific location (you can also add multiple location ids there as well).

1 Like

And just like that, itā€™s working againā€¦!!! Added the specific location ID and the entities are lighting up againā€¦ That never even occurred to me to try that. :man_facepalming:

Thank you so much. Both for the extremely fast reply, and also again for all your work on the add-onā€¦

(Oh and my apologies. Now that I know what issue to search for, I see you answered the same question in the thread above not too long agoā€¦ As always, knowing the actual problem is half way to finding the solutionā€¦!)

Good evening!
I recently discovered that the Ring integration with HA is consuming a massive amount of data on my network, around 20 GB per day. I turned it off and the usage went down to almost nothing. Any idea what could be going on?

Do you have cameras? If so, how many? Also, are any of them battery powered? If so, how many? Are you using the snapshot interval feature or the snapshot on motion feature, or both? 20GB sounds like a lot for any case, but better to get some type of baseline first.

I have the Ring doorbell, one stick up cam, and the security system. All I really use in HA though is turning security on and off. I have a dashboard set up where i can arm and disarm. I also have a couple jobs that when I click a button it does a bunch of things, like turning all the lights off, locking the doors, then arming the system. Monitoring the data, however, it seems like it was constantly uploading and downloading data, and after trial and error, disabling the ring/mqtt is what fixed the issue.

Do you have camera support enabled in the addon? Iā€™m just trying to narrow down possibilities as the alarm portion shouldnā€™t use much traffic at all so I feel like the camera portion is the most likely. You didnā€™t answer if they were battery powered or not though, which makes a big difference in the possibility.

The camera interface does require constant polling to get events, it polls every 2 seconds for ā€œdingsā€ (doorbell presses and motion events) and every 20 seconds for status of things like lights and siren, however, these are extremely small queries, a single HTTP request and a small JSON response each time. Of course cameras updating snapshots will constantly pull data as well, but Iā€™d estimate ~200MB per camera per day using the default 30 second interval, although this will be more for battery cameras, especially if there are lots of motion events, since they will start video streams each time thereā€™s a motion event.

No matter what, 20GB seems like a LOT. I check my install and my entire HA instance has only done about 1GB in the last 24 hours, and I have 7 cameras.

Sorry, I missed that, and I forgot a third camera. All are wired, no batteries.

These are the options in my configuration:

enable_cameras: false
snapshot_mode: disabled
enable_modes: false
enable_panic: false
beam_duration: 0
disarm_code: ''
mqtt_host: <auto_detect>
mqtt_port: <auto_detect>
mqtt_user: <auto_detect>
mqtt_password: <auto_detect>
branch: addon
ring_token: ''
location_ids:
  - ''

OK, so you donā€™t even have camera support enabled. I have no idea what could possibly use so much data, doesnā€™t even seem possible. The alarm code only makes a single websocket connection, there is no polling at all, everything is sent realtime and itā€™s super simple and small communications.

I ran traffic monitoring on my production system with ring-mqtt and the total traffic in about 4 hours was about 40MB, and thatā€™s with 7 cameras polling every 30 seconds. I have no idea how it could possibly ever create 20GB of traffic.

If you want you can open an issue on the github project and we can try to dig into it further, but, realistically, without a packet trace, Iā€™m not sure what else could possibly be done, and even that might not be very useful since all the traffic is encrypted, but it would at least help us be sure it was traffic to Ring servers, although I donā€™t know what else it would be.

OK, so I think Iā€™ve maybe figured this out. Can you tell me what DNS servers you have configured for your HA instance? Is it a local, caching one, or directly to an upstream server?

Recent changes to ring-client-api have switched from using HTTP2 back to HTTP1 but did not enable any DNS caching (previously HTTP2 used a persistent connection so not many DNS requests). This has dramatically increased DNS requests from the API (you can read about it here Massively increased DNS requests Ā· Issue #741 Ā· dgreif/ring Ā· GitHub),

If you are not using a local DNS server (or one on your router, or your router doesnā€™t cache and just forwards requests directly to an upstream), then you will see a large amount of DNS traffic, and I mean a LARGE amount.

I tested this on my lab setup by manually changing my HA instance to use Google DNS at 8.8.8.8 and, I was seeing about 30MB of traffic per minute, so easily 20+GB a day. After switching back to my local DNS server, Iā€™ve seen only 3MB of traffic in 20 minutes, so about a 200x decrease in traffic.

Unfortunately, I am not skilled enough to know the answers. When I ran HA DNS INFO, it said host: 172.30.32.3 and local dns://192.168.86.1. Iā€™m guessing that doesnā€™t really answer the question though. My HA is on a Raspberry Pi device.

Does not matter, but I am curious how you ran HA DNS INFO on a PI?

In any event supervisor on the left side and system right top, change IP.
So if it is set to dhcp you should be able to run ipconfig on another system on DHCP to see what it is setting the DNS server as.
Or just manually configure a static IP

It seems likely that 192.168.86.1 is probably your router, but no idea if it just forwards requests or actually caches them. Out of curiosity, how were you able to determine the traffic, i.e. what showed you this traffic? If it was just the router it may have just been showing all of the DNS queries but not actually forwarding it upstream (mine does exactly this, it showed 30MB of traffic per minute, but not upstream because the local DNS cache was actually serving the replies).

Iā€™m going to try to implement a dnscache in the container for the next release, but you could always add the dnsmasq addon in HA and point your DNS there instead.