Ring Device integration via MQTT w/ Video Streaming

I have a question (sorry about that, i’m a newbie),
I’m using Hass.IO, and I installed the add-on with the following command to use it with Docker:

git clone https://github.com/tsightler/ring-alarm-mqtt.git
cd ring-alarm-mqtt
docker build -t ring-alarm-mqtt/ring-alarm-mqtt .

after that, I have started the add-on with the following command:

docker run -d --restart=unless-stopped -e "MQTTHOST={host name}" -e "MQTTPORT={host port}" -e "MQTTRINGTOPIC={host ring topic}" -e "MQTTHASSTOPIC={host hass topic}" -e "MQTTUSER={mqtt user}" -e "MQTTPASSWORD={mqtt pw}" -e "RINGUSER={ring user}" -e "RINGPASS={ring pq}" ring-alarm-mqtt/ring-alarm-mqtt

I have added the option –restart=unless-stopped to start the add-on automatically with Hass.io startup.

my question is the following:
if you update the code on github, what step i need to do to update the add-on running in Docker container?

thanks and regards!

Hey @tsightler,

I am also running into the same problem as @BrainSop and @John.

I am running the ring-alarm-ha-integration addon, which I think is basically a dockerized wrapper for your code. After starting the addon, I get the following log message:

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 21.445s
found 0 vulnerabilities
up to date in 3.77s
fixed 0 of 0 vulnerabilities in 427 scanned packages

But none of my ring devices show up, and watching all events I don’t see activity when sensors should be active. My MQTT server is the Mosquitto Broker addon with the following config:

{
  "logins": [],
  "anonymous": false,
  "customize": {
    "active": false,
    "folder": "mosquitto"
  },
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

My setup is as follows:
Software: Hassio: 0.96.3
Hardware: Raspberry Pi 3 B+

Here’s my MQTT settings:

mqtt:
  discovery: true
  discovery_prefix: homeassistant
  broker: !secret mqtt_broker
  port: 1883
  # username: !secret mqtt_username
  # password: !secret mqtt_password
  birth_message:
    topic: 'hass/status'
    payload: 'online'
  will_message:
    topic: 'hass/status'
    payload: 'offline'

I commented out username and password from both MQTT configs, as it should use the Hassio user and password. I have also tried this with the username/password fields filled out with no change. My MQTT broker is working with my Shelly 2.5 switch, so I don’t think it’s an MQTT misconfiguration.

Here’s my ring-alarm-ha-integration config:

{
  "host": "https://127.0.0.1",
  "port": 1883,
  "ring_topic": "ring",
  "hass_topic": "hass/status",
  "mqtt_user": "<mqtt_user>",
  "mqtt_pass": "<mqtt_pass>",
  "ring_user": "<ring_user>",
  "ring_pass": "<ring_pass>"
}

I am running over https using DuckDNS and require https, but I don’t know if that will affect these settings. I have also tried these settings without specifying https.

I’ll be happy to debug through this with you if you want to message me.

1 Like

hi @Henriques

I found a good solution to use with HassIO,
I don’t use the hassIO add-on (ring-alarm-hassio-addon) it doesn’t work for me :frowning: i have posted more info about the issue here: https://github.com/rs1932/ring-alarm-hassio-addon/issues/6

do the following:

  1. add to the configuration to the mqtt broker (I’m using MQTT Server & Web client), in my case the following works well for me:
mqtt:
  broker: a0d7b954-mqtt
  username: !secret msqtt_user
  password: !secret msqtt_pass
  client_id: home-assistant
  discovery: true
  discovery_prefix: homeassistant
  birth_message:
    topic: 'hass/status'
    payload: 'online'
    qos: 0
    retain: false
  1. Install the add-on SSH & Web Terminal from Community Hass.io Add-ons.
  2. Disable Protection mode from the add and start it.
  3. go to terminal and execute:
git clone https://github.com/tsightler/ring-alarm-mqtt.git
cd ring-alarm-mqtt
docker build -t ring-alarm-mqtt/ring-alarm-mqtt .
  1. execute the following to start the service and add it to hass.io startup:
docker run -d --restart=unless-stopped -e "MQTTHOST={host name}" -e "MQTTPORT={host port}" -e "MQTTRINGTOPIC={host ring topic}" -e "MQTTHASSTOPIC={host hass topic}" -e "MQTTUSER={mqtt user}" -e "MQTTPASSWORD={mqtt pw}" -e "RINGUSER={ring user}" -e "RINGPASS={ring pq}" ring-alarm-mqtt/ring-alarm-mqtt

The add-on from @tsightler is working well :slight_smile:
I hope this help you :wink:

The only question that i have is how update the Docker when update will be available (Ring Device integration via MQTT).

Regards.

I doubt I’m of much help here, however the hassio addon ring-alarm-hassio-addon at GitHub - rs1932/ring-alarm-hassio-addon works well in my setup.

@Henriques Your ring-alarm-hassio-addon configuration definitely will not work. You cannot use a URL in the “host” configuration and, as noted above, it needs to be the IP address of your hassio system, not 127.0.0.1, at least in my experience. I believe that’s because hassio runs docker with network_mode=bridge, but I’m not sure since I don’t really use hassio.

I’m not sure that’s your only issue, but there’s no way the config you posted would work. Also, I assume you removed left the mqtt_user and mqtt_password blank ("")?

@tsightler,

Thanks for your feedback. I made a wrong assumption about using https. I removed that from the URL and the ring-alarm-ha-integration addon works for me now.

Thanks for your help!

Well as an update I have had this running for about a week now and nothing has cr*pped out on me.

It is a bit embarrassing. I wonder if there is any connection with how i usually run the ring js which is using a systemctl symlink to run on startup vs now that I am running it in debug mode.

FYI I haven’t checked out the log at all but I have yet to notice the ring shut down on me. I think when i get some time I will stop running it in debug mode and do it via the systemctl method again and see if I experience the same fall out. It doesn’t make sense for this method to not work as a systemctl is doing the same thing as running the js file…

Not sure if you have any thoughts.

Yeah, not sure, I certainly run the script via systemctl and it’s hard to see how that could have an impact. You could probably modify the startup script to run in debug and dump to a file, that way, if it happened, you’d at least have something in the file if you felt it was not working.

I try to monitor for things that would normally make the script not work, for example, there’s traps for mqtt disconnects and for things like the websocket being down due to server disconnect or internet issues, etc., and I’ve tested these cases pretty extensively, but there’s always the possibility there’s some code path I haven’t managed to exercise.

Just wanted to give an update that since I deployed this into a docker in my unRAID server I have not had it hiccup at all! Great work! Love this component!

Hey @tsightler,

I am trying to use homebridge to expose my alarm to my iphone but without using the homekit integration of home assistant. However, I don’t know what to publish.

I used node-red to subscribe with a wild car to ring/# and I get this format

ring/alarm/<location_id>/<ha_platform_type>/<device_zid>/state

and the topic is “armed_home”. However, when I try to publish this myself I don’t see the ring app change alarm modes.

Where do i publish the topic to change the mode?

Commands should be sent to the command topic as the state topic is only for monitoring state:

ring/alarm/<location_id>/<ha_platform_type>/<device_zid>/command

Big thanks to tsightler for making this. I took the plunge into this a week ago with the simple goal integrating Ring Alarm commands into Alexa routines. For a complete noob it wasn’t “simple” since I knew nothing about the systems and there’s not a holistic guide specific to that project. So if it helps anyone, here’s the step-by-step walkthrough of how I got it working: https://docs.google.com/document/d/1IqIywW2dIedWzAJUs5z5YMYgqz18uhZjuUFCPGYDndc/edit?usp=sharing

hi slim, how did you set up your config.yaml, mqtt, and ring addon settings?

Rob,
It’s been quite some time since I integrated ring into HA, so memory is a little fuzzy. However I added the Mosquito Broker add-on, and I have it’s config:

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

I used the addon ring-alarm-hassio-addon (https://github.com/rs1932/ring-alarm-hassio-addon) given earlier in this thread. The config file is below, where I’ve removed info pertinent to my own network and accounts:

{
  "host": "192.168.xx.yy”,
  "port": 1883,
  "ring_topic": "ring",
  "hass_topic": "hass/status",
  "mqtt_user": "mqttuser",
  "mqtt_pass": "mqttpw",
  "ring_user": “<[email protected]>“,
  "ring_pass": “<ring_password>“
}

Finally, in configuration.yaml I have:

# Add Ring info
mqtt:
  broker: 127.0.0.1
  username: mqttuser
  password: mqttpw
  discovery: true
  discovery_prefix: homeassistant
  birth_message:
    topic: 'hass/status'
    payload: 'online'
    qos: 0
    retain: false

It all works well.

1 Like

@tsightler I discovered that arming/disarming using the ring physical keypad does not update the alarm status in HA. Is this some kind of limitation of the add on or do I have something configured wrong? Maybe MQTT?

It should definitely update the status in HA regardless of how the device is armed as the status of the alarm has effectively nothing to do with the keypad.

I don’t really see how it could be an MQTT problem as, in general, MQTT will either not work at all if it’s configured incorrectly. I don’t really have any suggestions other than to run in DEBUG mode and see if you see state updates from the script during arm/disarm but somehow not showing in HA. All I can say is that it works fine for me, we arm from the keypad almost every night and status always displays correctly.

I understand that mqtt is pretty much set and forget, but I didn’t have discovery prefix, qos 0, or retain false. I just added those and now the add on is responding to arm/disarm done by the keypad. I have no idea what those settings actually do, but they seem to have worked. For future reference, what exactly do you mean by debug…monitor the add on logs?

Is it possible to get the siren/alarming state?

Thanks tsightler for your awesome work!

I just started HA and wanted to integrate my Ring alarm.

My HA is a container in MacOS. After reading your github repo and over 170+ posts here I think I can take the docker installation for this script too.

I am trying to use cloudmqtt as mtqq now and below is in configuration.yaml.

mqtt:
  broker: tailor.cloudmqtt.com
  port: 27369
  username: !secret mqttusername
  password: !secret mqttpassword
  discovery: true
  discovery_prefix: homeassistant
  birth_message:
    topic: "hass/status"
    payload: "online"
    qos: 0
    retain: false

In the docker run command, what would be the values of “{host ring topic}” and “{host hass topic}”?

I cant get devices to show up.

everything shows up under integration mqtt: configuration.yaml but as “Entities without devices”

why are the devices not getting create?