Giter Club home page Giter Club logo

Comments (25)

dgreif avatar dgreif commented on May 24, 2024 3

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!

from ring.

dgreif avatar dgreif commented on May 24, 2024 3

@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!

from ring.

dgreif avatar dgreif commented on May 24, 2024 1

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?

from ring.

dgreif avatar dgreif commented on May 24, 2024 1

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).

from ring.

dgreif avatar dgreif commented on May 24, 2024 1

@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 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.

from ring.

wondergit113 avatar wondergit113 commented on May 24, 2024

from ring.

dgreif avatar dgreif commented on May 24, 2024

@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?

from ring.

donavanbecker avatar donavanbecker commented on May 24, 2024

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.

from ring.

codahq avatar codahq commented on May 24, 2024

@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.

from ring.

dgreif avatar dgreif commented on May 24, 2024

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.

from ring.

donavanbecker avatar donavanbecker commented on May 24, 2024

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

from ring.

dgreif avatar dgreif commented on May 24, 2024

@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!

from ring.

wondergit113 avatar wondergit113 commented on May 24, 2024

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

from ring.

dgreif avatar dgreif commented on May 24, 2024

@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.

from ring.

cantchooseaname8 avatar cantchooseaname8 commented on May 24, 2024

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!

from ring.

codahq avatar codahq commented on May 24, 2024

@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.

from ring.

dgreif avatar dgreif commented on May 24, 2024

@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: #24 (comment) . 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

from ring.

ifeign avatar ifeign commented on May 24, 2024

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?

from ring.

ifeign avatar ifeign commented on May 24, 2024

from ring.

cantchooseaname8 avatar cantchooseaname8 commented on May 24, 2024

@dgreif I got it working now. Thank you!

from ring.

cantchooseaname8 avatar cantchooseaname8 commented on May 24, 2024

@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!

from ring.

dgreif avatar dgreif commented on May 24, 2024

@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.

from ring.

donavanbecker avatar donavanbecker commented on May 24, 2024

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!

from ring.

ifeign avatar ifeign commented on May 24, 2024

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

from ring.

donavanbecker avatar donavanbecker commented on May 24, 2024

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

from ring.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.