ring icon indicating copy to clipboard operation
ring copied to clipboard

Motion/Ding Notification Issues

Open jchristianj opened this issue 2 years ago • 11 comments

Bug Report

Describe the Bug

Since 11.0.0 (or even before, I came from 9.24.0) both motion sensors (for Ring Pro and Ring2) do no longer trigger and remain in no-motion status in homekit although there is motion. Motion based automations do not trigger.

To Reproduce

Happens since Plugin 11.0.0

Expected behavior

Should trigger as before

Screenshots/Logs

With old Plugin (If I remember correctly 9.24.0) there are multiple log entries, e.g.: [08/05/2022, 16:45:12] [homebridge-ring] Ring Detected Motion

With latest version there is no log entry for any motion.

Homebridge Ring Config

{ "refreshToken": "secret_token", "_bridge": { "username": "AB:CD:EF:GH:IJ:KL", "port": 42621 }, "platform": "Ring" }

Environment

  • Raspbian GNU/Linux Buster (10)
  • Node.js: 16.13.1
  • NPM: 8.1.2
  • homebridge-ring: 11.0.0

jchristianj avatar May 11 '22 05:05 jchristianj

Just to reconfirm: Went back to 9.24.0 and all is fine. Log shows motion events, and all triggers in homekit as it should.

jchristianj avatar May 11 '22 06:05 jchristianj

By any chance do you not have a Ring Protect subscription? Also, the v11 plugin uses push notifications so if you are using features like Smart Alerts to restrict the notifications you receive in the Ring app it will also keep those notifications from being received by the plugin. Prior versions used an older, polling based interface and would receive motion notifications regardless of Smart Alert settings.

tsightler avatar May 11 '22 23:05 tsightler

Yes, I have a ring subscription. And you're right, I am using smart alerts, but they shall only be recorded, I don't want to be notified in the Ring App. My settings are like this:

IMG_0328

I only want to use the Ring's motion sensors for Homekit automations when people are detected, and don't wanna be notified at all in case of motion.

Is there a way to get back this functionality in v11?

jchristianj avatar May 12 '22 05:05 jchristianj

I don't know if this issue is really a bug but rather expected functionality, but I'm going to throw my hat in on the changes leading to it.

I'm holding off on updating (using the downstream project ring-mqtt, hey @tsightler) as the requirement for push notifications to be enabled in the Ring app completely breaks how I use the motion events from the API. I probably have 5 or 6 different scenarios of how alerts are configured for various cameras, for no alerts ever, to alerts at all time, to multiple motion schedules and/or smart alert configurations, however with the old polling method I could get motion events from all of them regardless of whether there were alerts turned on.

It was actually the ones that had alerts turned off entirely I used the motion events from the API the most from, using cameras in my garage as generic motion sensors for automating lights etc, and I really don't want my phone buzzing every time those get activated. I could turn off the OS level notifications for those cameras, but I have some devices with the ring app running older OSs that don't have that functionality (category level notification control,) and there still isn't a way to handle "discretionary" alerts like the smart alerts or motions schedules where I want some but not all notifications but want all the motion events through the API.

I appreciate the elegance and technical benefits in enabling events from push notifications, but it does result in a significant loss of functionality for those that have built systems around the previous functionality. My preference would be to make this an option where you can enable the push notification based system for maximum responsiveness or use the old (slower and less reliable) polling system but get all events instead of just those that also make your phone buzz. Whether that gets implemented or not, thank you to for the maintainers and contributors for all the work building and maintaining this useful API 😄

ogremustcrush avatar May 12 '22 15:05 ogremustcrush

I pointed out this change during v10-beta in the hope of having both available as I was very concerned about the loss of functionality for ring-mqtt users. I also make significant use of smart alerts, so it was quite impacting even for me personally, although I was mostly able to work around it without too much trouble.

However, there are significant functionality benefits to push notifications with regards to battery cameras and removal of the always troublesome polling interface and, as a maintainer, I can fully understand why keeping two approaches would not be ideal. While options are great for users, they are pretty much just additional effort for maintainers and most of us already have limited time to maintain these projects at all.

The reality, from my perspective, is that I will use whatever @dgreif is willing to maintain. I expected to hear some negative feedback around this change from ring-mqtt users, and I've considered the possibility of implementing polling within ring-mqtt itself in the future (there's no reason it has to be in ring-client-api) based on how strong the demand turns out to be, although, realistically, most ring-mqtt users are also Home Assistant users and can just use the native Ring integration if they just want polling.

tsightler avatar May 12 '22 16:05 tsightler

So just speaking for my configuration I found a good and working solution:

You need to enable the required notification in the Ring App Smart Alert settings. Turn on alerts for person only or for movement or both. This will trigger the motion detection in the Homebridge Ring plugin. As soon as it is enabled, the homebridge log shows motion events and the motion detector in Homekit will be triggered and can be used for automations.

To avoid that the iPhone will notify on any motion event, it is NOT necessary to disable the notifications on iOS level; just go into the camera setting (Ring App, devices, chose device) and disable the general motion notification slider button (above the live-view button). For me this brings back functionality as before.

jchristianj avatar May 12 '22 17:05 jchristianj

most ring-mqtt users are also Home Assistant users and can just use the native Ring integration if they just want polling.

Oof, nobody should do that, I would think if anyone would you would appreciate just how much better your/dgreifs implementation is than the native HA one. I guess if you were doing it for just motion sensors, but even that would probably make everything less reliable as the native integration seemed to trigger rate-limits all the time if you have more than a couple cameras.

To avoid that the iPhone will notify on any motion event, it is NOT necessary to disable the notifications on iOS level; just go into the camera setting (Ring App, devices, chose device) and disable the general motion notification slider button (above the live-view button).

Interesting, I haven't played with this actual implementation yet, is that slider handled client-side so the device (and therefore the API) still gets a push notification but simply doesn't handle it making the phone notify? Wonder if the motion schedules do the same thing, since they also toggle that slider in the app. Still unfortunate to have to lose smart alert settings and not be able to filter some of those notifications to the phone, but it's at least a smaller loss since the smart alerts don't really work that well anyway, get lots of person alerts for cats, spiders, and drops of water.

ogremustcrush avatar May 12 '22 17:05 ogremustcrush

Oof, nobody should do that, I would think if anyone would you would appreciate just how much better your/dgreifs implementation is than the native HA one. I guess if you were doing it for just motion sensors, but even that would probably make everything less reliable as the native integration seemed to trigger rate-limits all the time if you have more than a couple cameras.

Yeah, that's what I mean, just use the native HA integration for motion sensors/dings. I mean, it just uses the same polling interface, there's nothing really special about it, although I do think it polls separately per-camera, while ring-client-api polled once for all cameras. Over the last few months I've learned quite a bit more Python so I keep thinking I should move at least some of these enhacenments to the native integration, as I believe it is without a maintainer, but there's no way I'm going to actually have time for that!

I mostly worked around the new behavior with the same methods mentioned above, so I'm hoping most ring-mqtt will be OK with it. We'll see I guess.

tsightler avatar May 12 '22 17:05 tsightler

Yeah, that's what I mean, just use the native HA integration for motion sensors/dings.

Unfortunately there's no way to configure HA to just get the motion/dings anymore, it create entities for and polls for everything the integration supports. You can of course not use them or disable them, but if it is causing rate-limits to trip due to the way it polls, it's potentially going to affect ring-client-api/ring-mqtt running on same account/IP as well. You can't even configure the polling frequency anymore, it all got deprecated/removed when they went to UI configuration only. I was getting rate-limit timeouts with the HA integration back when I only had like 5 cameras, now I have 13 + all the stuff tied into the alarm system so it's pretty much unusable. When I dropped the native integration and switched exclusively to ring-mqtt once it added enhanced camera support (previously used HA for cameras and ring-mqtt for alarm) I found the whole experience was much more robust and reliable. Now that I have more devices I can only imagine how bad the native integration would be.

Anyway, I guess I can try turning off smart alerts and see if that drives me bonkers or not before transitioning to the new code, looked like there was another issue (#934) with push notifications stopping after a few days so not in a huge rush since the old codebase still works for my needs for now.

ogremustcrush avatar May 12 '22 18:05 ogremustcrush

I’ve rolled back to 9.24. The motion sensitive doorbell trigger is where it’s all at for me.

bensuthers-au avatar May 14 '22 02:05 bensuthers-au

I've been experiencing the same issue with dropped notifications with both Homebridge Ring and Scrypted. There was a post in the Scrypted discord yesterday about an update that uses a different implementation of push events that seems to be resolving this issue?

I'm going to switch some cameras to Scrypted and see if it's any better. Hopefully this can help with the Homebridge plug-in.

jordanmerrick avatar Aug 27 '22 19:08 jordanmerrick

I’ve rolled back to 9.24. The motion sensitive doorbell trigger is where it’s all at for me.

Same over here . Automations stopped working after updating , rolled back to 9.24 and everything started working again

grouchystitch avatar Oct 06 '22 10:10 grouchystitch

For anyone having issue here, would you mind trying the latest version? There was an update to the Push Notification dependency that I was hoping would help with this problem, but I can't recreate it to find out for sure

dgreif avatar Oct 06 '22 16:10 dgreif

I also tried the latest version 11.3.0 when it was release but I can try again.

grouchystitch avatar Oct 06 '22 16:10 grouchystitch

@grouchystitch You seem to be saying that automation just stopped working completely immediately after the upgrade, that's not really what this issue is about. This issue is referring to the problem where notifications are initially working, and then stop working randomly at some point. Can you clarify the specific problem you are having?

This issue with push notifications stopping after a while common and known problem with firebase messaging where it can't detect things like and unexpectedly closed socket (for example due to a firewall NAT mapping timeout). The most recent version of push-receiver implements heartbeat pings to keep the connection alive thus hopefully avoiding those types of timeouts, but also making it possible to detect such things are re-establish the connection.

@dgreif Just FYI, about a month ago I built a version of push-receiver that included the heartbeat changes and also had a beta version of ring-mqtt that used a modified version of ring-client-api to use this forked push-receiver package. I've personally only had push notifications stop maybe once or twice, even without the heartbeat feature, but I did have several users that were having consistent problems with lost push notifications, in some cases even just after a few hours, and the push-receiver heartbeat change seem to have solved those problems. I was really happy to see this change make it upstream and appreciative that you've managed to get a new version of ring-client-api that uses it out so quickly. Now I just need to push out a new ring-mqtt version, hopefully in the next few days. Just wanted to say thanks!

tsightler avatar Oct 06 '22 17:10 tsightler

Thanks for the info @tsightler! Good to know your users have seen improvements with the heartbeat change. I am hoping it will resolve this issue for homebridge as well, but it really comes down to waiting to hear back on this thread. I may add one more change that hides the HEARTBEAT logging, but otherwise I'm hoping this is just resolved now.

dgreif avatar Oct 06 '22 17:10 dgreif

Hi, just following up on the first response here which asked… By any chance do you not have a Ring Protect subscription? Can someone enlighten me why having a Ring Protect subscription is needed here? I am looking to receive standard motion or doorbell alerts but these are now very inconsistent Setup is currently a node js app based on the example in this git repo to action based on motion. Thanks in advance.

syeltuor avatar Oct 09 '22 21:10 syeltuor

A Ring Protect plan is not required but, if you have one, some of the additional features, like Smart Alerts, might impact the behavior of notifications. Basically, if you use any features that suppress notifications to the Ring app, it can also impact notifications to ring-client-api.

tsightler avatar Oct 09 '22 21:10 tsightler

@grouchystitch You seem to be saying that automation just stopped working completely immediately after the upgrade, that's not really what this issue is about. This issue is referring to the problem where notifications are initially working, and then stop working randomly at some point. Can you clarify the specific problem you are having?

This issue with push notifications stopping after a while common and known problem with firebase messaging where it can't detect things like and unexpectedly closed socket (for example due to a firewall NAT mapping timeout). The most recent version of push-receiver implements heartbeat pings to keep the connection alive thus hopefully avoiding those types of timeouts, but also making it possible to detect such things are re-establish the connection.

@dgreif Just FYI, about a month ago I built a version of push-receiver that included the heartbeat changes and also had a beta version of ring-mqtt that used a modified version of ring-client-api to use this forked push-receiver package. I've personally only had push notifications stop maybe once or twice, even without the heartbeat feature, but I did have several users that were having consistent problems with lost push notifications, in some cases even just after a few hours, and the push-receiver heartbeat change seem to have solved those problems. I was really happy to see this change make it upstream and appreciative that you've managed to get a new version of ring-client-api that uses it out so quickly. Now I just need to push out a new ring-mqtt version, hopefully in the next few days. Just wanted to say thanks!

@tsightler - it was the same thing I was saying or at at least trying to convey. Maybe it was miss understood Anyway now it’s seem to be working after updating to the latest version.

@dgreif - Thank you for the update . It seems like updating the dependencies fixed the issue for me .

grouchystitch avatar Oct 09 '22 23:10 grouchystitch

v11.3.1 should remove the HEARTBEAT logs. Based on feedback so far, it sounds like this issue is now resolved. @jchristianj let me know if you are still having issues.

dgreif avatar Oct 15 '22 16:10 dgreif

I too have been having issues with no motion detection notifications from a pro 2 and stick up camera linked currently. Updated dependencies, checked smart alerts, checked all updates, unbound cameras and still no dice. Additionally no view on Apple TV when the doorbell button is pressed or chimes on the HomePods.

Gotcha182 avatar Oct 21 '22 22:10 Gotcha182

I too have been having issues with no motion detection notifications from a pro 2 and stick up camera linked currently. Updated dependencies, checked smart alerts, checked all updates, unbound cameras and still no dice. Additionally no view on Apple TV when the doorbell button is pressed or chimes on the HomePods.

I still had intermittent issues with the Motion detection. It’s an Apple HomeKit issue. Believe it or not I had to remove all the devices from my home kit, delete my home and also delete the HomeKit app, rebooted and reinstalled the HomeKit app. Once I added all my devices everything started working flawlessly.

grouchystitch avatar Oct 21 '22 23:10 grouchystitch

I too have been having issues with no motion detection notifications from a pro 2 and stick up camera linked currently. Updated dependencies, checked smart alerts, checked all updates, unbound cameras and still no dice. Additionally no view on Apple TV when the doorbell button is pressed or chimes on the HomePods.

I still had intermittent issues with the Motion detection. It’s an Apple HomeKit issue. Believe it or not I had to remove all the devices from my home kit, delete my home and also delete the HomeKit app, rebooted and reinstalled the HomeKit app. Once I added all my devices everything started working flawlessly.

Ugh! I really hope to not have to do that but definitely odd when my automations do not work on any motion at this point whether it’s the motion from any of the ring cameras or the motion detectors for the ring alarm integrated in. I do not want to have to reload in 100+ devices to get this working again

Gotcha182 avatar Oct 24 '22 07:10 Gotcha182

@dgreif Are there any other options as there is no motion detection at all from two different cameras as well as camera types

Gotcha182 avatar Oct 24 '22 07:10 Gotcha182

There are many factors that could cause that to happen, and it's not simple to debug. Do the notifications immediately after a homebridge reboot?

dgreif avatar Oct 24 '22 15:10 dgreif

There are many factors that could cause that to happen, and it's not simple to debug. Do the notifications immediately after a homebridge reboot?

No I get zero notifications for motions. I have a Seaver lock tied into my alarm and those notifications come in but nothing for motion at all

Gotcha182 avatar Oct 24 '22 15:10 Gotcha182

I would like to chime in (no pun intended), I'm on the latest version of the plugin and currently receive notifications on my phone when the doorbell is pressed (Ring video doorbell 4), but there is no chime played on homepods. Is there anyway to fix this issue? I've restarting the homepods in question but no luck.

chinedu40 avatar Nov 15 '22 21:11 chinedu40

I think there’s a handshake that has to happen when you enable the chimes and notifications on ‘15 and ‘16 ioss. Try turning the chimes off in home app and then back on again. Sent from my iPhoneOn 16 Nov 2022, at 8:35 am, chinedu40 @.***> wrote: I would like to chime in (no pun intended), I'm on the latest version of the plugin and currently receive notifications on my phone when the doorbell is pressed (Ring video doorbell 4), but there is no chime played on homepods. Is there anyway to fix this issue? I've restarting the homepods in question but no luck.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

bensuthers-au avatar Nov 15 '22 22:11 bensuthers-au

The core problem is still there. On reading through the various issues people have reported there is a common thread that @dgreif you'd be well placed to address. It is very simple: How do you get the new push notifications delivered? Here's the simplest possible illustration of the problem that I and others clearly have:

  1. The doorbell notifications in HomeKit (via Homebridge) worked perfectly in version 9.24. Upon upgrading to the latest releases (11.7.1) they simply stopped. They don't even appear in the Homebridge log in debug mode. That includes chiming on homepods.
  2. No other setup changes have been made, not to HomePods, HomeBridge nor Ring App.
  3. I, like many others do not have any Ring subscriptions so the issue of configuring 'Smart Alerts' (which require a subscription) is irrelevant.
  4. Correct functionality is restored immediately on re-installing 9.24. No need for resets, deletions, Ring app configurations or any of the other 'delete everything from the Home app and start again' actions people have suggested.
  5. This tells me there is a problem receiving the push notifications that is common for those folks who just have the simplest setup (one doorbell, no customizations, no subscriptions, etc.)

I'm happy to do any debugging you may need to solve the problem.

townsen avatar Jan 05 '23 10:01 townsen

@townsen there were intentional changes to the way motion/dings are detected between v9 and v10/11. Instead of polling (requesting the info from the server every few seconds), we are now subscribing to push notifications. This means Ring will actually send us the data right when it happens. It's way more efficient network-wise, you get the data asap, and as a bonus the push events usually include a snapshot id which can be used to provide a snapshot in HomeKit.

The downside with push notifications from Ring is that they don't seem to work for 100% of users. They also may be impacted by smart notification settings. That's where all of the workarounds you mentioned come into play. It's not a simple matter of fixing a bug, it's an entirely different strategy for getting notifications.

One solution would be to use both polling and push notifications, but there are downsides. You get the network inefficiency back, and for users who can only use polling, snapshots likely won't be included in the HomeKit notification. This means many more obscure and less obvious bugs. Rather than dealing with that headache, I'd prefer to stick with just push notifications. I understand they aren't working for everyone, and I welcome PRs from anyone who can figure out how to make them more reliable. Until then, I suggest you try some of the workarounds. I think the most promising is to try removing all the active sessions from the Ring Security Center, and then logging back in.

dgreif avatar Jan 05 '23 14:01 dgreif