Ring doorbell

any update here - just got one :wink:

@zolakk
fyi: I installed a doorbell 2 and the binding works like charme.

The only thing, which is missing is the battery level. Is that accessible by the API? This is an important information to monitor the battery level and inform the user to do a re-charge (e.g. sending a WhatsApp)

I saw a json propery battery_life": ā€œ93ā€, so the info should be available through the api.

@zolakk I forked your build and added a new channel to the doorbell (I donā€™t know the other Ring devices, if they are also battery driven this could be adapted)

@lindberg @tnemrap
If you want to give it a try: https://github.com/markus7017/openhab2-addons-ring/blob/master/target/org.openhab.binding.ring-2.4.0-SNAPSHOT.jar

My fork could be found here: https://github.com/markus7017/openhab2-addons-ring
A pull request has already been created

3 Likes

Iā€™m trying your .jar Markus, but it doesnā€™t seem to get installed.

The only message in the log is:
2018-12-31 12:00:35.183 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing ā€˜openhab-binding-ringā€™: Error restarting bundles:
Could not resolve module: org.openhab.binding.amazonechocontrol [277]

That was caused by installing both the echocontrol binding from the addons folder and the paperui. After I fixed that there is no more mention of the ring binding. But itā€™s not in the bundles list in the console neither in the paperui.

you need to

  • download the jar and copy it to the addins folder
  • to avoid caching problems: stop OH, clear cache, start OH
  • wait until OH is fully initialized
  • open the OH console and run ā€žbundle:list | grep Rungā€œ to check that the binding is installed and Active

Open PaperUI to create things and items

  • you need to manually add a Ring Account thing and set you credentials
  • link the event channels to items
  • after a while you should see a new door bell thing in the inbox, accept and create channel(s)

@markus7017 Thanks for the addition, I have been very busy since I last updated this thread and havenā€™t had the time to look at the binding more unfortunately but I did merge your pull request

Hi Markus,

Thanks for the steps, but it went wrong in using wget to get the file. I downloaded the html page :frowning:
To wget the correct file add raw=true:
https://github.com/markus7017/openhab2-addons-ring/blob/master/target/org.openhab.binding.ring-2.4.0-SNAPSHOT.jar?raw=true

But with the right file I am able to add the account and discover the doorbell thing. And they seem to be online in the PaperUI. But Iā€™m not getting events from ringing the doorbell. And in the events.log i get this:
2019-01-01 11:46:19.242 [hingStatusInfoChangedEvent] - 'ring:account:803d3c49' changed from OFFLINE (COMMUNICATION_ERROR): Invalid response from ring.com. to OFFLINE (CONFIGURATION_PENDING): Retrieving device list 2019-01-01 11:46:19.547 [hingStatusInfoChangedEvent] - 'ring:account:803d3c49' changed from OFFLINE (CONFIGURATION_PENDING): Retrieving device list to OFFLINE (COMMUNICATION_ERROR): Invalid response from ring.com. 2019-01-01 11:46:23.855 [hingStatusInfoChangedEvent] - 'ring:account:803d3c49' changed from OFFLINE (COMMUNICATION_ERROR): Invalid response from ring.com. to ONLINE 2019-01-01 11:46:29.173 [hingStatusInfoChangedEvent] - 'ring:account:803d3c49' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Invalid response from ring.com.
Does this has to do with the api change?

you donā€˜t need a wget, clicking the browser link should work by itself (at least with my browsers)

I canā€˜t say anything about the api issues, maybe @zolakk could help.

In which country are you located? Maybe itā€˜s region specific, because other people reported similar issues (see above). Iā€˜m located in Germany and works fine.

I needed to download it in a terminal, since I run OpenHAB on a Linux machine without a desktop or shares configured, so I used wget.

Iā€™m from the Netherlands, so I guess it isnā€™t a region issue :wink:

Thatā€™s the same issue I was having before and deleting the account thing and re-doing it seems to have fixed the issue for me. I think itā€™s some weird way itā€™s handling the login and caching the token but I havenā€™t been able to trace it down unfortunately.

I have had the Ring Pro doorbell and some of the Floodlights for some time now so I was very interested to try out this binding. Thank you to the binding author and all those involved thus far. The install went very smoothly on a linux 18.04 server as outlined above. I was very excited to see openhab logging the full api urls for captured video motion events.

Two Issues I am seeing:

  1. I am seeing the Ring Doorbell Item but no separate items for the Floodlights
  • From the event logs - all motion events are logged under same item so there is no way to differentiate motion from one sensor to the next
  1. Seeing a significant delay in motion activity and log event
  • I currently use IFTTT but this new binding has been consistently slower (1-3 minutes on average)

did you tried

  • a different hardware id in the thing config
  • re-create your account?
    1. I am seeing the Ring Doorbell Item but no separate items for the Floodlights
      Are the floodlights directly controlled by the doorbell?
      Could yoi suplply a TRACE log so we csn see the api json?
  • motion events: the events are returned on the account level, maybe it makes sense to include an id prefix or report them also on the specific thing - @zolakk?
  • delay: te binding is polling every x sec for events. did you checked your thing config? Lowest setting are 5sec
    in addition I have a change ready, which decouples the event poll and tge token refresh - there is no need for a token refresh every x sec, which reduces cloud api calls, but I wouldnā€˜t expect that this relates to event notificatin delays.
  • iftt: maybe iftt has a higher prio on their side, but 1-3min sounds strange

The weird thing is that there are already channels defined on the account thing for event source ID and description, but I have no idea why they arenā€™t getting exposed outside of the binding. It would make sense to probably move those channels to the specific thing but that will take a decent amount of refactoring to do that I think though. If you want to send a pull request with the separating of the event poll and token refresh that would be good too. That was truly a very quick and dirty workaround to getting it to work long term, so thanks for that.

Edit:
Spoke too soon about those channels. It looks like it was just simply adding the following to the eventGroup channel group type in ESH-INF/thing/channels.xml and now the cooresponding device ID and description are showing in my test bed for the last event shown on the account thing

<channel typeId="doorbotId" id="doorbotId"></channel>
<channel typeId="doorbotDescription" id="doorbotDescription"></channel>

I created a pull request for the event poll/token refresh seperation. Please review and then merge both changes into your repo.

You should remove target/* from the repo (right click on the target folder->Team->Ignore). Those files will be build by running mvn install and shouldnā€™t be in the repo. Usually I only add the jar file to the rep (target/xxxx.jar), so people could download the compiled jar and donā€™t need the complete repo and deal with dev tools.

Whatā€™s the purpose of the hardware id in the thing config? Is that tied to the api key? I think it would make sense to have a default based on the MAC address as default rather than the user to configure the id. Does that make sense? Are there format requirements for the id? Otherwise I could copy a sniplet from my other binding to determine the local MAC address.

Sure, go ahead and create the pull request. Iā€™ll merge it and post a new binary here for anyone who wants to test it. As far as the hardware ID, it looks like itā€™s sent as part of the authentication process to get the profile object. I agree it would be best to have it pre set either by something like MAC or some other more unique identifier, even a random number. Iā€™m not sure if thereā€™s a format requirement but I just tested it with my machineā€™s MAC with dashes instead of colons (ex. AA-BB-CC-DD-EE-FF) and it seems to be working just fine.

As promised, hereā€™s the latest version of the binding with the device ID and description channels exposed on the account thing plus @markus7017ā€™s change to the session token refresh: https://github.com/zolakk/openhab2-addons-ring/raw/master/target/org.openhab.binding.ring-2.5.0-SNAPSHOT.jar?raw=true

Hi,

Does anyone have an example of a rule that they are using?

I am confused by what the two channels do:
Enabled (on=yes, off=no)
Status

As I have 2 things: Account and Doorbell, which should I be monitoring?

Cheers,

Chris

I created a new pull request

  • use MAC address as default for hardwareId if empty in thing config
  • use @component to auto-generate OSGI-INF/*.xml
  • use spaces instead of tabs in ESH-INF/*.xml to suppress mvn build warnings
  • removed target/* from repo (will be used by Eclipse to save build results)