Ring Device integration via MQTT w/ Video Streaming

Yeah, probably some bug snuck in there when I was refactoring the properties, perhaps I missed a reference in the older code. It can sometimes be difficult to track all of the references down.

I really need to re-write that code anyway, the logic is too complex and difficult to follow, has dependencies on things it shouldn’t, which makes it very fragile. I kind of took a hackish approach to adapting it to the new way of streaming. I’ll try to take another look through it.

But, to answer your question, the way you can figure it out is to open an issue on the Github project page, describe the issue you are having in detail and provide the information including device models, provide logs, and I can look into it. This forum is not really conducive to troubleshooting issues.

Also, the error message you are reporting does not appear to be from the addon, but from the generic camera setup. It almost certainly is related to the snapshots not working since it is the still image URL that is failing. Either that, or the URL is incorrect for your setup as the suggested. But again, that is a support issue and should not be addressed here.

I’ve added additional debugging and thank you for the input. However I’ve been seeing issues like this on a semi-daily basis (where the websocket disconnects after a ring refresh token reset). Is any one else seeing a similar issue?

2021-09-19T11:18:22.993Z ring-mqtt File /data/ring-state.json saved with updated refresh token.
2021-09-19T11:18:51.730Z ring-mqtt Websocket for location id {location-id} is disconnected

Of course I can’t say that no one else has the problem but I’ve had no other reports of this issue and this part of code has remained largely unchanged since the earliest days of this project which is getting close to 3 years old at this point. I estimate that this project is used by >1000 users at this point and they are not generally shy about posting issues on the Github project.

The websocket connection and tokens are maintained by the ring-client-api library, not ring-mqtt itself, I’m just monitoring and logging them in ring-mqtt. This library is used both my the ring-mqtt project and ring-homebridge and many others and there are no reports of this issue on any of those projects.

It would really be best to open an issue if you want to dig into the problem.

From what I could tell, it seems to be that what generates the URL for still_image assumes the entity name is <entity_name>_snapshot. For instance, one of my ring doorbells is Back Doorbell. But the generated URL showed back_door_snapshot. I changed it to be back_doorbell and I was able to get my snapshots back.

There’s a definite bug in 4.8.3 for battery cameras. It’s already fixed in the dev versions.

Also, the docs clearly state that the URLs are just a guess, they assume standard entity names in Home Assistant, but it’s not always correct, especially if a device has been renamed after discovery. I’ve played around with trying to query the HA API to get the list of entities, but I can’t really figure out how to get enough information to make that useful. Perhaps someone that knows more than me about the Home Assistant API can tell me better.

Dear Tsightler,

I can confirm - dev versions is working WELL, bug is fixed :slight_smile:
Batteries camera take snapshots upon motion, live stream is OK, archive video is OK.
THANKS A LOT for EVRYTHING YOU DOING TO MAKE our LIFE EASY :+1:

BEST REGARGDS

Thanks for confirming @alexreddy78. I plan to push out 4.8.3 sometime tonight, other than the snapshot fix it has a few minor things like adding the eventId and recordingUrl as attributes of the event stream selector which simplifies automation for downloading these recorded videos.

It also adds support for recognizing Dome sirens, and adds a siren switch that allows sirens to be manually toggled on/off.

1 Like

my ring cam is wired and not working right now because its saying battery is dead. I’ve read the other issues just wanted to confirm it is effecting hardwired devices as well.

Looking forward to an update this evening. Thank you so very much!

If a Ring camera has an option to be powered by a battery, then it’s a battery camera and has all of the limitations of a battery camera, regardless of whether it is actively powered or not. That means that it is not possible for it to take snapshots while recording. Any camera that has this limitation is impacted by the bug in 4.8.2 because the bug impacts the alternative method that has to be used to try to get a snapshot from the live stream.

Cameras that only offer hardwired power behave differently and do allow snapshots during streaming, they are not impacted by the bug and snapshots work as expected.

Unfortunately, because of the complexity of the logic around grabbing a snapshot from the stream for battery cameras, bugs can slip in easily, especially since I don’t own any battery based Ring cameras to test with, so I have to attempt to fake having one. However, in 4.8.3, while the method for getting the snapshot is unchanged, I’ve significantly refactored the logic for battery camera snapshots to simplify it down to just two fairly simple functions that leverage the existing streaming code that’s already there. I hope that will make it less fragile.

I should clarify one thing about this comment. If you have a stick-up cam and you set the power mode to wired, then the camera should behave as a wired camera vs a battery camera, but in that case it should not show batteries. That being said, as I mentioned above, I don’t own any battery capable cameras, so there could be behaviors that I don’t fully understand. If you see behavior that is unexpected you can always open an issue on the Github project.

Just wanted to say a big thank you to @tsightler.
Set up the video integration yesterday, nice and simple process.

Now happily got my Ring Cameras on my Lovelace dashboard and got them interacting with my Nest Hubs and wall mounted tablet so I can get a live video when the doorbell is rang/on command.

:+1:

Hello, im having trouble setting this up… everything was working fine a few weeks ago, and after one of the HA updates, it stopped.
I make the mistake of removing the addon from my supervisor, and now I can’t get it back, I tried adding a few different Repos, but none of them worked, the only repo that could be added. does not let me install The addon.
My question is… Is the only way to install this integration thru Docker, or is there an easier way?

Ive looked everywhere, and cant find an updated tutorial on how to install this. everything is from atleast 6mths ago, which no longer applies to the new HA system.
Please point me in the right direction… thank you!

I’m afraid I don’t have any idea what you mean. Nothing has changed about the way to install this project for years, there’s no new “HA system” that I’m aware of, addons have been part of Home Assistant for as long as I’ve been using Home Assistant. The very first link in the original post on this thread is a link to the Github project for the Home Assistant addon. If you are using a supervised Home Assistant install, you just follow the standard instructions to add a 3rd party repository to the addon store and then install it, that’s it.

By far the most common issue I’ve seen from users is they somehow think this project has something to do with HACS, but HACS has nothing to do with Home Assistant native addons.

If you are not running a supervised Home Assistant, i.e. Home Assistant Core, then indeed the only way to run this project is via Docker or via performing a standard install on a Linux host, but that shouldn’t be a very big deal since Docker is also the most common way to run Home Assistant Core.

Thanks for the reply… Ill be more specific…
This is how I used the addon before. and it was working fine…
On the post from Dagremote from Aug '20. I added this link “https://github.com/rs1932/ring-alarm-hassio-addon” to my repository in the supervisor screen on HA. It install the addon called “Ring Alarm HASSIO Addon”.
But since I updated Hassio and Supervisor this past few weeks (dont really remember the date) the addon stopped working.
After many tries troubleshooting I decided to remove the addon and reinstall it. but now… when I click the install addon button I get this error.
“ERROR (SyncWorker_1) [supervisor.docker.addon] Invalid build environment, can’t build this add-on!”.
If I try to add this link (which I thing is the new one) “https://github.com/tsightler/ring-mqtt-ha-addon” to the supervisor’s repository, nothing happens, no addon added. if I follow the link and go into the github page, there is no instruction on how to install, after searching the forums, the only thing I can see ppl saying is that it need Docker in order to install it via git pull.

Please help me find my mistake, im sure is something simple that im missing.
thank you

I don’t think it should matter but you may want to reinstall Hassio to get rid of any remnants of the wrong add on. You need to install the mosquito broker from the add-on store then add the repository for ring

After you do this it will show up at the bottom of the add-on store to install it
PS I have the HACS add-on for other things. Has zero to do with ring

The https://github.com/rs1932/ring-alarm-hassio-addon is completely unmaintained and hasn’t been updated in years so of course it doesn’t work. There’s no way it could work with current versions of ring-mqtt which has had numerous upgrades and additional capabilities added over the course of that time.

Adding the https://github.com/tsightler/ring-mqtt-ha-addon won’t install the addon, it adds the repository to the store. Once the repository is added you’ll still need to scroll through the list of addons and find it in the list. It’s usually the very last one in the list. This isn’t documented on the site because addons, including adding/installing 3rd party addons, is documented in the Home Assistant documentation. There’s nothing special about installing the ring-mqtt addon vs any other 3rd party addon.

Adding the GitHub - tsightler/ring-mqtt-ha-addon: Home Assistant addon to integrate Ring alarm and camera devices via MQTT won’t install the addon, it adds the repository to the store.

That my problem, its not adding the repo so i can install the addon. My Hassio installation might be the problem. I havent clean it in years, Only updating, maybe is time for a clean install.

Thank you for all your help.

I’m new and sorry for the dumb question but how do I install RTSP? I went to rtsp-simple-server github and downloaded the release but not sure what I’m supposed to be doing with it or where to put it. I do have the rest of the integration working but would like the live streaming.

click on documentation and there is a link for camera support. You do not need rtsp-simple

Good News, Turned out the problem was my Hassio installation, year of neglect left my database with over 20Gbs… I backed up my settings, did a clean install, fixed some of the old settings I had on config.yaml and now everything works fine. Thnx for all the help!.. Even got my NEST working again after almost a year… amazing!!!

1 Like