Ring doorbell

Hi @zolakk I know you´re busy and things are still caos around us.
But I have a question wether it´s possible to optimize the binding to react faster on motion detection?

On my phone I get the motion notification almost immediatly. But it takes aproc 1 minute for the same notification to reach openhab.

My phone registered a motion at 11:28:53 today… This is what happens on openhab:

2020-04-30 11:29:59.592 [vent.ItemStateChangedEvent] - RingEventVideoURL changed from http://10.4.28.200:8080/ring/video/FrontDoor-ding-2020-04-30T11-15-29.mp4 to http://10.4.28.200:8080/ring/video/FrontDoor-motion-2020-04-30T11-28-53.mp4
2020-04-30 11:29:59.608 [vent.ItemStateChangedEvent] - RingEventCreated changed from 2020-04-30T11:15:29.000+0200 to 2020-04-30T11:28:53.000+0200
2020-04-30 11:29:59.620 [vent.ItemStateChangedEvent] - RingEventKind changed from ding to motion

Notice 1 minute at 6 seconds after.

I know this may be because the Ring doorbell communicate directly with Ring server. But I would hope it could be faster, at least to get the notification for motion?

@jsable
Any chance of getting the contents of the script please? Only interested in the line that sends mp4 to telegram as I don’t use ring. The telegram binding does not have the ability
Built in from looking a few months back and I just added the ability to record to mp4 using any brand of camera with RTSP to the ipcamera binding so wish to have a play at sending the mp4.

Sure @matt1

Here it is the entirety of the script, just 2 lines:

#!/bin/bash
curl -s -X POST "https://api.telegram.org/bot[Bot Token]:[Goes Here]/sendVideo" -F chat_id=[Chat ID goes Here] -F video="@/etc/openhab2/html/ring.mp4"

This is not at all specific to ring, but sending a video file through telegram. Just named it that to make it easier on myself. It’s just more or less giving the file path. Hope this helps!

~John

1 Like

@Kim_Andersen, I have been through the code several time since I have starting working on this project and I have not been able to figure out if there is a better way with less potential for lag like what you noticed. Having no documentation on the “API” doesn’t really help much, I get hints looking at code of other projects like this one: https://github.com/dgreif/ring that they might somehow use a subscription instead of a poll but much like the other projects i’ve, they don’t seem to document what their implementation actually does under the hood to talk to ring’s servers so i’ve been working on educated guesses and blind luck to be honest. With this binding working as a poll to see if a new event has been posted to your account, it is at the mercy of ring posting that event in a timely manner - which as we have noticed, is unfortunately not always the case. In other words, if we ask every 5 seconds if there is a new event and ring says that “no, there is not”, until we keep asking for another minute and they finally say “yes, but it happened a minute ago”, there isn’t much we can do about that. This “lag” has honestly been one of the most frustrating things about working on this and it’s driving me nuts.

I sure understand how you´re feeling… And if there is nothing to do then thats just how it is. I really appreciate all your work.

Hi there,
as this is a very long thread, is it maybe an idea to make like a tutorial on it’s own? With the download files and the steps in 1 simple message/thread. I think that much would be clarified for other people having problems installing it…
I’m looking right now for a doorbell that has a motion detector, video-stream available for the OpenHAB mobile app and 2-way communication and configure it in my OpenHAB. I know some stuff about the coding(which is quite different for OpenHAB running on a Synology NAS-server than the usual RPI’s) but not an expert. Does anybody got suggestions for a kind of doorbell?(I’m based in the Netherlands)

Regards,
Jim

1 Like

Though the Ring seem to be one of the better ones, I will not recommend it, if you want motion detection through openhab. It takes too long to make sense. And infact, the motion sensor is quite useless (in my opinion) even without openhab. The person has to be very close to the doorbell before it triggers.

Unfortunatly I dont know of any better. Rumors are, that the Nest Hello isnt much better :frowning:

Hi @zolakk,

Will this wiki page help you with a possible live view? https://github.com/dgreif/ring/wiki/SIP-Communication. You could just return the URL of the live view

I have noticed the base of the code of the package I sent you is the following: https://github.com/jimhigson/ring-api. As far as I can see (I haven’t checked the code thoroughly) they are using the “HTTP polling” method to retrieve device updates (motion detection, rings, etc). The dgrief package (https://github.com/dgreif/ring) is doing the same. They are not listening to a server sided event, but it seems like they do because they are returning a “promisfied” (to make a long story short: async JS code) custom triggered (global) event which you can subscribe to. It looks like they are still only polling every x seconds.

I do not have that much free time to dig into the code, especially since I will have to rebuild the part to support OAUTH 2 (they are using refresh tokens nowadays, apparently) for the “base” code. May I discover some new things, I’ll notify you

Edit: See https://github.com/jimhigson/ring-api/blob/master/poll-for-dings.js and the function (line 115) in “listenForCameraUpdates” here: https://github.com/dgreif/ring/blob/master/api/api.ts. They are piping (basically re-executing) the given functions every cameraStatusPollingSeconds * 1000 milliseconds. This is pure polling. So, if you experience a delay when detecting a motion detection of one minute, then they do as well. An old PHP based API does the same: https://github.com/jeroenmoors/php-ring-api/blob/master/ring.php. Again, I haven’t checked it thoroughly but it looks like they execute the following URL: https://api.ring.com/clients_api/ring_devices and check all active dings of the cameras. If the active ding has “motion” as type, it’s a motion detection. See ring-camera.ts line 116 https://github.com/dgreif/ring/blob/master/api/ring-camera.ts#L116

I wonder if this ever got solved, since I’m experiencing the exact same problem.

My solution for instant notifications is using an amazon echo and a alexa routine.
My doorbell_ring item is tagged with [“Switchable”] so the hue emulation makes it available to Amazon Echo.
In the Alexa app i created a routine “doorbell ring” that is triggered by the Ring doorbell ring event and sets my OpenHAB doorbell_ring item to ON. Then a rule can react instantly on a ring doorbell event.

It’s very sad that ring is absolutely not interested in any smart integration of their products. I will never by this crap again. Google Nest seems to have better options for integration and a offers free limited recordings that would be enough for me.

I moved to DoorBird - https://www.doorbird.com/, local API, with instant notifications on move, pressing the bell, images and videos … , and easy integration into openHAB2 and the whole eco system.
Highly recommended - I’ll never buy a “cloud-only” product and I bought Ring 2015 with the promise of a local API in Dez 2015 (which obviously never came…).

(it has an App, too - and a plan if you’d like to store videos/images for a longer time)

It looks like Ubiquiti may be releasing their own video doorbell, called the “UniFi Protect G4 Doorbell“. They have it up in their US early access store for $199, although it shows as sold out at the moment.

I’m using Ring now, but I would gladly ditch them in favor of a Ubiquiti product that doesn’t require using a cloud service, assuming they make some sort of Local API available for integration.

1 Like

Hi any option to install the doorbird horizontally ?

I wouldnt count on that, to be honest. In best case it will work with the through the controller or their DVR software, but I doubt they would have an integration with other stuff. Thats not what Ubiquiti is all about…

I´m about to dump my Ring… I bought it a coupple of months ago, but I have to admit, only after a few days I was sick and tired of it…
Its pretty much useless answering calls (Doorbell press). One will have to manually open the app, entering Live view to answer calls. Thats simply too stupid to be real!
Its pretty much useless viewing new recordings from motion sensor triggering. The user will have to wait untill the recording is ready from the cloud… At the time any motion infront of the door would have been long gone! Thats even more stupid!

I honestly dont understand howcome a company like that are able to get away with such stupid functionalities. And even worse, there are lots of users out there who believe this is one of the best video doorbells :tired_face:

I´ll probably have a go at Dahua VTO2202F-P

Yeah, the Ring is awful. If you haven’t yet, you might also want to consider the Hikvision video doorbell which is quite popular these days:

It’s not perfect, but it’s getting close through community support. Probably the best locally-hosted option available for the moment.

Pretty much the same as Dahua I think. But Dahua support SIP and has options for external alarm switch/door/whatever.

EDIT. Dahua´s doorbell is PoE and not Wifi.

Hi, I wonder if you managed it to run the binding? It looks like the binding is no longer further developed?

I never got it to work. My goal was to trigger exterior lights based on movement detected by Ring path lights, but Ring doesn’t provide API entries for those even in their system, so I ended up just buying a new Z-wave motion detector and problem solved.

Good evening

please do not blame me about my question, but I wonder, if you might develop furthermore this binding? Ring,Alexa and Openhab might just play wonderfully together …
Best regards
Marcus

Hello everyone,

may I ask a short question to those how managed to get it running? I was able to setup the binding and basically it works - at least the channels get updated:

==> /var/log/openhab2/events.log <==
2020-08-30 23:02:20.212 [vent.ItemStateChangedEvent] - RingEventKind changed from on_demand to ding
2020-08-30 23:12:52.445 [vent.ItemStateChangedEvent] - RingEventCreated changed from 2020-08-30T22:59:04.000+0700 to 2020-08-30T23:09:34.000+0700

But after a “ding”, I can see the following errors (debug-mode):

==> /var/log/openhab2/openhab.log <==
2020-08-30 23:12:04.841 [ERROR] [hab.binding.ring.internal.RestClient] - Unhandled http response code: 403
2020-08-30 23:12:04.843 [DEBUG] [hab.binding.ring.internal.RestClient] - RingVideo: Error downloading file: Failed : HTTP error code : 403
2020-08-30 23:12:21.110 [ERROR] [hab.binding.ring.internal.RestClient] - Unhandled http response code: 403
2020-08-30 23:12:21.112 [DEBUG] [hab.binding.ring.internal.RestClient] - RingVideo: Error downloading file: Failed : HTTP error code : 403

Anybody else having this kind of error or maybe a solution?

Regards,
Flip