Ring doorbell

Here you go

This is exactly what I am trying to do with a non-proprietary video doorbell from Hikvision.

https://www.nellyssecurity.com/nsc-db1-onvif-compatible-wifi-doorbell-1080p-ip-camera-w-32gb-built-in-storage-1127.html

I plan to integrate the doorbell video stream into my ZoneMinder setup to be accessible by OpenHAB, but I am trying to figure out the best way to plan a doorbell sound through my multi-zone audio system when someone presses the doorbell button. Does anyone know the best way to implement this functionality? I wish I could have the embedded Linux OS just fire an API call to OpenHAB, but I donā€™t know how to make that happen. Would the best option be to use a Raspberry Pi GPIO in the doorbell circuit (in place of a mechanical chime) to trigger the actions in OpenHAB?

If there would be a binding for your ā€œmulti-zone audio systemā€ that would be no problem.
For example Sonos does have a binding,ā€¦

Thanks for the quick response! I am currently in the process of migrating away from a Savant home automation system to OpenHAB, so I have not yet decided on my audio controller in the new setup. It appears that many people choose to use Raspberry Pis with Logitech Media Server, but I may just opt for a single audio matrix (e.g., Russound) that has OpenHAB bindings to keep it clean. I am open to any audio matrix recommendations from the group.

I am not yet completely familiar with OpenHAB, so would you mind expanding your comment a little further? What would be the best way to wire the Pi/Arduino to trigger this event in OpenHAB? I have seen discussions about people flashing lights when a doorbell button is pressed, but I am yet to come across a comprehensive guide as to the best architecture and configuration here. I am planning to document my process for the community once I get it working because I assume many HA enthusiasts would prefer this to the systems that try to lock you into their cloud services. What I am trying to replace from my Savant system is the doorbell temporarily takes over the audio in several zones to play a doorbell sound and then it returns the audio to the previous settings immediately upon completion. I may eventually flash lights to silence the sound (e.g., when kids are sleeping) or show the doorbell video on my TV, but that is for a later time.

Is the best setup here to wire something like an Arduino WiFi into the doorbell circuit using an analog GPIO to detect the doorbell press and then call the OpenHAB REST API to trigger the downstream automation actions? Would RS232 communication be preferred or is there even a better device than an Arduino to make this easier?

Thanks again for your suggestions!

Hi,
after reading this topic (and being a bit disappointed in the not-opening of the ring api), I cam across the following:

Has anyone tried this? (or how should I try this in openhab2.3?)

Greetz
Hans

By the name it seems to be an OH2 binding. Just drop the .jar in the add-ons folder. How the things a discovered needs to be investigated in the binding documentation (if it exists).

yeahā€¦ thatā€™s my problem :smiley:
there is no jar file

I managed to get it compiled (with a few errors but they all looked benign from my somewhat untrained eyes), but I donā€™t think itā€™s working :frowning: . In PaperUI it just says ā€œStatus: OFFLINE - COMMUNICATION_ERROR Invalid credentials.ā€ on the Account thing even though the info is correct and in the log I just get the following. If you want to try it yourself, hereā€™s the jar file I compiled: jar file. It also seems to show up as ā€œAlarmClock Bindingā€ when I do a bundle:list in karaf

2018-09-18 15:32:15.508 [WARN ] [.core.thing.binding.BaseThingHandler] - BaseThingHandler.initialize() will be removed soon, ThingStatus can be set manually via updateStatus(ThingStatus.ONLINE)
2018-09-18 15:32:15.510 [INFO ] [hab.binding.ring.internal.RestClient] - Creating Ring client for API version 9 on endPoint https://api.ring.com
2018-09-18 15:34:15.685 [DEBUG] [ing.ring.handler.AbstractRingHandler] - Exception occurred during execution: null
java.lang.NullPointerException: null
	at org.openhab.binding.ring.internal.data.DataFactory.getDevicesParams(DataFactory.java:48) [322:org.openhab.binding.ring:2.4.0.201809182217]
	at org.openhab.binding.ring.internal.RestClient.getRingDevices(RestClient.java:254) [322:org.openhab.binding.ring:2.4.0.201809182217]
	at org.openhab.binding.ring.handler.AccountHandler.minuteTick(AccountHandler.java:184) [322:org.openhab.binding.ring:2.4.0.201809182217]
	at org.openhab.binding.ring.handler.AbstractRingHandler$1.run(AbstractRingHandler.java:73) [322:org.openhab.binding.ring:2.4.0.201809182217]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]

I actually got it working! jar file.

I had to re-work the authentication routines but it seems to work fine. I got last event and URL to the last recording as soon as I was able to detect the doorbell. I donā€™t know yet whether events work and I donā€™t have any other ring hardware so I canā€™t test any of that. Feel free to give it a go yourselves :slight_smile:

I need to work on cleaning my hackery next week and then iā€™ll put it up on github.

4 Likes

I updated it a bit because the previous version I posted only seemed to stay online for two-ish hours due to the token expiring. The link in my last post now points to the new version. I also added in a refresh interval property for the Things, defaulted at 5 seconds to poll from ring.com. It seems to work just fine in my eclipse environment running for hours, although it seems to be less responsive on my actual OH instance. Iā€™m thinking it might be environmental though. As promised, Iā€™ve also put up my fork on github here. Itā€™s my first attempt at a binding, so it may not be the prettiest but it works (I think) :grin:

1 Like

Looks great :slight_smile:
Now going to test it

Hei

Im having some troubels to install this binding, maybe you could give me a hint :wink:

what i have done:

  1. Download the zip folder from github
  2. Extracted the zip to a normal folder
  3. Copied the folder to openHAB-share\openhab2-addons
    Nothing is happening. What schould i do, and what have i done wrong?

Peter

You need to grab the .jar file from my first post (jar file.) and put that alone into your addons folder. The github link is for the source code only

then its seems to be added to Openhab :slight_smile:

I dont know if its possible, but what I had i my mind, is that the latest ā€œRingā€ could be shown as a player in HABpanel? do you have any idea if that would work. When i try to access the url for recorded videos, nothing is happening?

You should be able to do that, since itā€™s a link to a video file but iā€™m not sure exactly how in habpanel. I have noticed that the URL seems to take a few minutes to become ā€œvalidā€ since the event occurred before it will work, maybe thatā€™s what youā€™re experiencing? If you put it in a browser, what happens? Iā€™m guessing thereā€™s an internal timeout on the doorbell plus they may have some processing time on the server end before itā€™s viewable. Iā€™ve noticed a similar delay in the official app too for missed events.

Hi @zolakk
Thanks for your work on this.
Do you maybe have an example or overview on how you can configure the things via text file instead of doing it via Paperui?

I donā€™t sorry. I donā€™t set up my things that way, but I canā€™t imagine it would be much different from setting them up for any other binding.

Hiā€¦

Thanks for your help, and im hoping that you would like to continue helping me, im still having issuesā€¦

Im reciving the link but if im copy the link into my browser, nothing is happening :frowning:

I think there must be something on their end :frowning:. I just tried to step through it in Eclipse and all the API calls that previously worked are now all returning ā€œinvalid requestā€ from the ring.com side. It will probably be a while before I can sort this out, unfortunately

Looks like the endpoints might have changed. Itā€™s hard to write a binding that has dependencies on reverse engineered RINGā€™s API endpoint. Iā€™m getting a ring doorbell and Iā€™ll start hacking on it soon.