Ring Device integration via MQTT w/ Video Streaming

You are the best!! I temporarily set up a light bridge the other day and was waiting for the lights themselves to arrive so took it offline. Deleting that and restarting the add-on did the job.

I’ve been going crazy trying to figure this out but stepping back a bit now your analysis seems so obvious - the HA side looked good and we’re dealing with a Ring-side issue at this point after our initial authentication and connection.

I see the add-on now acquires and saves new refresh tokens to the state file, and I’ve always grabbed the visible token from your add-on to use on the Ring live stream add-on (I know you don’t manage that), but is there a way to extract that to keep them in sync, or a method you recommend? Would manually creating tokens and explicitly placing the token in your add-on make it use that token? Not sure if the manually entered will override or update the state file.

Ring Stream

Generating tokens (know you’ve probably referenced this many times)

Thanks so much!

If you manually generate the token and put it in the config file it will only be used as a fallback if the saved token in the state file either a) doesn’t exist, or b) doesn’t work.

If you generate the token manually, you can put it in the config and it will be used for the initial connection, but, after that, a new token is generated and stored in the state file since manually generated tokens eventually expire. The token in the state file is automatically refreshed every hour and updated so it is always the most recent token. That’s why the code always attempts to use that token first, only using the one in the config as a fallback if, for some reason, the token in the state file doesn’t work.

Why do you need them to be in sync between the two different applications? They are two separate apps so, IMO, they should really use two separate tokens. Just like two different Ring apps on two different phones use separate tokens.

You’re right, the tokens don’t need to be synced…duh! Thank you for helping me think straight today, this is a non-issue. :upside_down_face:

Apologies if this has been asked before, but if I bought a third party zwave sensor and hooked it up to my ring alarm, would that work with home assistant using this addon? My thoughts are that since ring doesn’t allow third party zwave sensors to trigger the alarm, I would use an automation in home assistant to do this.

It is technically possible to do this since you can trigger the panic switches via automation and the addon supports 3rd party Z-wave devices, however, if you subscribe to Ring’s professional monitoring, this may be interpreted as a violation of the terms of service agreement and I highly recommend using Ring certified solutions for any monitoring requirements for the alarm and not trying to build your own alarm triggers using 3rd party sensors as the intention of this addon is not intended to bypass any Ring restrictions, but only as a way to provide the ability to monitor and interact with these Ring devices in their normally supported configurations.

Also note that, even if you do attempt to use third party sensors and automate via HA, that this approach has some limitations, for example, it would not work if the location were offline, say, on cellular backup, since, when the alarm is on cell backup, you lose the ability to monitor sensor states via the API during that time, but the Ring sensors will still trigger alarm events in this case.

On the other hand, if you don’t have Ring professional monitoring, I’d say you can do whatever you want.

Makes sense. I’m in the UK so the most ring offer is ‘Assisted Monitoring’ which is not able to call authorities, just specified emergency contacts, so I assume this would be fine. I’ll play around with it using the ring stuff for now and see if its worth getting some third party stuff.

I’m also hoping to get some kind of third party siren since the standard one is nowhere near loud enough. Have you or anyone else tested any other sirens to trigger with the alarm?

Is there any way you can think of to snooze motion notifications for all devices in HA? If I’m going in the backyard for a bit it’d be great to be able to just hit a button and snooze for 30 mins like in the app. I see your add-on tracks motion and the Ring integration tracks motion and last motion, but I’m not sure how I’d accomplish this.

I don’t know how you have you notifications configured so it’s difficult to answer this and really, probably nothing unique to the addon itself. I’d guess that you’d probably configure a “toggle” input boolean with a good descriptive name, something like “Disable Back Yard Motion Notifications” and then configure your notifications with a condition to only notify if this boolean is false, and then configure an automation to turn the toggle off if it’s been on for 30 minutes.

However, that’s just a guess as I don’t really use notifications or UI helpers myself so I’m sure other people that make more use of these capabilities would have better ideas. Any method that works for temporarily silencing notifications on other components will also work with ring MQTT as well so I’d just search generically for methods to temporarily disable notifications in HA.

Hi @tsightler

I am trying to run the application using docker compose and below is my configuration:

  ring-mqtt:
      environment:
          - MQTTHOST=192.168.168.121
          - MQTTPORT=1883
          - MQTTRINGTOPIC=ring_topic
          - MQTTHASSTOPIC=hass_topic
          - MQTTUSER=12345
          - MQTTPASSWORD= abcde
          - RINGTOKEN=
#          - ENABLEMODES=true
#          - ENABLEVOLUME=true
#          - ENABLECAMERAS=true
          - RINGLOCATIONIDS=
      image: tsightler/ring-mqtt

For some reason the container is not running and its stopping with exit code 2.

Can you help please?

Thanks.

I don’t really know much about Docker compose, but if you run with DEBUG=ring-mqtt you should get a reasonable error message. The exit code 2 is produced when there is either a missing or incorrect refresh token so the script could not establish an authenticated connection to the Ring API.

@tsightler Thanks for the reply. I left the token blank as per the instructions and was hoping to navigate it on port 55123.

The documentation states that, when running under Docker, the RINGTOKEN parameter is required. In the authentication section it also shows how to get the token from the command line when using the Docker install method. The web interface for acquiring a token is currently not available when running in a Docker container, only for standard installs or as a Home Assistant addon.

1 Like

ok so here is the log:

-------------------------------------------------------


| Ring Devices via MQTT                               |


|                                                     |


| Report issues at:                                   |


| https://github.com/tsightler/ring-mqtt              |


-------------------------------------------------------


ring-mqtt.js version: 4.2.1


-------------------------------------------------------


Running ring-mqtt...


2020-11-26T13:31:51.241Z ring-mqtt Using configuration file: /data/config.json


2020-11-26T13:31:51.249Z ring-mqtt Configuration file not found, attempting to use environment variables for configuration.


2020-11-26T13:31:51.253Z ring-mqtt File /data/ring-state.json not found. No saved state data available.


2020-11-26T13:31:51.818Z ring-mqtt Attempting connection to Ring API using RINGTOKEN environment variable.


2020-11-26T13:31:52.483Z ring-mqtt Refresh token is not valid.  Unable to authenticate with Ring servers.  See https://github.com/dgreif/ring/wiki/Refresh-Tokens


2020-11-26T13:31:52.485Z ring-mqtt Could not create the API instance. This could be because the Ring servers are down/unreachable


2020-11-26T13:31:52.492Z ring-mqtt or maybe all available refresh tokens are invalid.


2020-11-26T13:31:52.495Z ring-mqtt Please check the configuration and network settings, or generate a new refresh token, and try again.


2020-11-26T13:31:52.497Z ring-mqtt Exit code: 2

I got a token via the command line but it doesnt seem to work.

ok got it working it didnt like the " in the token.

Ah, good, glad you got it working!

1 Like

I installed the addon in home assistant and used the webui to login to ring. But my ring doorbell is not showing up and in the logs of the addon i get: No devices found for location ID 80522ff6-5a6c-4d85-6c36-c54cb0ecde22

Am i missing something?

Just an FYI, I had to stop this integration to add the new Mailbox Motion Sensor. Ring support kept seeing an older device using python when we were troubleshooting. Once I stopped this, I was golden.

I had to rebuild my pi and now I can not seem to get the addon installed? HASSIO


NVM found it https://github.com/tsightler/ring-mqtt-ha-addon

Hi, for contact sensors, is the info entity the battery level? If its not (assuming then it is connection status or something) is there a way to get the battery levels?

Reason I ask, I’ve had my install up over a year now and all these info entities report 100%… So now confused what they are reporting. Thanks.

Anyone who wants to use this as docker compose, the following works fine for me:

  ring-mqtt:
    environment:
      - MQTTHOST=xxxxx
      - MQTTPORT=xxxxx
      - MQTTUSER=xxxxx
      - MQTTPASSWORD=xxxxx
      - RINGTOKEN=xxxxx
          - ENABLEMODES=true
          - ENABLEVOLUME=true
          - ENABLECAMERAS=true
      - RINGLOCATIONIDS=
      - DEBUG=ring-mqtt
    image: tsightler/ring-mqtt
    volumes:
        - /srv/docker/ring2mqtt:/data