Ring doorbell

I tried the binding as well, but can’t login into the account. I created the thing via PaperUI (as written in the manual), but no luck…wold love to have them up and running.

regards
Marcus

What version of the binding are you using? Did you try:

  1. enter only username/password on the binding configuration
  2. wait for your auth-code, enter the binding config again and put it there
  3. after successful login, enter the binding config again and delete username/password

This is how I managed to get it working…

Still cannot get it to work, the binding remains in Status:

OFFLINE - CONFIGURATION_ERROR Two factor authentication enabled, enter code
In the logs I can see a 401, don’t know how to handle this:

2020-09-14 11:25:13.668 [INFO ] [hab.binding.ring.internal.RestClient] - Creating Ring client for API version 11 on endPoint https://api.ring.com
2020-09-14 11:25:14.398 [INFO ] [hab.binding.ring.internal.RestClient] - RestApi getAuthCode: https://oauth.ring.com/oauth/token, response code: 401, message Unauthorized.

Maybe I am using the wrong jar file?

Thanks so much for this tip @fuslwusl - Genius! I’ve an Alexa so have just used this too. A workaround, but very useful in you have Alexa. Particularly now IFTTT is going to shortly be charging. Thanks!

Hi, is this still working? I am struggling to send a video to telegram

if I run this as a test i get the following error
https://api.telegram.org/bot*****/sendVideo?chat_id=*****&video=http://192.168.1.10:8080/static/ring.mp4

{“ok”:false,“error_code”:400,“description”:“Bad Request: wrong file identifier/HTTP URL specified”}

Hi All. Do you know if the Ring binding will be updated for 3.0.0.M1?

Hi all.
I’ve upgraded to 3.0.0.1M and it look like the ring bing binding is not working. Please below:
09:58:51.579 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/C:/openhab/addons/org.openhab.binding.ring-2.5.2-SNAPSHOT%20(1).jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.ring [264]
Unresolved requirement: Import-Package: org.eclipse.smarthome.config.core

    at org.eclipse.osgi.container.Module.start(Module.java:444) ~[org.eclipse.osgi-3.12.100.jar:?]
    at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[org.eclipse.osgi-3.12.100.jar:?]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.4]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.4]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [bundleFile:3.6.4]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.4]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.4]

Any help to make this work please.

Hi,
is this binding working on OH3?

Hi @jwgilesjr ,

can you please share some examples on how you managed to integrate your ring devices?

Thanks

Hello @DarkoG

Its been awhile since I worked on this, but my setup is still working for everything except live video stream. I attempted to explain my setup in my post from Dec '19. The documentation at the link in that post contains example python scripts. That is where I would start.

I can try to answer your specific questions if you’ll post which part needs clarification.

Hi @jwgilesjr,

I was playing yesterday with the examples and I am able to connect and print for example the last events on the screen.
I would like to get the at least the button and motion triggers to OH3, so if you could post that part would be great.

Do you need to enter credentials when for example my rPi running the program is restarted?

FYI, I am getting “None” returned for the live stream url. I do have gen 1 doorbell without subscription, so maybe that is the reason, however I am currently switching from Smartthings and there I am able to see the live stream (by manually setting the smartthings device as ring pro).

Thanks

Hello @DarkoG,

First, let me say I have no programming experience and I’m a complete novice at it. The only reason I got this to work is that I was too stubborn to give up. I did a lot of googling…

On to your question…you are on the right track. From here, I would do the following:

  1. Create a file for your python script and paste your code into it.
    – You can experiment by running it from terminal until you get it working like you want.
  2. Create an exec command in OH that calls the script
    – Create a rule that runs the exec command on OH startup
  3. Create items in OH for the parameters from the python script you want displayed in your sitemap
  4. Insert lines in your python script that export the parameters you want to the OH items using “requests.put”. See OH REST API document. There is a learning curve.

Note: It worked better for me to download video with a separate python script, triggered by a different OH exec command. You can run it with a switch item in your sitemap or use a rule triggered by a change in motion event time.

Regarding credentials, the python script will prompt you the first time, but then saves a token it gets from the ring servers, so you won’t get prompted again until the token expires.

Hope this helps.

Some additional information:

My ring OH items:
String ringeventtime “Last Event [%s]”
String ringeventkind “[%s]”
Number batteryLevel “[%d %%]”
String ringconnected “Connected [%s]”
String lastvideoURL “URL [%s]”

My sitemap excerpt:
Text label=“Ring Doorbell” icon=“motion” {
Text item=ringconnected
Text item=batteryLevel label=“Battery Level” icon=“battery”
Text item=ringeventtime label=“Event”
Text item=ringeventkind label=“Kind” icon=“motion”
Text label=“Last Video URL” icon=“video” {
Text item=lastvideoURL
}
Text label=“Last Video” icon=“video” {
Video item=lastvideoURL url=“lastvideoURL”
}
}

Example python code line to export connection status to OH item “ringconnected” where IP address is that of your OH RPI:

requests.put(‘http://IPAddress:Port/rest/items/ringconnected/state’, auth=HTTPDigestAuth(‘openhab’, ‘’), data=doorbell.connection_status)

1 Like

OK @jwgilesjr, thanks for the help, I got the motion and the rings connected, however I notice 20-30 seconds delay, but I can live with that. My livestream doesn’t work also.

I used the python-openhab for writing back the values to OpenHAB and that was working very smoothly. The biggest issues I had was with the permissions of the token file, however putting the script in /var/lib/openhab solved the issue.

Hello @DarkoG, glad you were able to get it to work! I was never able to livestream using python_ring_doorbell, but I was able to get livestream functionality into openhab for the doorbell using the same technique and a different program.

I had a spare RPI zero laying around, so I loaded Ring-Client-API (GitHub - dgreif/ring: Unofficial API for Ring Doorbells, Cameras, Alarm System, and Smart Lighting) onto it and connected to openhab. It works but I ran into a couple of issues: First, there was a delay (45 seconds) between initiating the livestream using a switch in openhab and receiving the livestream feed. This severely limited the utility. Second, I was manually copying the token from the python_ring_doorbell to the Ring-Client-API to get it to connect, which was inconvenient.

In the end I was able to reduce the lag time to about 15 seconds to start the video, but I never completed automation of the token transfer, so I eventually quit using it.

If any of this is of interest and you want to set it up, I can try to answer any questions you have.

Could you get into more detail? I tried it but got stuck as I’m quite new to Javascript. Do I need to run a index.js on the pi containing this code?

I don’t want to access live feeds, only battery %, and timestamps when there was motion/a ding is enough…

I’m also a beginner with javascript and I struggled to get this running, but the trick is to find the examples folder on the web page and use browser-example.ts as your template. Use that code to create a javascript file to get the program started.

However, I only use Ring-Client-API for livestream since I could not get livestream working with Python Ring_Doorbell (see my post from Dec '19 in this thread). I use Python Ring_Doorbell to get battery %, timestamps, etc.

Hope this helps…

I had the python code working but after a few days it let me down. Since then, I struggle to get a new token since. Initially, I had to modify the python because the pathlib did not work with read() and write() on my rpi zero running buster. It worked for a day or two though.

Via de JS-route it would give me a token but somehow that does not work in the Python version. I’m not very good in JS hence I struggle to get things working, produce the correct files and get code implemented into the OH environment.

I also had an issue recently with a token error, but if you go to the issues tab on the Python Ring_Doorbell github page, you’ll find a discussion and fix on the missingtokenerror (MissingTokenError · Issue #251 · tchellomello/python-ring-doorbell · GitHub). This solution helped me get it working again.

Thanks for your replies. I now got the python-version working again too. I will give the JS-version a go to but at a later stage when I have a bit more time to dig onto all the JS stuff. For now, I am more concerned getting my smarthome more configured…