Git Product home page Git Product logo

Comments (22)

dgreif avatar dgreif commented on May 14, 2024 1

@problemss it's taken a lot of debugging and digging through other libraries, but I finally got to the root source of the issue on events not registering. It all has to do with how we are authenticating and setting up a session with Ring. I have most of the fix in place, but need to think through corner cases before I push it up. I've got a busy weekend, but I should have an update out early next week. Thanks for your patience, this was a tough one to track down!

from ring.

problemss avatar problemss commented on May 14, 2024 1

@dgreif that is awesome! Thank you so much! I will be out of town next week for the 4th but am excited to try the fix out when I get back! I also greatly appreciate you spreading the knowledge in the other project as well.

from ring.

dgreif avatar dgreif commented on May 14, 2024 1

@problemss I found some time to work on it this morning and I got all the session stuff finished up. Give v3.4.0 a try!

from ring.

dgreif avatar dgreif commented on May 14, 2024 1

@problemss you have it right. All you need to do is update the homebridge-ring-alarm npm module and restart homebridge

from ring.

johnsonjoshuaa avatar johnsonjoshuaa commented on May 14, 2024 1

I can also confirm the update fixed my issue with motion events not being captured. Thank you!

from ring.

dgreif avatar dgreif commented on May 14, 2024 1

@problemss @johnsonjoshuaa thank you both for confirming that it's working! I just released another update that should improve motion/ding alert times even more. Give v3.5.1 a try when you get a chance. It looks like Ring automatically captures a snapshot when there is an event, and HomeKit was sometimes requesting it after it was already updated. When this happened, it could take up to 30 seconds before another snapshot would be taken. This delayed the notification from Home by ~10-15 seconds, and then you would see a notification with no snapshot, which got replaced by a notification with a snapshot once a new one was available. Now I am a little smarter about how I compare snapshot timestamps, so if a snapshot was taken within the last 10 seconds before Home requests it, we use it without waiting for a new one. The end result (at least for me) is that motion alerts are delivered within ~3 seconds of when they occur, with snapshot in tow every time.

from ring.

dgreif avatar dgreif commented on May 14, 2024

The Ring api for getting new events is definitely less than ideal. If you have any other setups that are polling for events, you will definitely run into conflicts. That means if you have anything using the python library or another homebridge plugin like homebridge-platform-ring-video-doorbell, they will be competing to grab the events from Ring. It's hard to track down these issues, so you just have to know what else you have set up. Another thing you can do is pass cameraDingsPollingSeconds: 1, which will poll for events every second instead of the 5 second default. Let me know if you figure out what is causing your issues as it may help others down the road.

from ring.

problemss avatar problemss commented on May 14, 2024

I will disable the other ring python library I have setup and see if that does it.

from ring.

divemasterjm avatar divemasterjm commented on May 14, 2024

Happens de same to me, no other ring library but sensor doesn’t fire up, I receive notifications from ring app but no from plugin sensor

from ring.

problemss avatar problemss commented on May 14, 2024

I disabled and set to 1 second. Still not triggering. Is there any debugging I can turn on to look into it?

from ring.

dgreif avatar dgreif commented on May 14, 2024

There isn't currently any debug flags that you can turn on to see additional details, but that's something I could add. This particular issue is very hard to track down because the Ring api is very fragile. If one other client is grabbing events, you will lose the ability so see them. I'm going to look into auth sessions a little more and see if I can make it less fragile, but I can't make any promises. If you really want to debug it locally, you can add a console.log('active dings', activeDings) in node_modules/homebridge-ring-alarm/api/api.js after the line that has poolForActiveDings$.next();. This will log the array of dings fetched from the api every poll. My guess is that you will see [] every time, even when there is an event, which means the API is being pinged somewhere else and the events are being cleared before you get a chance to see them. I'll let you know if I come up with any other ideas

from ring.

divemasterjm avatar divemasterjm commented on May 14, 2024

Just for your info, there is a plug-in in homeassistant who works perfectly with.

from ring.

dgreif avatar dgreif commented on May 14, 2024

@divemasterjm do you have the homeassistant plugin running at the same time as the homebridge plugin? If so, that might be what's conflicting. Try turning that off and running just homebridge.

from ring.

problemss avatar problemss commented on May 14, 2024

@dgreif So i had to put the console login under if (!activeDings || !activeDings.length) { and under activeDings.forEach(activeDing => { or else the module would become unresponsive. After putting those logs in place. Only the one under !activeDings is being called, the other log never gets called, confirming your assumption that it is always empty []. I am going to try a few more things now that I have your code open and let you know if I figure anything out.

I also turned off my IFTTT triggers just in case.

from ring.

problemss avatar problemss commented on May 14, 2024

So I am in the fetchActiveDings() function

I am trying to print out the URL it is using but I am just getting this

https://api.ring.com/clients_api/dings/active?burst=false

I assume the clients_api will get replaced when the URL is actually called? Is there a way I can get the full URL so I can call it manually?

from ring.

dgreif avatar dgreif commented on May 14, 2024

@problemss that actually is the full url. Should be able to do a GET to that endpoint. Also need to include the Authorization header and I think you need 'user-agent': 'android:com.ringapp:2.0.67(423)' from previous testing, but that one might be optional.

from ring.

odenisenko-zz avatar odenisenko-zz commented on May 14, 2024

guys. unfortunately for getting motion event we should create a session and use it.
without session no motion alert at all.

PS: dings/active?api_version=9&auth_token=zzbGBjWFcvCZKArwFQfH.

from ring.

dgreif avatar dgreif commented on May 14, 2024

@odenisenko as long as we include the hardware_id header from the session motion events work great. We don’t have to include the session auth_token, oauth authorization header is a better approach for authentication. Are you experiencing something different?

from ring.

problemss avatar problemss commented on May 14, 2024

@dgreif I am excited to try it out when I get home. I feel stupid for asking, but I assume it is just npm update home bridge-ring-alarm correct or so I have to manually replace it?

from ring.

problemss avatar problemss commented on May 14, 2024

@dgreif works like a charm!!!! Thank you!!

from ring.

johnsonjoshuaa avatar johnsonjoshuaa commented on May 14, 2024

@dgreif Thank you for the update. I installed it and I did notice the screenshots, and notifications where much quicker. The screenshots are also usable now. I noticed prior to the update the screenshot would be delayed and not always catch what triggered the motion. After the update the 7 motion events I have triggered on all 3 devices have resulted in a usable screenshot. So from my perspective everything works great!

from ring.

dgreif avatar dgreif commented on May 14, 2024

@johnsonjoshuaa I appreciate the feedback and testing. Glad to hear it's working well! 🎉

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.