Ring doorbell

In my rule, I use:

rule "Ring Trigger"
when
    Item Ring_Acct_Time changed
then
    createTimer(now.plusSeconds(30), [|
    executeCommandLine("wget " + Ring_Acct_URL.state.toString + " -O /etc/openhab2/html/ring.mp4", 5000)
    executeCommandLine("/etc/openhab2/scripts/./ring.sh")
end

This copies the ring video to the html folder 30 seconds after the time changes, and sends me a copy of the video through Telegram. Then on my sitemap, I have:

Video url="http://10.0.1.25:8080/static/ring.mp4" icon="ring"

So I can see the most recent video on my sitemap.

~John

There are lots of approaches. Using the String split it would be something like.

val parts = UrlString.split("/")
val filename = parts.get(parts.size-1)

Thatā€™s something different. You could use a simple replace assuming the first part always stays the same.

val newUrl = UrlString.replace("http://192.168.0.230:8080/ring/video/", "http://www.mypersonalURL/OHRing/")
1 Like

when i use this in habpanel in an iframe it downloads a 0Kb mp4 and does not show the video in the frame? I have files which i can open and view just fine in the video download folder. is there any way to get this to play in a widget on habpanel?

@Greigc,
I was having that 0 kb issue until I updated to the ver. 2.5.2 of the binding. What is the URL you are using for your video? I put the Video URL (see post above) in to a HABpanel frame widget and went to the ā€œadvancedā€ tab and clicked the box ā€œfill to edgesā€ and the most recent Ring video plays in scaled size (to the widget) without issue.

~John

1 Like

ok thats fixed that problem but how do i refresh the widget automatically upon new event?

Does anyone have a way to refresh the video feed to pickup the new ring.mp4 when its copied to the html folder and play it on detection on the new file?

Thanks works great but it takes about 30 seconds to get the Event. Any idea?

The only thing I can think of is thatā€™s an issue on the ring end. Either they are being slow to post the event to your account or possibly your polling rate is too fast and youā€™re getting throttled by them if youā€™ve set it to less than the default 5 seconds.

I am still a newb with openhab. Just recently installed it on my Synology and slowly finding my way around things, items and rulesā€¦

I am failing to connect my ring account. I do have two factor on, so I enter credentials in the account thing, receive the two factor code and edit the account thing. I receive following error : OFFLINE - COMMUNICATION_ERROR Invalid username or password.

I guess the problem is with the two factor, but how do I get a refresh token?

Are you using a .things file or did you create the thing in paperui? If you did it in paperui, once the two factor code is put in, it should auto populate the refresh token as long as the correct code got put in before it expired

I added in paper UI and entered the code within the first minute or so. The code should be valid for 10 minutes.

Ok, strange it should be working. If you go to the properties area where you put in the username, password, etc. Click on Show More and see if the refresh token is populated by a whole lot of dots or stars like it has a big long password in it. If so, or maybe just in case anyway try restarting the binding via the karaf console with ā€˜bundle:restart org.openhab.binding.ringā€™ or restarting openhab altogether. Iā€™m not sure how to get to karaf on Synology but on openhabian/linux you can get there by doing ā€˜ssh -p8101 openhab@localhostā€™ and entering ā€˜habopenā€™ (no quotes) as the default password.

I had several tries including restarts of OH, updating the binding from 2.5.1 to 2.5.2, removing the thing and adding again. Iā€˜ve always checked all fields on the edit pane. The refresh token field was always empty. I only know to states of the thing: add two
factor password and invalid credentialsā€¦

Have you tried going into karaf and making sure that the 2.5.1 version isnā€™t still hanging around by doing a bundle:list -s | grep ring ? I have noticed that sometimes happens

Karaf on Synology works like this: ssh to Synology and on Synology then ssh to Karaf.

The only ring binding hanging around is 2.5.2.xxx. I did restart it.

Still the same problem. When I create an account thing and enter my credentials and save the thing (error: two factor enabled, please enter code), the two factor code from Ring comes instantaneously. I then go edit my account thing and add the two factor code. But nothing moves. I get the invalid username or password errorā€¦

Oh, and thanks zolakk for trying to helpā€¦

Strange. Can you please then set the log level to TRACE, restart the binding, and PM me the results from when it restarts to when you see the invalid username or password error? I may need the same with starting over with a blank config of the account thing too. This will output every response from ring in clear text, if it includes any user, password,or any other sensitive data feel free to redact that of course.

I know iā€™ve qasked this aready but is there a way to refresh the video file on new ring.mp4 detected? as i have to manually refresh the page to get the new video in the frame widget?

Thanks.

Hi,

I have an android screen running habpanel. I currently use android tasker to intercept ring notifications and open the ring app for video feed of front door from ring. Tasker then reverts the android screen back to habpanel. It works well but I would prefer it to be more integrated with openhab and habpanel. Does this binding receive ring notifications? I heard that there may be a way but it has a large delay between the doorbell being pressed and the notification appearing on the openhab bus?

I also understand that I could use Alexa as a middleman here because Alexa does have fast integration with ring.

Any advice on a better way to do this or whether this binding can help would be appreciated.

Stu

Has anyone tried to add the video ringtone with the Tosee application to OH?

This binding relies on a polling mechanism, so there may be a delay of the binding picking up an event between your polling intervals (5 seconds seems to be the most reliable). Itā€™s been noticed that sometimes it takes longer than that for ring to post the event to your account so the binding can grab it, it seems to work fine for me but YMMV. It does however download the video file for the event as soon as itā€™s posted to your account so you have a local copy, which is a perk many find useful. Alexa has a faster response because I believe they are set up as a ā€œpartnerā€ with ring and can take advantage of those private APIs that we canā€™t. My best suggestion is to try it out and see if it fits your needs

1 Like