Ring: Support for other Products

Created on 22 May 2019  ·  25Comments  ·  Source: dgreif/ring

Anyway you can add support for doorbell button, doorbell motion sensor, floodlight light, floodlight motion sensor, floodlight siren, and etc?

Most helpful comment

@d0n4v4nb3ck3r thanks for your patience while I got everything added. The latest version supports snapshots from the cameras as well, but no live streaming video.

@ifeign Sorry to hear it seems more delayed. I have the default polling set to 5 seconds, which seems to be the same as the plugin you linked. Not sure what else would be causing additional delays as our implementations are very similar. If you don't mind spewing http requests like crazy, you can set your polling delay lower, like cameraDingsPollingSeconds: 1. Hope that helps!

All 25 comments

I added support for the new Ring Smart Lighting products in v2.0.0 this week, but do not currently have support for the cameras. https://github.com/homespun/homebridge-platform-ring-video-doorbell#readme already has the cameras implemented for button presses and motion (but no video support). I'm strongly considering pulling in those camera functions as well, but it's a pretty big task since they have a completely different API setup compared to the alarm and lighting. Have you tried that other camera plugin yet? If so, what issues did you have with it?

I’ve tried that other plugin and have never been able to get it to work well. I’ll throw more cash your way (sent a donation yesterday) if I can get the RVD and Spotlight cams in your plugin (which is my fav plugin, btw!)

On May 22, 2019, at 9:14 AM, Dusty Greif notifications@github.com wrote:

I added support for the new Ring Smart Lighting products in v2.0.0 this week, but do not currently have support for the cameras. https://github.com/homespun/homebridge-platform-ring-video-doorbell#readme already has the cameras implemented for button presses and motion (but no video support). I'm strongly considering pulling in those camera functions as well, but it's a pretty big task since they have a completely different API setup compared to the alarm and lighting. Have you tried that other camera plugin yet? If so, what issues did you have with it?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@jamesg311 the donations are much appreciated! I enjoy working on this plugin for my own use, but it feels awesome when the community embraces it like you have ❤️. I think the biggest hurtle with the cameras is that they don't support any obvious real-time api (at least not from the web app). Other npm modules that interact with ring all seem to use polling to request event (~ every 5 seconds), which is not an ideal setup. @codahq any chance you can use your magic powers to see if the apps have some sort of long polling set up to get events whenever they occur?

I added support for the new Ring Smart Lighting products in v2.0.0 this week, but do not currently have support for the cameras. https://github.com/homespun/homebridge-platform-ring-video-doorbell#readme already has the cameras implemented for button presses and motion (but no video support). I'm strongly considering pulling in those camera functions as well, but it's a pretty big task since they have a completely different API setup compared to the alarm and lighting. Have you tried that other camera plugin yet? If so, what issues did you have with it?

I have used that plugin, but the notifications aren't always there for when motion is detected, I also wouldn't mind if I could alarm the siren on my floodlight camera from HomeKit so that I don't have to go into the ring app. easier access. I don't know if that is possible but would be nice.

I have installed your plugin but just got my smart light bridge today, so I will be setting it all up soon and see how your plugin works with it.

@codahq any chance you can use your magic powers to see if the apps have some sort of long polling set up to get events whenever they occur?

I don't see them polling. I'm pretty sure none of their apps (web, win10, or smart phone) poll. I actually asked about this in the other issue but I guess this question answers my question. In somebody's library, I thought it was yours, I saw somebody subscribe to notifications for the cameras. I think there is a subscribe API where you pass a URL for POST callbacks. Figuring it out for my library is on the top of my todo list. I'll let you know if I end up going after it.

Actually, maybe the way I saw it was installing the Windows 10 app. That's also pretty easy to MITM. If you feel like taking a look yourself I would try that out. Actually, the more I think about it that is where I saw it. What I think I found there was that the Windows 10 app passed what looked like a postback URL to the Windows app notification service. I don't know if that subscribe end point works with other postback URLs or not. I will try it eventually when I get some spare time. I need to set up a server that can accept a POST first.

Ahh, I missed your edit to your message in the other issue. The callback url is news to me, I haven’t seen that in any other libraries yet. I know the npm doorbot and ring-api libraries both use polling so I assumed that was the only known approach so far. I’ll check out the windows 10 app when I get a chance. Thanks the great info! Let me know if you make any breakthroughs on your end.

@davglass said he would hand over his API to you
doorbot

I'd prefer to start from scratch using doorbot and ring-api repos as a reference. Neither of them are typescript, and both use older api endpoints. The biggest hurtle is figuring out how to register for events without using polling. Hopefully some day ring will do everything via websockets (alarm and lights already are).

@codahq I've been silently working on camera integration for the last few weeks and am making really good progress. I did set up a MITM for the windows 10 app and was able to track down the postback url for windows app notifications. I tried setting up a local http server and handing them an accessible URL to hit, but did not receive any notifications. Unfortunately I think they check URL and restrict them to a whitelist of origins they expect for their apps. See https://github.com/tchellomello/python-ring-doorbell/issues/111 for related discussion on the python ring library. With the webhook approach off the table, I am going to resort to polling for now 😞

I was hoping to get your help on a separate issue. Ring recently added a snapshots endpoint which can be used to grab a still image for each camera. I'm able to fetch images just fine, but am having trouble telling Ring to capture fresh images. If you take a look at https://github.com/tchellomello/python-ring-doorbell/blob/7ab56fcd7d0b600c4fb5f3e25e4eef974bd71d2d/ring_doorbell/doorbot.py#L375-L386 you can see how they python library is interacting with the endpoint. It looks like a POST to clients_api/snapshots/timestamps with a json body of { "doorbot_ids": [12345677] } should request a new snapshot for that doorbot, but I get a 400 response with Incorrect JSON in body when I try to hit that endpoint. Would you mind checking how the android app hits that endpoint? It should make the request as soon as you open the app (it requests fresh snapshots to update the camera views on the app dashboard). The windows 10 app and web app don't use this endpoint yet or I would track it down myself. Thanks in advance, I really appreciate all your help!

Cameras have arrived! @d0n4v4nb3ck3r I think I have implemented everything you originally asked for. Still working on video streaming, but everything else seems to be working well. One note - motion alerts and ring alerts need to be turned on in the Ring app if you want to see valid info for each in HomeKit. Unfortunately I am relying on polling right now to get the events, but polling intervals are configurable if you don't like the defaults. Let me know how it works for you!

i just upgraded the plugin. what else do i need to do for access/setup?

@jamesg311 it should add the cameras automatically after updating and restarting homebridge. They will show up as 3 separate devices: a motion sensor, a light (if applicable), and a siren (if applicable). I'll be working to add live stream support, but it could take some time. Let me know if you continue to have issues with what's in there now.

I’ve upgraded to the newest version 3.0 but don’t see the cameras in HomeKit. Is there anything else that I need to do or does any special setting need to be added to the config.json file?

Thanks for all of your work on this!

@codahq I've been silently working on camera integration for the last few weeks and am making really good progress. I did set up a MITM for the windows 10 app and was able to track down the postback url for windows app notifications. I tried setting up a local http server and handing them an accessible URL to hit, but did not receive any notifications. Unfortunately I think they check URL and restrict them to a whitelist of origins they expect for their apps. See tchellomello/python-ring-doorbell#111 for related discussion on the python ring library. With the webhook approach off the table, I am going to resort to polling for now 😞

I was hoping to get your help on a separate issue. Ring recently added a snapshots endpoint which can be used to grab a still image for each camera. I'm able to fetch images just fine, but am having trouble telling Ring to capture fresh images. If you take a look at https://github.com/tchellomello/python-ring-doorbell/blob/7ab56fcd7d0b600c4fb5f3e25e4eef974bd71d2d/ring_doorbell/doorbot.py#L375-L386 you can see how they python library is interacting with the endpoint. It looks like a POST to clients_api/snapshots/timestamps with a json body of { "doorbot_ids": [12345677] } should request a new snapshot for that doorbot, but I get a 400 response with Incorrect JSON in body when I try to hit that endpoint. Would you mind checking how the android app hits that endpoint? It should make the request as soon as you open the app (it requests fresh snapshots to update the camera views on the app dashboard). The windows 10 app and web app don't use this endpoint yet or I would track it down myself. Thanks in advance, I really appreciate all your help!

As you suspected:

POST https://api.ring.com/clients_api/snapshots/timestamps HTTP/1.1
User-Agent: android:com.ringapp:3.14.3(${build_number?})
Hardware_ID: ${uuid_hardware_id}
X-API-LANG: en
Authorization: Bearer ${big_old_token}
accept: application.vnd.api.v11+json
Content-Type: application/json; charset=UTF-8
Content-Length: ${length}
Host: api.ring.com
Connection: Keep-Alive
Accept-Encoding: gzip

Note the additional headers. Some calls care about the headers and some don't. The hardware ID is interestingly longer than what I remember the hardware IDs being. I generated an old android app hardware ID by just making a 16 digit hex. This looks like a UUID.

The payload:

{"doorbot_ids":[${cam_id_1},${cam_id_2}]}

Response is 200 with JSON payload.

@codahq thanks for looking into it for me!! I'll give the different headers a try and see if that fixes it for me. Really appreciate your help 🏆

@cantchooseaname8 see my response to a similar question earlier in the issue: https://github.com/dgreif/ring-alarm/issues/24#issuecomment-502418621 . You should see a motion sensor for each camera, and a light/siren if the camera is equipped with them. Live feeds from the camera will still need a fair amount of work but I think it's possible. Please let me know if you are at least seeing the motion sensor for cameras

Though this guy on Reddit is being deliberately vague, he claims to have figured out live video:
https://reddit.com/r/homeassistant/comments/apansc/ring_doorbell_integration_direct_rtsp_live_feed/

Thank you so much for your work on this. As soon as I get back home I'll give your plugin a try. Does this work if I simply have a doorbell and not the entire security system?

@ifeign thanks for the link. That guy definitely seems a little out there...not sure if I believe he actually figured it out. I've been reading through https://github.com/tchellomello/python-ring-doorbell/issues/23 and https://web.archive.org/web/20180403003637/http://www.kidder.io/2017/07/04/ring-doorbell-api/ which have some really good info on how to get an initial connection set up. I think I'm going to focus on at least getting snapshots to work for now so that you get an updated image when your doorbell rings or there is motion. I don't have a ton of SIP specific experience, but I work with WebRTC every day and I'm not shy around these protocols.

For your second question, you can absolutely use this plugin with just a camera. The original focus was on the alarm, but I have expanded the api and plugin to handle all current products from Ring. If you run into any issue, please let me know.

Wonderful, thanks again for your work on this. I've given up on official
Homekit from Ring to ever materialize. It appears that the Ring Home
Assistant component got snapshots working, not sure if that's any help to
you.

On Tue, Jun 18, 2019 at 4:04 PM Dusty Greif notifications@github.com
wrote:

@ifeign https://github.com/ifeign thanks for the link. That guy
definitely seems a little out there...not sure if I believe he actually
figured it out. I've been reading through
tchellomello/python-ring-doorbell#23
https://github.com/tchellomello/python-ring-doorbell/issues/23 and
https://web.archive.org/web/20180403003637/http://www.kidder.io/2017/07/04/ring-doorbell-api/
which have some really good info on how to get an initial connection set
up. I think I'm going to focus on at least getting snapshots to work for
now so that you get an updated image when your doorbell rings or there is
motion. I don't have a ton of SIP specific experience, but I work with
WebRTC every day and I'm not shy around these protocols.

For your second question, you can absolutely use this plugin with just a
camera. The original focus was on the alarm, but I have expanded the api
and plugin to handle all current products from Ring. If you run into any
issue, please let me know.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/dgreif/ring-alarm/issues/24?email_source=notifications&email_token=AHWLHYFYCHYT6WU6NAKERCDP3FEUVA5CNFSM4HOVKRMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX76WJA#issuecomment-503311140,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHWLHYD37AW4YBRGS5BZFG3P3FEUVANCNFSM4HOVKRMA
.

@dgreif I got it working now. Thank you!

@dgreif How do I get the location ID so I can only have one location in HomeKit? Thanks!

Edit: Nevermind. I found the suggestion from another thread and used a web inspector. That was easy enough and it works great with the location IDs!

@cantchooseaname8 you should see a log like Configuring ${cameras.length} cameras and ${devices.length} devices for locationId ${location.locationId} in your homebridge output when you start it. If you only have one location, you can completely remove the locationIds option from your homebridge config.

Cameras have arrived! @d0n4v4nb3ck3r I think I have implemented everything you originally asked for. Still working on video streaming, but everything else seems to be working well. One note - motion alerts and ring alerts need to be turned on in the Ring app if you want to see valid info for each in HomeKit. Unfortunately I am relying on polling right now to get the events, but polling intervals are configurable if you don't like the defaults. Let me know how it works for you!

Thanks so much!

I noticed there's quite a delay in motion detection with the Doorbell 2. I'm assuming this is due to how you use polling. The plugin I used to use had a near-instal motion detection working. I'm no programmer or I'd say something more helpful than "check out this plugin," lol, but check it out. https://github.com/homespun/homebridge-platform-ring-video-doorbell

Secondly, I'm getting two alerts from Homekit every time motion is detected

I am closing this, since you have implemented what I asked and since you opened a second issue for Camera Preview!! Thanks!

@d0n4v4nb3ck3r thanks for your patience while I got everything added. The latest version supports snapshots from the cameras as well, but no live streaming video.

@ifeign Sorry to hear it seems more delayed. I have the default polling set to 5 seconds, which seems to be the same as the plugin you linked. Not sure what else would be causing additional delays as our implementations are very similar. If you don't mind spewing http requests like crazy, you can set your polling delay lower, like cameraDingsPollingSeconds: 1. Hope that helps!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

parchmaf picture parchmaf  ·  3Comments

donavanbecker picture donavanbecker  ·  7Comments

Lui5Jacint0 picture Lui5Jacint0  ·  3Comments

LordZork picture LordZork  ·  5Comments

jchristianj picture jchristianj  ·  4Comments