Ring Device integration via MQTT w/ Video Streaming

I really don’t see how this would be possible. Ring does not provide any type of official API so we’re forced to basically reverse engineer the existing protocol used by the Ring applications. If 2FA is enabled, as far as I can see, the only way to receive the second factor is via text message (for example, it’s not even possible to access your account if your phone is broken/dead/unreachable, without calling Ring customer support).

I suppose it might be possible to prompt for the 2FA during script startup, but that seems pretty ugly and would pose issues for things like system reboots and interruptions in internet service, etc., where authentication has to happen automatically.

In an ideal world Ring would provide a proper API for 3rd party integration, allowing people to get an API key/secret to access functions instead of using their user login, but I’ve not seen anything that would indicate they are planning to provide something like this.

Thinking about this 2FA thing a little more, do we know if it is “per-account”? I.e., my wife logs in with her account and I share devices with her. If I have 2FA enabled, can her’s be disabled?

If so, then perhaps the simple answer is to create a second email/user to share your account with, then your regular account can have 2FA enabled and this second account could be used for the integration. I’ll give this a test.

Very clever, buddy. I have 2FA set on my phone and my wife doesn’t on her phone. She logged into the app just fine without 2FA. I guess I’ll just use her login credentials for the add on. Thanks!

Yeah, I actually have a special email account that I use with some automation services like IFTTT, and so I just shared my Ring setup with that account, then, when I registered that email address with Ring, I named it Home Assistant. This is nice because now when I perform automation actions from within HA, like Arm/Disarm, it actually says “Disarmed by Home Assistant” in the event logs where previously it showed my name. Now I can have 2FA enabled on my account while using this service account for the script so it’s actually really nice.

Hi,
I am using HassIO in a Raspberry Pi 3, i have installed this add-on from: https://github.com/rs1932/ring-alarm-hassio-addon, but the ring device dont appears in my home assistant, I am not an expert, your help will be appreciated.

this is my configuration:

add-on:

 {
   "host": "192.168.2.6",
   "port": 1883,
   "ring_topic": "ring",
   "hass_topic": "hass/status",
   "mqtt_user": "<mqttuser>",
   "mqtt_pass": "<mqttpassword>",
   "ring_user": "<ring_email>",
   "ring_pass": "<ring_password>"
 }

Mosquitto broker add-on Configuration:

{
  "logins": [
    {
      "username": "<mqttuser>",
      "password": "<mqttpassword>"
    }
  ],
  "anonymous": false,
  "quiet_logs": true,
  "customize": {
    "active": false,
    "folder": "mosquitto"
  },
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

Configuration.yaml:

mqtt:
  broker: core-mosquitto
  username: <mqttuser>
  password: !secret msqtt_pass
  discovery: true
  discovery_prefix: homeassistant
  birth_message:
    topic: 'hass/status'
    payload: 'online'
    qos: 0
    retain: false

the log from the add-on is:

Ring Alarm Integration
Node Version
v10.14.2
NPM Version
6.4.1
git version 2.20.1
added 121 packages from 89 contributors and audited 427 packages in 21.324s
found 0 vulnerabilities
up to date in 4.282s
fixed 0 of 0 vulnerabilities in 427 scanned packages

and the log from the mosquitto server dont show log from the add-on connection :frowning:

if you can help me i will appreciated a lot!
thanks and regards

@tsightler,

Love the integration here, I have a wink to manage all of my Z wave devices and using Hassio. I have a couple of GE Z Wave Smart Switches added to my ring, and can manage them with the Ring app, however these do not get ported into HA, any plans to add these? I would love to just get rid of my Wink as their API keeps changing and all of my automations start failing.

Thanks,

is that required? I have tried everythiing but i do not have that in config, i assume when you “configure” the integration it would do this, but i guess not

It’s pretty easy to get Z-wave sensors working with the script, you might want to read through this issue:
https://github.com/tsightler/ring-alarm-mqtt/issues/16

You’ll see there that we managed to work out the changes required, and they are super simple, but the challenge is that I have no way of knowing what class of device it is so it will just show up as a generic sensor, vs having the proper icon, or I can assume they are all door sensors. Still, I do plan to hack this in soon, and my idea is to have a separate devices.json file where you can override device class as required.

I’ve been busy renaming the project and adding camera support, but I think I’ve got that working now so I’ll look to add support for generic Z-wave devices soon, but it will probably be a few weeks as I’m taking some time off.

If anyone is interested, I’ve forked a new project and added support for Ring cameras. Not the video stream, but the motion, doorbell, light and siren functions. You might wonder why you would want this since Home Assistant already has camera support. It’s a good question, but Home Assistant has no native support for lights (although there is a custom component for this), or siren, but, more importantly, I’ve found that the native Ring component misses motion events on a regular basis, and it only polls for events every 10 seconds, which is slow even when it does work. While the script still only polls for light/siren status every 20 seconds, it polls for dings every second, so you get a much faster and reliable trigger for automations.

Also, there are quite a few people using this script with MQTT tools other than Home Assistant, so having support for cameras and alarm devices in the same code base is nice. And I’m hoping to add support for Ring smart lighting down the road.

If anyone is interested in testing this new functionality, you can get it here:

sorry about the insistence… someone could help me with the issue that i mentioned in some days before?

this post:

https://community.home-assistant.io/t/ring-device-integration-via-mqtt/102105/127?u=brainsop

thanks and regards!

Hi @tsightler,

I have noticed that every couple of days or so the ring-alarm-mqtt will stop communicating with my broker. Do you know where I can check this? What I have to do is go SSH into my pi and send a sudo systemctl stop ring-alarm-mqtt then a start and use an MQTT explorer to visualize that the ring is coming in.

Where can I go debug this?

How do I get the ring alarm to arm with windows open? The hub just sits and repeats “sensors require bypass” and never arms the alarm.

There is currently no support for arming the alarm when there are sensors that require bypass. Today, when you attempt to arm the alarm, the code will try 12 times with a 10 second delay each time, so basically every 10 seconds for 2 minutes, which is what it just “repeats sensors require bypass”. The idea behind this was if someone attempts to arm but a sensor is still tripped for a short while, like a motion sensor if you just left.

It’s not really clear to me how I could implement a usable solution for sensor bypass within Home Assistant. It would be easy for me to implement in the code as the API supports it by passing the an array of device IDs that should be bypassed, however, I don’t see any way in Home Assistant that I could easily implement this.

One thought was to attempt to arm and, if it fails, look at the status for each sensor and then automatically bypass any that are in tripped state, however, this I’m not sure this is a good idea. I suppose this is similar to the way the app works, but at least the app shows a prompt and you have to accept the bypass (at least I think it does), but I don’t see how to really do this with HA. I’m open to implementing this if it seems acceptable though, perhaps enabled/disabled with a config option as I think it’s a little risky (could easily arm your alarm even if the door is wide open for example).

@BrainSop I’d look carefully at your MQTT configuration. At least in the config files you posted your MQTT user/password settings do not match at all and the fact that you have no messages at all implies that you are not even getting an MQTT connection so I’d start there.

@HA_fanatic I have not idea what would cause this behavior as I run the script for weeks/months are there are lots of users and this issues has not been reported previously. It could be a bug in my script that is being triggered perhaps by some device I don’t have in my setup so couldn’t test thoroughly.

I’d suggest running from the console with debug turned up, at least with:

DEBUG=ring-alarm-mqtt,mqtt

Which will give debug for connecting to ring and mqtt broker. When the code stops working you should see log output that indicates what the code is doing.

The Ring app does pull up a prompt to have you bypass. However, ring recently release a feature that lets you arm/disarm the system via smart lock. This method automatically bypasses any sensors that are tripped.

Personally I would love to see a feature that lets me arm and bypass. Maybe you only can bypass if setting to stay vs away? Although I do leave windows open if away for a short period of time… At night we like to have our windows on the upper floor open for air meaning I can’t use HA to arm my system to stay at night. It’s more common then not that I have at least 1 thing in a tripped state. It would be sweet to be able to enable/disable from the config. If the default was to bypass tripped sensors except for if in a include list that would be awesome. Example, I could explicitly say if the door is open don’t arm. But if the door wasn’t in the list then it would arm

Is unlocking/locking doors not supported either? I noticed this feature is not working. Appreciate all the work! This entire thing is awesome!

@tsightler thanks for your answer! i have looked in the MQTT Configuration, and the Add-on configuration and the user/password is the same, this is my add-on configuration:

{
   "host": "192.168.2.6",
   "port": 1883,
   "ring_topic": "ring",
   "hass_topic": "hass/status",
   "mqtt_user": "<mqttuser>",
   "mqtt_pass": "<mqttpassword>",
   "ring_user": "<ring_email>",
   "ring_pass": "<ring_password>"
 }

and this is my MQTT Config:

{
  "logins": [
    {
      "username": "<mqttuser>",
      "password": "<mqttpassword>"
    }
  ],
  "anonymous": false,
  "quiet_logs": true,
  "customize": {
    "active": false,
    "folder": "mosquitto"
  },
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

I have replaced the user by and the password by .

but the strange is there is no appears error in the add-on logs, only appears this lines:

Ring Alarm Integration
Node Version
v10.16.0
NPM Version
6.9.0
git version 2.22.0
added 121 packages from 89 contributors and audited 427 packages in 23.755s
found 0 vulnerabilities
up to date in 5.313s
fixed 0 of 0 vulnerabilities in 427 scanned packages

in the MQTT Server logs no appears connection from the add-on, by the way, the mqtt servers is working well because i use it with sonoff device with tasmota firmware, and is working well.

i have tried to uninstall and install the add-on, but the result is the same :frowning:

any help to debug the issue will be appreciated!

thanks and regards.

@joengelhart1 One thought I had would be to create a dummy “switch” that you could use as a “prompt” to bypass arming. For example, if there’s an attempt to arm, and it fails due to a tripped sensor, it would toggle the switch to an “on” state and if you manually flipped this switch back it would start a time for say 5 minutes that allowed bypass arming. This way you would get a visual indication that sensor bypass was required and you could either manually flip the switch to “acknowledge” or it could be automated if you wanted automatic bypass.

I’m not sure about this idea, but it’s somewhat similar to what the app does in that it requires an additional confirmation if you want to arm in bypass mode. I’m in the middle of a pretty major refactor on the code right now, but once that’s done I’ll try implementing some of the options and see if any make sense.

Regarding locks, they “should” work, however, I don’t personally have a lock, and I’ve only had two reports of people using it, although they both said it worked fine. It’s possible there are lock devices that behave differently in some way or aren’t recognized by the code. Do you see the lock and lock status and it’s just the commands not working or do you not see the lock at all?

Prime day discount has the Ring 5 piece alarm from $199 to $119 so thinking about adding it just for the keypad (traditional nature of it for guests).

Can I check, and apologies if this was obvious in the github read me, but I couldn’t be certain :frowning:
Is the HA to Ring Keypad (via Ring alarm base station) communication 2 way?
Thinking specifically I arrive back to my house with my phone on the WiFi, then use my lock door code - so then HA disarm by alarm_control_panel.alarm_disarm and then MQTT will update the keypad (Ring alarm) to display the correct alarm state.
Then the opposite way; I have a guest in the house, but when they leave they arm the alarm using a key code on the Ring Alarm, MQTT updates the state of alarm_control_panel in HA?

Sorry all the questions today …:wink:
What’s the lag time using ring cloud for alarm? Couldn’t tell if the MQTT service picked up local hub info, or had to login to the Ring service and pull the cloud info?
(I ask as the doorbell even with 250Mb up and down has a really long lag)

I also ordered the Ring set and the Ring keypad on its own - it’s z-wave so I wondered if it would secure pair (but I’m guessing there isn’t a zwave handler in OpenZWave yet)

Wondered what folks feedback is on their experience? Thanks in advance!

@jaburges The communication with the keypad is “bi-directional” to the extent that the MQTT integration script does not talk to the keypad (or any local device) directly, rather it communicates using the Ring API. Ring doesn’t provide a public API, so people have reversed engineered the API used by the Ring apps. Basically, when you run this script it just looks like another user running the app and everything it does with Ring is the same way the app does it, it simply exposes these functions via MQTT so that HA can consume the state data and issue command.

If you arm the alarm, it’s the alarm base station that is responsible for setting the state of the keypad, so whether you arm/disarm with the app, the keypad, or this script, the keypad should always show the correct arm state.

Regarding lag, the doorbells have pretty significant lag because they use an old API that requires polling for state changes and the typical polling interval is 5-10 seconds. However, the alarm is completely different, it uses a different API concept that is based on websockets which allows for near real time updates, typically the state changes are measured in the 10’s to maybe 100’s of milliseconds.

I use the door and motion sensors from my alarm various light automations and it feels near instant in most cases. Unfortunately, there is no local control though, so if the internet or Ring servers are down you won’t get any state changes so it’s not 100% ideal for local automation. I haven’t found this to be a problem to this point, but I may change my mind in the future.

1 Like