Ring Device integration via MQTT w/ Video Streaming

Somebody who is a more advanced Home Assistant user may be able to help you more, but what exactly have you tried? It’s just a switch, you turn it on or off like any other switch/light and there are lots of examples of other automations to do this.

Sorry. I didn’t see the switch at first. It’s all clear now and works great. Thank you

@tsightler Your ring integration works great thank you. hope you can add keypad to the alarm card at some point but otherwise working very nice even with 2 locations(home office alarms) :+1:

Hey, me again :slight_smile:

I used to use ifttt for some automations (before ever using HA) to flash lights when the doorbell was rung. I also used an Alexa automation to have it announce when it rang. It worked fine but recently decided to switch it to HA with ding as a trigger to make Alexa speak.

I had two doorbell rings today and noticed ding is not updating, its reporting clear for several days. I know we discussed flaky wireless etc. previously but what I am experiencing is, ifttt light flashing is triggering (my lights flashed both times when doorbell was hit by delivery guy)… but ding sensor in HA is not getting updated. So something is not right, right? And it cant be connection related as presumably ifttt trigger is using same api also?

You can just manually configure an alarm control panel with a keypad, I’m not really sure it makes much sense to add it as an option to the addon for the small number of people that want it. Instead of using the automatically discovered device just manually define an alarm control panel with a PIN and you get a keypad. For now I’m unlikely to add it because the request is Home Assistant specific.

To be fair, when we were talking about possible network issues I believe we were discussing streaming, which is an on demand call that requires a fast startup to get and active stream and then grab a shot from it. That’s completely different from the polling interface for dings/motions events.

My guess is that the issues with dings not being registering are related to underlying issues with ring-client-api that have been ongoing. You can read more about it here: Ring Video Door Bell 3 "Falling Asleep" · Issue #656 · dgreif/ring · GitHub

Note that this issue is being reported not just in ring-mqtt, but in ring-homebridge as well, so it’s the underlying ring-client-api (and likely, the underlying got engine beyond that) where the problem seems to be. All of this started after ring-client-api moved to using HTTP2 for connections to Ring, but that was precipitated by other changes to Rings server infrastructure that required HTTP2 use for streaming setup. I’m not the maintainer of ring-client-api and I have no idea when/if it will be fixed, or even if the problem is there, or the underlying got library, which has some clear problems with HTTP2, or even node itself, which has it’s own problems with HTTP2 (it’s only recently become even marginally stable).

I was going to attempt to work around problem by detecting the issue and restarting the connection, however, I haven’t even been able to figure out a way to detect the issue in my code as it basically stops working completely silently. I still get what appears to be valid polling data, but the status simply never changes.

I’m currently thinking about simply removing camera support for the time being since I don’t have time to dig into this to the level that would be needed to even hope to fix it and, for the majority of users, they can just use the native HA integration for dings/motion events, there’s really no reason to use this addon for that function anyway.

I did make a custom alarm panel with keypad and code but not sure how to assign it to the real panel identity to actually work with alarm.

Oh absolutely was about streaming before. I’m just trying to not raise any more issues without trying to rule that out and waste your time coming here to repeat yourself as it does have god awful wireless signal :slight_smile: I’ll try the native integration again, I switched from that because ding was always giving me errors in the logs and this was working so well with the alarm.

Instructions for configuring an alarm control panel with pin are in this post (example in second post): No alarm pin pad · Issue #13 · tsightler/ring-mqtt-ha-addon · GitHub

1 Like

I mean, I hope that the reliability of the camera function can be improved in the future, however, the core of the issue is that Ring’s API for their cameras is pretty old school. The alarm uses a websocket, it’s reliable and fast. The camera API relies on a polling model where you literally have to make a call for active dings every X seconds to get the status.

I’m hopeful we’ll eventually be able to improve it, the move to HTTP2 in ring-client-api has definitely made things much worse, but it was needed because the old HTTP1 connection were being throttled by Ring which led to many other issues (this might even be why the native integrations gets so many errors). The big issue is that key people that work on these projects just don’t seem to have time right now as it’s a complex problem with lots of dependencies and we’re all pretty busy. I have an idea how to implement a workaround by implementing a manual timeout/retry, but I haven’t had time to even attempt it lately.

Thanks @ tsightler for this amazing addon. I struggled to get this added (still learning) I finally figured out how to add this in supervisor → Add-on store-- Repositories. Added the custom integration. Added Mosquitto Broker. I am running my HA with Duck DNS

Mosqutto Configuration

logins:
  - username: usersam
    password: passwd
customize:
  active: false
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false
anonymous: true

Mosquitto Log on start

[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…
[15:43:09] INFO: Setting up user usersam
[15:43:10] INFO: Certificates found: SSL is available
[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.
[15:43:12] INFO: Starting NGINX for authentication handling…
[15:43:12] INFO: Starting mosquitto MQTT broker…
1623699792: mosquitto version 1.6.12 starting
1623699792: |-- *** auth-plug: startup
[15:43:14] INFO: Successfully send discovery information to Home Assistant.
[15:43:14] INFO: Successfully send service information to the Supervisor.

Ring MQTT configuration

enable_cameras: false
snapshot_mode: disabled
enable_modes: false
enable_panic: false
enable_volume: false
mqtt_host: <auto_detect>
mqtt_port: <auto_detect>
mqtt_user: <usersam>
mqtt_password: <passwd>
branch: addon
ring_token: ''
location_ids:
  - ''

Ring MQTT log
Running ring-mqtt…
2021-06-14T19:45:17.568Z ring-mqtt Using configuration file: /data/options.json
2021-06-14T19:45:17.586Z ring-mqtt Reading latest data from state file: /data/ring-state.json
2021-06-14T19:45:17.890Z ring-mqtt Attempting connection to Ring API using saved refresh token.
2021-06-14T19:45:20.201Z ring-mqtt Connection to Ring API successful
2021-06-14T19:45:20.208Z ring-mqtt Starting connection to MQTT broker…
2021-06-14T19:45:20.518Z ring-mqtt File /data/ring-state.json saved with updated refresh token.
2021-06-14T19:45:21.452Z ring-mqtt Unable to connect to MQTT broker. Connection refused: Not authorized
2021-06-14T19:45:22.503Z ring-mqtt Attempting to reconnect to MQTT broker…
2021-06-14T19:45:22.556Z ring-mqtt Unable to connect to MQTT broker. Connection refused: Not authorized

MQTT Log
1623700041: Socket error on client , disconnecting.
1623700042: New connection from 172.30.33.4 on port 1883.

I have tried everything changing user names, passwords removing special characters from passwords. Changing ports on the Ring MQTT. Just struggling, have done everything but bang my head against the wall. Can someone please help?

Looks like MQTT Is not setup correctly did you put your MQTT Password/User in the Ring configuration?
enable_cameras: false
snapshot_mode: disabled
enable_modes: false
enable_panic: false
enable_volume: false
mqtt_host: <auto_detect>
mqtt_port: <auto_detect>
mqtt_user: YOUR MQTT USER NAME
mqtt_password: YOUR MQTT PASSWORD
branch: addon
ring_token: ‘’
location_ids:

  • ‘’

@randr yes I did. I read through this and it seemed another user had the same issue. However did not provide a solution. For Now the user is “usersam” and password is "passed. I plan on changing it after I get it working

mqtt_user: <usersam>
mqtt_password: <passwd>

ring config
enable_cameras: true
snapshot_mode: all
enable_modes: false
enable_panic: false
enable_volume: false
mqtt_host: <auto_detect>
mqtt_port: <auto_detect>
mqtt_user: <auto_detect>
mqtt_password: <auto_detect>
branch: addon
ring_token: ‘’
location_ids:

  • ‘’

MQTT
logins:

  • username: xxxx
    password: xxxx
    anonymous: false
    customize:
    active: false
    folder: mosquitto
    certfile: fullchain.pem
    keyfile: privkey.pem
    require_certificate: false

@PapaLanc Genius changing both to “auto_detect” did the trick. No errors any more and the Ring MQTT add on shows the devices in the log

2021-06-14T23:09:38.624Z ring-mqtt ring/alarm/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","firmwareStatus":"up-to-date","lastCommTime":"2021-06-14T23:07:39Z","lastUpdate":"2021-06-14T23:07:39Z","linkQuality":"ok","serialNumber":"","tamperStatus":"ok"}

I have taken some serial codes out but I see a lot of devices. but nothing in “Entities” or “Devices”. So Close! Please help me solve this. Thanks for the replies and the help. I appreciate it.

I read through another 100 or more posts and figured I had to configure MQTT Configuration → Integrations → Mosquito Broker. Once I accepted the default configuration and re-booted all my devices are showing including all zones in my Ring Retrofit. Once again thank you at @tsightler for this add on as well as all who have helped to make it a success. I hope that it will be supported in the future. Also thanks to the great support group

2 Likes

Sorry for the lack of response, just really busy these days. I’m glad you managed to get it working and thanks to those that participated and helped with answers! The summary version is, if you are modifying config files and changing username/passwords from the default, then you are probably doing it wrong. Done correctly, Home Assistant manages this for all internal addons that leverage the addon APIs.

The basic steps are, install Mosquitto addon and start (use defaults), install Home Assistant MQTT integration and configure with defaults, then install Ring addon, use web interface to initialize authenticaiton to Ring and that’s it. The addon can of course be used with non-default setups if, for example, you want to manually manage username/passwords or use external MQTT brokers, etc., but for the typical HA use case, it’s really as simple as those three steps, at least, it should be.

Hi tsightler :slight_smile: I was wondering if the Ring external siren is exposed like the other home alarm devices? Tamper status, battery, states etc. (also appears to have volume control in app). I recently brought one and it doesn’t seem to get discovered. Maybe could be added to the wish list for the future. Thanks.

Every single device requires explicit support so if it’s not on the “Supported Device” list in the readme, then it’s not supported.

There’s already a request to support external siren on the project Github page so it might become supported one day. Unless someone else creates the patch it’s likely that this day is far in the future as I don’t have much time for this project these says and it takes what little time I do have just to keep it working with all the things HA and Ring break every few releases.

1 Like

Yeah of course, totally understand. I know it isn’t supported was curious if it was not possible or just not implemented (didn’t spot the git issue as I keep going to the HA Addon git). Do you own a ring alarm then, just no siren? If you pass me a paypal email I’ll donate you one :slight_smile: - with no expectation to support it now or ever, just for keeping the lights on for us and sharing your efforts.