Ring Device integration via MQTT w/ Video Streaming

@Andrew_Mak & @xraken

I don’t offer technical support in this thread. Please feel free to open an issue on the Github project page and I will attempt to assist you there.

Is anyone using a battery camera that has been hardwired? Since running this addon my battery level has been sitting around 2-6%. I’ve turned off the constant snapshot automation that @tsightler helped with, but, so far no real change in battery…

Is anyone successfully running ring-mqtt with zwavejs2mqtt? I am running them as two docker containers, and no matter what i cannot get them to connect to each other. My docker-compose file is as follows:

# *****************************************************************************************
# ***                               ZWAVEJSMQTT                                         ***
# *****************************************************************************************
    
  zwavejs2mqtt:
    container_name: zwavejs2mqtt
    image: zwavejs/zwavejs2mqtt:latest
    restart: always
    tty: true
    stop_signal: SIGINT
    environment:
      - SESSION_SECRET=mysupersecretkey
      # Uncomment if you want logs time and dates to match your timezone instead of UTC
      # Available at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
      - TZ=America/Chicago
    networks:
      - zwave
    devices:
      # Do not use /dev/ttyUSBX serial devices, as those mappings can change over time.
      # Instead, use the /dev/serial/by-id/X serial device for your Z-Wave stick.
      - '/dev/serial/by-id/usb-0658_0200-if00:/dev/zwave'
    volumes:
      - zwave-config:/usr/src/app/store
    ports:
      - '8091:8091' # port for web interface
      - '3000:3000' # port for Z-Wave JS websocket server

    
# *****************************************************************************************
# ***                               RING2MQTT                                           ***
# *****************************************************************************************
  ring-mqtt:
    container_name: ring-mqtt
    restart: unless-stopped
    image: tsightler/ring-mqtt
    networks:
      - zwave
    ports:
      - 8554:8554                      # Enable RTSP port for external media player access
    volumes:
      - /home/jim/Docker_Config/ring-mqtt           # Mapping of local folder to provide persistant storage
    environment:                       
      - RINGTOKEN=<my token>
      - MQTTHOST=zwavejs2mqtt       # Hostname or IP of MQTT Broker
      - MQTTPORT=1883                    # TCP port for MQTT Broker
      # - MQTTUSER=                          # Username for MQTT Broker (remove for anonymous)
      # - MQTTPASSWORD=               # Password for MQTT Broker (remove for anonymous)
      - ENABLECAMERAS=true             # Enable camera support
      - SNAPSHOTMODE=all                # Snapshot options (see: https://github.com/tsightler/ring-mqtt#snapshot-options)
      #- LIVESTREAMUSER=stream_user     # CHANGE ME -- Highly recommended if RTSP server is exposed
      #- LIVESTREAMPASSWORD=stream_pass # CHANGE ME -- Highly recommended if RTSP server is exposed
    logging:                           #limit logs to 10m and 3 files
      options:
        max-size: 10m
        max-file: "3"

networks:
  zwave:
volumes:
  zwave-config:
    name: zwave-config
1 Like

Why would you want the 2 containers to connect? Both should connect to your mqtt server instead.

Yeah… I’m an idiot. Somehow I completely forgot that zwavejs2mqtt isn’t a broker, still needs something like mosquito. Anyways, ignore me. Thanks.

The livestream is working, but when I toogle it off, it turns itself back on again after about 1 min. When I set it up I did not experience that behaviour. All automations using the camera service is turned off. Setting longer snapshot interval did not help

Any ideas? I am not currently getting any motion detection since the camera is always live.

image

Edit: restarting HA seems to solve the issue. I think when opening the stream from a picture glance that the switch never gets turned off again.

EDIT EDIT: Yes, indeed. When opening stream from picture glance card the stream never stops even if I close the app. If I turn the live stream switch off myself it will just turn on again. Doing it from an automation seems to work.

UPDATE - THE BELOW ISSUE SEEMS TO BE RELATED TO SETTING A USER NAME AND PASSWORD. ONCE REMOVED, I CAN SEE THE STREAM. SO SEEMS TO BE ISOLATED THAT SETTING

Hi All,

Great add on. I’m new to HA and getting this integration up and running has greatly increased the functionality of my system. Thank you so much for all your efforts here.

I run HA on a Synology NAS in a container and this has been running flawlessly for me for weeks. SSL is enabled. I’ve recently tried to reconfigure to enable camera support. I’d like to have a live stream of the camera play on my TV on ring press.

I’ve added the camera successfully but when I attempt to access the live stream, I just get the loading circle spinning with no video ever appearing.

I’ve read this entire thread and am sure I missed something or misconfigured a setting. Below is my docker-compose settings. I also tried to play the rtsp stream via VLC and have pasted the error message further below. My local network starts with 192…so the URL starting with 172. seems odd, but I do recall you mentioning that the stream goes to Ring servers first then comes back, so maybe that is normal.

I really hate to disturb you with the question…I just can’t seem to figure it out on my own. Any clues of where to look are words of advice would be greatly appreciated.

Thanks,

John

DOCKER COMPOSE:
services:
ring-mqtt:
restart: unless-stopped
ports:
- 8554:8554
environment:
- MQTTHOST=192.168.4.50
- MQTTPORT=1883
- MQTTUSER=hass
- MQTTPASSWORD=[REMOVED]
- RINGTOKEN=[REMOVED]
- ENABLEMODES=true
- ENABLEVOLUME=true
- ENABLECAMERAS=true
- LIVESTREAMUSER=
- LIVESTREAMPASSWORD=
- RINGLOCATIONIDS=
- DEBUG=ring-mqtt
image: tsightler/ring-mqtt
volumes:
- /volume1/docker/ring-mqtt:/data

VLC ERROR

live555 debug: connection timeout

live555 error: Failed to connect with rtsp://172.18.0.2:8554/3ce1a15fc648_live

main debug: no access_demux modules matched

main debug: creating access: rtsp://172.18.0.2:8554/3ce1a15fc648_live

main debug: (path: \172.18.0.2:8554\3ce1a15fc648_live)

main debug: looking for access module matching “rtsp”: 27 candidates

satip debug: try to open ‘rtsp://172.18.0.2:8554/3ce1a15fc648_live’

satip debug: connect to host ‘172.18.0.2’

main debug: net: connecting to 172.18.0.2 port 8554

main warning: connection timed out

satip error: Failed to connect to RTSP server 172.18.0.2:8554

main debug: net: connecting to 172.18.0.2 port 8554

main warning: connection timed out

access_realrtsp error: cannot connect to 172.18.0.2:8554

access_realrtsp debug: could not connect to: 172.18.0.2:8554/3ce1a15fc648_live

main debug: no access modules matched

main debug: dead input

Hi experts, I am a brand new HA user who got into this just a few days back. Using HA OS in a VM. I have a ring doorbell and wanted to integrate it with HA as the first project. I first installed Moquitto MQTT and configured it. Then integrated ring through HA->configuration->Add Integration (thought that this is needed for MQTT w/Video Streaming). Gone through the 2FA. Then through Supervisor->Add-onStore installed Ring-MQTT with Video Streaming. Now when I click overview in Lovelace I see the ring bell attributes like last ding, last motion, Volume, Wifi signal strength showing up. Under Binary Sensor, I see Ring-MQTT with video streaming running. Under Sensor, I see Ring-MQTT with video streaming running. Well, I don’t know how to get the image or video on the UI. I think I need to create a video/image card to display it? Is it right? Also, where would I get the URL for the ring doorbell camera video/camera. Is there a step-by-step guide to integrate the ring doorbell I am missing? Again I am very ignorant as I am learning HA and very interested, so please bear with me if I’ve asked any stupid or obvious questions. Also, do I need both ring integration and ring-mqtt live stream add-on to have the live stream in the UI? Thank you

You have to make a camera entry in config.yaml

Thanks @PapaLanc PapaLanc, again an ignorant question, is the camera_id the MAC ID or IP address for camera. If not both then how to find out.

I do not know LOL. I thought I did as the first time I made a card it worked, but never again.
I “think” what you do is look at the ring log and find your camera(s)

2021-11-29T14:09:05.118Z ring-mqtt [Big Room] ring/9dxx4b25-139b-4511-8848-352dxxb0e84/camera/54e0xxx74e26/stream/state ON

put the last group of stuff before/camera before -ring and the stuff after camera last

Stream Source:   rtsp://352dxxb0e84-ring-mqtt:8554/54e0xxx74e26_live

If you search devices for cameras you should find it

all that said it is not working for me now

I cannot telnet to 8554 when live stream is on ??
at the bottom of the ring config page there is a place to enable 8554

Thank you @PapaLanc . I will try tonight and update here.

Hello,
I recently set up the integration and everything is working flawlessly except for one issue that I can’t figure out. When the alarm is triggered, if any other ring security device changes its state besides the device that triggered the alarm in the first place, the home assistant alarm state is set back to armed instead of continuing to be triggered. I looked at the logs for the integration and I see that when these other devices change their states, for some reason an all clear is sent and the alarm is told to go to armed. The ring alarm itself continues to be active and the siren also continues to go off.

Thanks finally got the Live stream to work. But it works only when I click the icon in the UI. The live stream opens in a separate window. How to get the live stream in the UI directly.

I am pretty sure the FAQ’s say it is not intended for live streaming. Get an IP camera :slight_smile:

Today, after a week of no issues, all my Ring devices stopped showing any status in Home Assistant. I couldn’t find any issues, so I decided to uninstall MQTT and try again.

After reinstalling Mosquito, setting up a new User/PW in Configuration->Users, and reinstalling the MQTT Ring Add-On, I noticed the following in the logs:

ring-mqtt Using configuration file: /data/options.json
ring-mqtt Reading latest data from state file: /data/ring-state.json
ring-mqtt Attempting connection to Ring API using saved refresh token.
ring-mqtt Response code 500 (Internal Server Error)
ring-mqtt Unable to connect to Ring API using saved refresh token.
ring-mqtt Could not connect with saved refresh token and no refresh token exist in config file.
ring-mqtt Please use the web interface to generate a new token or restart the addon to try the existing token again.

So I regenerated the token using the webUI and this is what I got:

ring-mqtt Username/Password was accepted, waiting for 2FA code to be entered.
ring-mqtt Using configuration file: /data/options.json
ring-mqtt Reading latest data from state file: /data/ring-state.json
ring-mqtt Updating state data with token generated via web UI.
ring-mqtt Attempting connection to Ring API using generated refresh token.
ring-mqtt Response code 503 (Service Unavailable: Back-end server is at capacity)
ring-mqtt Unable to connect to Ring API using generated refresh token.
ring-mqtt Could not connect with saved refresh token and no refresh token exist in config file.
ring-mqtt Please use the web interface to generate a new token or restart the addon to try the existing token again.

It looks like the API isn’t working properly? I’m assuming others are running into this too?

Update: Just got news alert about Amazon AWS issues. Looks like that is the cause. [Wish I hadn’t just uninstalled/reinstalled everything for nothing - hope it comes back online fine :slight_smile: ]

Yes
Status.ring.com

Looks like we’re back online. Got a motion notification through the ring app, restarted the integration and we’re back in business.

My Ring app is back up, but I’ve uninstalled and reinstalled this integration and it still won’t show a stream now. Any ideas?