Ring Device integration via MQTT w/ Video Streaming

Ok I was definitely looking in the wrong logs. Did find the error in the supervisor log though

Can’t build a98c085d/amd64-addon-ring_mqtt:4.1.0: 500 Server Error: Internal Server Error (“Cannot locate specified Dockerfile: Dockerfile”)

I think you’ll have to remove and readd to solve this. It’s something to do with the switch from building the Docker image locally to pulling one from the Docker hub, should be a one time issue.

I wish I had a better answer for you, but I just don’t understand what Home Assistant is attempting to do in this case. Versions of the addon prior to 4.0 included a Dockerfile because they were built locally, but the Home Assistant addon docs don’t really recommend this for anything other than testing purposes and I ended up with users opening a number of issues due to build failures and other problems, usually related to things outside of the addon itself so, with 4.0, I decided to bite the bullet and move the addon to using the recommended pre-built Docker containers.

This made sense especially as I was already building Docker images for the main ring-mqtt project anyway. Then, with 4.1.0, I moved to using a unified Docker image for both projects, which makes things a lot easier for me. Basically, the addon is now nothing more than config file which tells HA to pull the same Docker image published to Docker Hub from the main ring-mqtt project. Making things easier for me is important because I don’t really have as much time to maintain this project as it needs so one of the big goals of the 4.x series was to reduce the maintenance burden so that the limited time I do have is optimized.

Unfortunately, for reasons that I don’t understand, even though the repo config.json file clearly says that it should pull an Docker Hub image, and this seems to work perfectly for new installs, for upgrades from 3.x, instead of pulling the image, Home Assistant still tries to build the image locally. That’s exactly what your log says the system is doing, trying to build the addon locally and failing because there is no Dockerfile, which is 100% true, there isn’t one, because the config.json for the repo says to pull a Docker image, so it shouldn’t be trying to build one. It’s like, because earlier versions were built locally, it wants to build new versions locally no matter what the new config.json file says.

If you uninstall and reinstall it should fix it, at least, I haven’t seen a case where it doesn’t. Just save your config options before doing so and it should be pretty painless. Future upgrades should work without an issue (I hope).

I know it’s been a little bit of a rough week or two with this project as the transition from 3.x to 4.x hasn’t been quite a smooth as I had hoped, but I believe that 4.0.4 and 4.1.0 are reaching the same quality as the 3.x versions and it really will be better for the project over the long haul as it truly means less effort on my side to maintain the main project and the addon.

I’m curious if anyone is having issues getting notifications to work in HK - specifically for the Alarm itself? I see everything perfectly fine in HA and HK. I get notifications in HK for doors, motion, etc. But for some reason, I don’t get notifications when the alarm is armed/disarmed/triggered. I’ve double checked all my settings in HK and i’ve tried reseting the Alarm via homekit.reset_accessory.

It’s quite alright buddy. I’ll have you know this is my favorite add on by far. Without it, my ring alarm would be practically useless (in my mind anyway). I haven’t had to open to ring app for months at this point my automations take care of everything made possible by this add on!

A simple reinstall for a major update is not a problem at all. The reinstall was successful and looks like a lot of big changes! Thanks for continuing this project. Your work is very very much appreciated!

1 Like

Agree this is an excellent addon! I had an automation that set my alarm to home mode at 10pm, 11pm, 12pm and never had to remember to set it every night before go to bed.

Curious what automation are you using?

Alas - like some others - I’m stumped. With/without mqtt u/p …
New(ish) HASS.IO 4.x on a NUC
New install of Ring MQTT - seems to work (log below) …it logs in to Ring, gets data, aware of events.
But … I can’t see any entities. Settings below. What am I missing? Hmm …

**configuration.yaml**

mqtt:
  broker: 127.0.0.1
  username: mqtt
  password: mqtt
  discovery: true
  discovery_prefix: homeassistant
  birth_message:
    topic: 'hass/status'
    payload: 'online'
  will_message:
    topic: 'hass/status'
    payload: 'offline'
    qos: 0
    retain: false

RING config:

enable_cameras: false
enable_modes: true
enable_panic: false
ring_token: ''
mqtt_host: <auto_detect>
mqtt_port: <auto_detect>
mqtt_user: mqtt
mqtt_password: mqtt
location_ids:
  - ''
branch: addon

Logs …

-------------------------------------------------------
| Ring Device Integration via MQTT                    |
| Addon for Home Assistant                            |
|                                                     |
| Report issues at:                                   |
| https://github.com/tsightler/ring-mqtt-hassio-addon |
-------------------------------------------------------
ring-mqtt.js version 4.1.0
Node version v12.18.3
NPM version 6.14.6
git version 2.26.2
-------------------------------------------------------
Using discovered MQTT Host: core-mosquitto
Using discovered MQTT Port: 1883
Using configured MQTT User: mqtt
Using configured MQTT password: <hidden>
-------------------------------------------------------
Running ring-mqtt...
2020-09-21T20:47:24.214Z ring-mqtt Using configuration file: /data/options.json
2020-09-21T20:47:24.216Z ring-mqtt Reading latest data from state file: /data/ring-state.json
2020-09-21T20:47:24.297Z ring-mqtt Attempting connection to Ring API using saved refresh token.
2020-09-21T20:47:26.474Z ring-mqtt Connection to Ring API successful
2020-09-21T20:47:26.474Z ring-mqtt Starting connection to MQTT broker...
2020-09-21T20:47:26.549Z ring-mqtt File /data/ring-state.json saved with updated refresh token.
2020-09-21T20:47:26.552Z ring-mqtt MQTT connection established, processing locations...
2020-09-21T20:47:27.556Z ring-mqtt --------------------------------------------------------------------------------
2020-09-21T20:47:27.556Z ring-mqtt Found new location Brasilito with id 0bc61136-6393-4851-8da7-9ac893bb47c5
2020-09-21T20:47:28.824Z ring-mqtt   New device of type: security-panel
2020-09-21T20:47:28.824Z ring-mqtt   New device of type: hub.redsky
2020-09-21T20:47:28.824Z ring-mqtt   New device of type: sensor.contact
2020-09-21T20:47:28.824Z ring-mqtt   New device of type: sensor.motion
2020-09-21T20:47:28.824Z ring-mqtt   New device of type: security-keypad
2020-09-21T20:47:28.825Z ring-mqtt   New device of type: security-keypad
2020-09-21T20:47:28.825Z ring-mqtt   New device of type: sensor.zone
2020-09-21T20:47:28.825Z ring-mqtt   New device of type: sensor.zone
2020-09-21T20:47:28.825Z ring-mqtt   New device of type: sensor.zone
2020-09-21T20:47:28.825Z ring-mqtt   New device of type: sensor.zone
2020-09-21T20:47:28.825Z ring-mqtt   New device of type: sensor.zone
2020-09-21T20:47:28.825Z ring-mqtt   New device of type: sensor.zone
2020-09-21T20:47:28.825Z ring-mqtt   New device of type: sensor.zone
2020-09-21T20:47:28.825Z ring-mqtt   New device of type: sensor.zone
2020-09-21T20:47:28.825Z ring-mqtt   New device of type: sensor.motion
2020-09-21T20:47:28.825Z ring-mqtt   New device of type: sensor.contact
2020-09-21T20:47:28.826Z ring-mqtt   Unsupported device of type: adapter.zigbee
2020-09-21T20:47:28.826Z ring-mqtt   Unsupported device of type: access-code.vault
2020-09-21T20:47:28.826Z ring-mqtt   Unsupported device of type: access-code
2020-09-21T20:47:28.826Z ring-mqtt   Unsupported device of type: adapter.zwave
2020-09-21T20:47:28.826Z ring-mqtt   Unsupported device of type: range-extender.zwave
2020-09-21T20:47:28.826Z ring-mqtt   Unsupported device of type: bridge.flatline
2020-09-21T20:47:28.826Z ring-mqtt --------------------------------------------------------------------------------
2020-09-21T20:47:28.826Z ring-mqtt Ring location/device data updated, sleeping for 5 seconds.


2020-09-21T20:38:33.656Z ring-mqtt {
  name: 'Casita front bedroom',
  unique_id: '2d9e815b-067b-410c-9683-d2a6bb6bca43',
  availability_topic: 'ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/2d9e815b-067b-410c-9683-d2a6bb6bca43/status',
  payload_available: 'online',
  payload_not_available: 'offline',
  state_topic: 'ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/2d9e815b-067b-410c-9683-d2a6bb6bca43/contact/state',
  device_class: 'door',
  device: {
    ids: [ '2d9e815b-067b-410c-9683-d2a6bb6bca43' ],
    name: 'Casita front bedroom',
    mf: 'Ring',
    mdl: 'Contact Sensor'
  }
}
2020-09-21T20:38:33.656Z ring-mqtt HASS config topic: homeassistant/sensor/0bc61136-6393-4851-8da7-9ac893bb47c5/2d9e815b-067b-410c-9683-d2a6bb6bca43_info/config
2020-09-21T20:38:33.656Z ring-mqtt {
  name: 'Casita front bedroom Info',
  unique_id: '2d9e815b-067b-410c-9683-d2a6bb6bca43_info',
  availability_topic: 'ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/2d9e815b-067b-410c-9683-d2a6bb6bca43/status',
  payload_available: 'online',
  payload_not_available: 'offline',
  state_topic: 'ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/2d9e815b-067b-410c-9683-d2a6bb6bca43/info/state',
  json_attributes_topic: 'ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/2d9e815b-067b-410c-9683-d2a6bb6bca43/info/state',
  icon: 'mdi:information-outline',
  value_template: '{{value_json["batteryLevel"]}}',
  unit_of_measurement: '%',
  device: {
    ids: [ '2d9e815b-067b-410c-9683-d2a6bb6bca43' ],
    name: 'Casita front bedroom',
    mf: 'Ring',
    mdl: 'Contact Sensor'
  }
}
2020-09-21T20:38:35.652Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/235a1cf0-c620-42cd-97ec-54c2c47785d7/alarm/state disarmed
2020-09-21T20:38:35.653Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/235a1cf0-c620-42cd-97ec-54c2c47785d7/siren/state OFF
2020-09-21T20:38:35.654Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/235a1cf0-c620-42cd-97ec-54c2c47785d7/info/state {"alarmState":"all-clear","commStatus":"ok","lastUpdate":"2020-09-21T16:26:01.821Z","tamperStatus":"ok"}
2020-09-21T20:38:35.655Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/f015b239-7fe3-454a-b859-ee3dc2ce111f/audio/state ON
2020-09-21T20:38:35.655Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/f015b239-7fe3-454a-b859-ee3dc2ce111f/audio/volume_state 50
2020-09-21T20:38:35.656Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/f015b239-7fe3-454a-b859-ee3dc2ce111f/info/state {"acStatus":"ok","batteryStatus":"charged","brightness":0.17,"commStatus":"ok","lastUpdate":"2020-09-21T20:34:04.568Z","serialNumber":"BHBU21940PG012836","tamperStatus":"ok","volume":0.5}
2020-09-21T20:38:35.657Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/bcbd49cf-9d19-48cb-9d17-6a98457402d9/contact/state OFF
2020-09-21T20:38:35.657Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/bcbd49cf-9d19-48cb-9d17-6a98457402d9/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","firmwareStatus":"up-to-date","lastCommTime":"2020-09-21T19:48:50.742Z","lastUpdate":"2020-09-21T19:48:50.918Z","linkQuality":"ok","serialNumber":"BHDW11932EY170759","tamperStatus":"ok"}
2020-09-21T20:38:35.658Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/c5c491c9-9e8b-4a65-84ec-91d5e042ea8b/motion/state OFF
2020-09-21T20:38:35.659Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/c5c491c9-9e8b-4a65-84ec-91d5e042ea8b/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","firmwareStatus":"up-to-date","lastCommTime":"2020-09-21T19:50:13.212Z","lastUpdate":"2020-09-21T19:50:13.297Z","linkQuality":"ok","serialNumber":"BHMS11936EY073759","tamperStatus":"ok"}
2020-09-21T20:38:35.660Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/a21a40e7-f434-4c81-a22b-2e2804c5d760/audio/state ON
2020-09-21T20:38:35.660Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/a21a40e7-f434-4c81-a22b-2e2804c5d760/audio/volume_state 29
2020-09-21T20:38:35.661Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/a21a40e7-f434-4c81-a22b-2e2804c5d760/info/state {"acStatus":"ok","batteryLevel":100,"batteryStatus":"charging","brightness":0.14,"chirps":"enabled","commStatus":"ok","firmwareStatus":"up-to-date","lastCommTime":"2020-09-21T20:33:53.761Z","lastUpdate":"2020-09-21T20:33:53.849Z","linkQuality":"ok","powerSave":"off","serialNumber":"BHKP11933LD010387","tamperStatus":"ok","volume":0.29}
2020-09-21T20:38:35.662Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/7d2913f2-630c-4a45-86ab-048f439bbca6/audio/state ON
2020-09-21T20:38:35.662Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/7d2913f2-630c-4a45-86ab-048f439bbca6/audio/volume_state 29
2020-09-21T20:38:35.663Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/7d2913f2-630c-4a45-86ab-048f439bbca6/info/state {"acStatus":"error","batteryLevel":93,"batteryStatus":"full","brightness":0.24,"chirps":"disabled","commStatus":"ok","firmwareStatus":"up-to-date","lastCommTime":"2020-09-21T20:33:13.062Z","lastUpdate":"2020-09-21T20:33:13.158Z","linkQuality":"ok","powerSave":"off","serialNumber":"BHKP11940LD005693","tamperStatus":"ok","volume":0.29}
2020-09-21T20:38:35.664Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/00f4bb4e-4ad2-4d64-8a10-9a4b57c40fba/zone/state OFF
2020-09-21T20:38:35.665Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/00f4bb4e-4ad2-4d64-8a10-9a4b57c40fba/info/state {"commStatus":"ok","lastUpdate":"2020-02-21T14:42:32.362Z","tamperStatus":"ok"}
2020-09-21T20:38:35.666Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/99aae14e-052b-453c-a401-04592a01bc63/zone/state OFF
2020-09-21T20:38:35.666Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/99aae14e-052b-453c-a401-04592a01bc63/info/state {"commStatus":"ok","lastUpdate":"2020-02-21T14:42:32.518Z","tamperStatus":"ok"}
2020-09-21T20:38:35.667Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/b139313c-5ff9-4df9-ad33-ab128dcbd885/zone/state OFF
2020-09-21T20:38:35.668Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/b139313c-5ff9-4df9-ad33-ab128dcbd885/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","lastUpdate":"2020-09-21T18:24:27.328Z","tamperStatus":"tamper"}
2020-09-21T20:38:35.669Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/4d28d244-52d6-442a-bfbf-4e6c7bb85be0/zone/state OFF
2020-09-21T20:38:35.669Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/4d28d244-52d6-442a-bfbf-4e6c7bb85be0/info/state {"commStatus":"ok","lastUpdate":"2020-02-21T14:42:31.897Z","tamperStatus":"ok"}
2020-09-21T20:38:35.670Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/dc6fab98-0f77-4e0b-9a49-56b8cb7fb63d/zone/state OFF
2020-09-21T20:38:35.671Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/dc6fab98-0f77-4e0b-9a49-56b8cb7fb63d/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","lastUpdate":"2020-09-21T14:15:49.087Z","tamperStatus":"tamper"}
2020-09-21T20:38:35.672Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/d1b70f66-5ede-4876-86b1-e473d1ea85df/zone/state OFF
2020-09-21T20:38:35.672Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/d1b70f66-5ede-4876-86b1-e473d1ea85df/info/state {"commStatus":"ok","lastUpdate":"2020-02-21T14:42:31.588Z","tamperStatus":"ok"}
2020-09-21T20:38:35.673Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/043ac0d9-3bea-4ad2-af30-682e5d2056aa/zone/state OFF
2020-09-21T20:38:35.675Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/043ac0d9-3bea-4ad2-af30-682e5d2056aa/info/state {"commStatus":"ok","lastUpdate":"2020-02-21T14:42:31.345Z","tamperStatus":"ok"}
2020-09-21T20:38:35.676Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/4c1a4ff0-46df-4522-8cf6-40225fb987cc/zone/state OFF
2020-09-21T20:38:35.676Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/4c1a4ff0-46df-4522-8cf6-40225fb987cc/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","lastUpdate":"2020-09-21T18:37:29.557Z","tamperStatus":"tamper"}
2020-09-21T20:38:35.677Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/0c1a2c08-6066-45d2-a5fb-ce7a9888ea63/motion/state OFF
2020-09-21T20:38:35.678Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/0c1a2c08-6066-45d2-a5fb-ce7a9888ea63/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","firmwareStatus":"up-to-date","lastCommTime":"2020-09-21T20:30:19.992Z","lastUpdate":"2020-09-21T20:30:20.077Z","linkQuality":"ok","serialNumber":"BHMS11940EY006109","tamperStatus":"ok"}
2020-09-21T20:38:35.678Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/2d9e815b-067b-410c-9683-d2a6bb6bca43/contact/state OFF
2020-09-21T20:38:35.679Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/2d9e815b-067b-410c-9683-d2a6bb6bca43/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","firmwareStatus":"up-to-date","lastCommTime":"2020-09-21T19:43:20.652Z","lastUpdate":"2020-09-21T19:43:20.737Z","linkQuality":"ok","serialNumber":"BHDW11939EY122683","tamperStatus":"ok"}
2020-09-21T20:39:05.458Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/235a1cf0-c620-42cd-97ec-54c2c47785d7/info/state {"alarmState":"all-clear","commStatus":"ok","lastUpdate":"2020-09-21T16:26:01.821Z","tamperStatus":"ok"}
2020-09-21T20:39:05.459Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/bcbd49cf-9d19-48cb-9d17-6a98457402d9/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","firmwareStatus":"up-to-date","lastCommTime":"2020-09-21T19:48:50.742Z","lastUpdate":"2020-09-21T19:48:50.918Z","linkQuality":"ok","serialNumber":"BHDW11932EY170759","tamperStatus":"ok"}
2020-09-21T20:39:05.460Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/c5c491c9-9e8b-4a65-84ec-91d5e042ea8b/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","firmwareStatus":"up-to-date","lastCommTime":"2020-09-21T19:50:13.212Z","lastUpdate":"2020-09-21T19:50:13.297Z","linkQuality":"ok","serialNumber":"BHMS11936EY073759","tamperStatus":"ok"}
2020-09-21T20:39:05.462Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/a21a40e7-f434-4c81-a22b-2e2804c5d760/info/state {"acStatus":"ok","batteryLevel":100,"batteryStatus":"charging","brightness":0.14,"chirps":"enabled","commStatus":"ok","firmwareStatus":"up-to-date","lastCommTime":"2020-09-21T20:33:53.761Z","lastUpdate":"2020-09-21T20:33:53.849Z","linkQuality":"ok","powerSave":"off","serialNumber":"BHKP11933LD010387","tamperStatus":"ok","volume":0.29}
2020-09-21T20:39:05.463Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/7d2913f2-630c-4a45-86ab-048f439bbca6/info/state {"acStatus":"error","batteryLevel":93,"batteryStatus":"full","brightness":0.24,"chirps":"disabled","commStatus":"ok","firmwareStatus":"up-to-date","lastCommTime":"2020-09-21T20:33:13.062Z","lastUpdate":"2020-09-21T20:33:13.158Z","linkQuality":"ok","powerSave":"off","serialNumber":"BHKP11940LD005693","tamperStatus":"ok","volume":0.29}
2020-09-21T20:39:05.463Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/00f4bb4e-4ad2-4d64-8a10-9a4b57c40fba/info/state {"commStatus":"ok","lastUpdate":"2020-02-21T14:42:32.362Z","tamperStatus":"ok"}
2020-09-21T20:39:05.463Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/99aae14e-052b-453c-a401-04592a01bc63/info/state {"commStatus":"ok","lastUpdate":"2020-02-21T14:42:32.518Z","tamperStatus":"ok"}
2020-09-21T20:39:05.464Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/b139313c-5ff9-4df9-ad33-ab128dcbd885/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","lastUpdate":"2020-09-21T18:24:27.328Z","tamperStatus":"tamper"}
2020-09-21T20:39:05.464Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/4d28d244-52d6-442a-bfbf-4e6c7bb85be0/info/state {"commStatus":"ok","lastUpdate":"2020-02-21T14:42:31.897Z","tamperStatus":"ok"}
2020-09-21T20:39:05.464Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/dc6fab98-0f77-4e0b-9a49-56b8cb7fb63d/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","lastUpdate":"2020-09-21T14:15:49.087Z","tamperStatus":"tamper"}
2020-09-21T20:39:05.464Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/d1b70f66-5ede-4876-86b1-e473d1ea85df/info/state {"commStatus":"ok","lastUpdate":"2020-02-21T14:42:31.588Z","tamperStatus":"ok"}
2020-09-21T20:39:05.464Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/043ac0d9-3bea-4ad2-af30-682e5d2056aa/info/state {"commStatus":"ok","lastUpdate":"2020-02-21T14:42:31.345Z","tamperStatus":"ok"}
2020-09-21T20:39:05.464Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/4c1a4ff0-46df-4522-8cf6-40225fb987cc/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","lastUpdate":"2020-09-21T18:37:29.557Z","tamperStatus":"tamper"}
2020-09-21T20:39:05.464Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/0c1a2c08-6066-45d2-a5fb-ce7a9888ea63/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","firmwareStatus":"up-to-date","lastCommTime":"2020-09-21T20:30:19.992Z","lastUpdate":"2020-09-21T20:30:20.077Z","linkQuality":"ok","serialNumber":"BHMS11940EY006109","tamperStatus":"ok"}
2020-09-21T20:39:05.465Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/2d9e815b-067b-410c-9683-d2a6bb6bca43/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","firmwareStatus":"up-to-date","lastCommTime":"2020-09-21T19:43:20.652Z","lastUpdate":"2020-09-21T19:43:20.737Z","linkQuality":"ok","serialNumber":"BHDW11939EY122683","tamperStatus":"ok"}
2020-09-21T20:39:06.459Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/f015b239-7fe3-454a-b859-ee3dc2ce111f/info/state {"acStatus":"ok","batteryStatus":"charged","brightness":0.17,"commStatus":"ok","lastUpdate":"2020-09-21T20:34:04.568Z","serialNumber":"BHBU21940PG012836","tamperStatus":"ok","volume":0.5}
2020-09-21T20:42:05.770Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/4c1a4ff0-46df-4522-8cf6-40225fb987cc/zone/state ON
2020-09-21T20:42:05.770Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/4c1a4ff0-46df-4522-8cf6-40225fb987cc/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","lastUpdate":"2020-09-21T20:42:05.596Z","tamperStatus":"tamper"}
2020-09-21T20:42:06.247Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/a21a40e7-f434-4c81-a22b-2e2804c5d760/audio/state ON
2020-09-21T20:42:06.248Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/a21a40e7-f434-4c81-a22b-2e2804c5d760/audio/volume_state 29
2020-09-21T20:42:06.249Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/a21a40e7-f434-4c81-a22b-2e2804c5d760/info/state {"acStatus":"ok","batteryLevel":100,"batteryStatus":"charging","brightness":0.14,"chirps":"enabled","commStatus":"ok","firmwareStatus":"up-to-date","lastCommTime":"2020-09-21T20:42:06.003Z","lastUpdate":"2020-09-21T20:42:06.039Z","linkQuality":"ok","powerSave":"off","serialNumber":"BHKP11933LD010387","tamperStatus":"ok","volume":0.29}
2020-09-21T20:42:07.211Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/4c1a4ff0-46df-4522-8cf6-40225fb987cc/zone/state OFF
2020-09-21T20:42:07.212Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/4c1a4ff0-46df-4522-8cf6-40225fb987cc/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","lastUpdate":"2020-09-21T20:42:07.017Z","tamperStatus":"tamper"}
2020-09-21T20:42:11.716Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/c5c491c9-9e8b-4a65-84ec-91d5e042ea8b/motion/state ON
2020-09-21T20:42:11.716Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/c5c491c9-9e8b-4a65-84ec-91d5e042ea8b/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","firmwareStatus":"up-to-date","lastCommTime":"2020-09-21T20:42:11.472Z","lastUpdate":"2020-09-21T20:42:11.520Z","linkQuality":"ok","serialNumber":"BHMS11936EY073759","tamperStatus":"ok"}
2020-09-21T20:42:15.911Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/0c1a2c08-6066-45d2-a5fb-ce7a9888ea63/motion/state ON
2020-09-21T20:42:15.912Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/0c1a2c08-6066-45d2-a5fb-ce7a9888ea63/info/state {"batteryLevel":100,"batteryStatus":"full","commStatus":"ok","firmwareStatus":"up-to-date","lastCommTime":"2020-09-21T20:42:15.662Z","lastUpdate":"2020-09-21T20:42:15.721Z","linkQuality":"ok","serialNumber":"BHMS11940EY006109","tamperStatus":"ok"}
2020-09-21T20:42:16.419Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/a21a40e7-f434-4c81-a22b-2e2804c5d760/audio/state ON
2020-09-21T20:42:16.419Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/a21a40e7-f434-4c81-a22b-2e2804c5d760/audio/volume_state 29
2020-09-21T20:42:16.420Z ring-mqtt ring/0bc61136-6393-4851-8da7-9ac893bb47c5/alarm/a21a40e7-f434-4c81-a22b-2e2804c5d760/info/state {"acStatus":"ok","batteryLevel":100,"batteryStatus":"charging","brightness":0.14,"chirps":"enabled","commStatus":"ok","firmwareStatus":"up-to-date","lastCommTime":"2020-09-21T20:42:16.174Z","lastUpdate":"2020-09-21T20:42:16.211Z","linkQuality":"ok","powerSave":"off","serialNumber":"BHKP11933LD010387","tamperStatus":"ok","volume":0.29}

LOL - really - I struggled with this for a few hours before posting. As soon as I posted, I went back to my HA instance to keep poking. Poof! The entities are there. So - the above configuration is there for others to emulate if you would like. It works. No changes from the above. I have no idea why - it just started working.

My guess, although I can’t be sure, is that your Home Assistant instance is not connecting to the Mosquitto MQTT because of this:

mqtt:
  broker: 127.0.0.1

You might try “core-mosquitto” since that’s the normal alias used for the Mosquitto MQTT service and is what the ring-mqtt addon is detecting as well, which obviously worked because it was able to connect.

Why not just configure MQTT integration via web UI instead of configuration.yaml? (Just curious)

Haha, never mind, it seems you just posted a working config! :slight_smile:

Good point.

Actually configured it in both places on/off during various attempts @ making this work. Since it’s working now … will probably leave things alone for the time being!

Oh, another issues with your config, it should be ‘homeassistant/status’ instead of ‘hass/status’, the old hass parent topic for birth/last will messages is legacy and no longer supported in the current ring-mqtt code (it’s hardcoded to use the new default). Honestly these are default these days so you should not even need those at all. Since this is wrong ring-mqtt will not be able to detect Home Assistant restarts which could cause no devices to appear unless you also restart ring-mqtt.

Good catch! Thanks! Probably there from following old instructions …

Yeah, I’ve been thinking about pushing an update to just monitor both the old and new topics as a workaround since there’s still a lot of info/old docs that use hass/status around.

Thanks for the kind words guys. When I look back on this project and how it started, it’s kind of amazing. I switched to Ring alarm from another system that was probably 10+ years old which had automatic scheduling for things like arming/disarming, etc. and I couldn’t believe that a new modern system like Ring didn’t have those features. I figured it wouldn’t be long before Ring had the feature so maybe I could make a little script to run with a cron job. At that point I had never even used Home Assistant and only had one smart switch in the entire house, and my Javascript skills were roughly what was needed to write “Hello world” but I had been looking for a reason to expand them.

I still remember the sense of accomplishment the first time my crude script managed to disarm the alarm! :slight_smile:

Then I realized that other people were wanting to do this as well so I thought, hey, if I can set the alarm state how hard would it be to monitor the contact/motion sensors and start automating lights. From there we ended up with supporting about a dozen devices, battery, tamper, extra info, a home assistant addon, web interface for token/2fa. My Javascript skills have improved dramatically, to almost novice level!

Unfortunately I do have a real job and life that takes most of my time so it’s somewhat limited the ability to really grow it any further, but I’m amazed where it’s ended up at this point. When I push a new update it generally gets >1000 pulls in the first 24 hours and that’s mostly just Home Assistant users, the main projects gets more pulls than this. Yeah, sure, that’s nothing for some of the big projects, but for a guy who started out to write a script to disarm his alarm in the morning so his kid wouldn’t set it off going to school, it still seems pretty crazy!

While there’s still tons of cleanup I could do at this point, the script seems to work really well in it’s current state and I’ll probably taper off major changes for a while, but there’s still a handful of things I’d like to add. Arming with sensor bypass is probably the #1 outstanding request. I have an idea on how to implement this now so that will probably be next and, if I get really motivated, maybe dynamic add/remove of devices, which really shouldn’t be too difficult.

7 Likes

Great script and HA Plugin add @tsightler.

Been running it now for months on an Intel based 64 bit HA (latest) configuration long math Linux style.

Just a week or so ago tried it for house #2 using a Pine64 with Armbian Ubuntu Focal 64 bit and HASSIO installed.

I cannot get it to run long math style and can get it to run Docker style though. It is a manual endeavor though.

Here is the error that I see when starting it up in Ubuntu Focal on the Rock 64 chipset.

 /opt/ring-mqtt/lib/tokenapp.js:15
    token = {
          ^

SyntaxError: Unexpected token =
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/opt/ring-mqtt/ring-mqtt.js:12:18)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
oader.js:585:3)

I was able to get the token running the command line via Docker. Should I give up running the app on the Pine64 with Focal on it and get an Intel Mini PC instead. Reason for Intel is that I am also running Automation stuff (SAPI) in Virtual boxes on the Intel CPU computer.

TIA

Pete

@henry8866 Thats a good one. Mine does this at 11pm every night. My favorite is having the alarm change to home or away depending on whether one person in the house leaves or everybody. Course all of the lights turn off too. Its so liberating. Whenever I go out, all i need is my wallet and phone…dont have to worry about a single other thing. Havent had to open the ring app in months. Im using the unifi integration for the presence detection

oh yeah, I have that too and it works well that sometime I forget its existence… I used life360 for that. If all family is out, set to away mode, if both adults are out and any kid are home, set to home mode, if any adult coming back to home, disarm it.

Hi @peteee,

So there’s nothing in my code that should ever be architecture dependent as it’s 100% pure JavaScript. Based on that I don’t see how anything about the platform itself could be the problem, although I admittedly know nothing about the Pine64 or Armbian.

However, since it’s called Armbian Focal, I’m assuming it’s based on Ubuntu 20.04? If so, are you using the stock node version from the base repository? I believe that the version of NodeJS included in the stock Ubuntu 20.04 repos is Node 10.x and, honestly, I haven’t even attempted to run this code on anything older than Node 12.x for quite a while since 12.x has been the active LTS release since at least the first half of 2019, so that would be my first guess as to the problem. If that’s not the case you’re welcome to open an issue on the Github page and we can attempt to work through it, but I’d love to know what version of Node is on your system now.

That being said, looking through the code, I can see one thing that might cause this.

Also, could you clarify, when you say you “…can get it to run Docker style…it is a manual endeavor though”. What does that mean exactly? Do you have to build a Docker image? If so, that only enforces my belief that it’s the Node version, because the Docker image is just Alpine base with Node 12.x installed.

@peteee As a follow up to my last message, I happened to have a clean Ubuntu 20.04 focal fossa server install in my lab, so I installed the stock nodejs and indeed it was 10.x (specifically 10.19.0) and, running the script on that version caused the same error message as you are seeing, so I’m pretty sure upgrading to 12.x would help and it definitely has nothing to do with the Pine64.

However, after looking at the code in question, it was definitely a bug as well. I’ve already pushed a fix to the dev branch to correct this so that the script will run on 10.x versions and I will roll that in to the upcoming 4.1.2 release which I hope to get out this weekend along with few other minor fixes and feature updates. Thanks for the report.