tsightler / ring-mqtt

Ring devices to MQTT Bridge
MIT License
574 stars 103 forks source link

Several motion snapshots created after restart #625

Closed Stefan300381 closed 1 year ago

Stefan300381 commented 1 year ago

Hi,

while today I'm facing issues that a ding is not detected with my doorbell pro (did anything change today?) I noticed that on every restart of my ring-mqtt docker container, several motion snapshots will be sent via mqtt (for approx. 3min). This is quite annoying because I wrote a script that sends the image data via Telegram.

That said, I've set the snapshot mode to Motion, which usually sends a Telegram ONLY if motion is detected. So could this be a bug?

best regards

Stefan

tsightler commented 1 year ago

During any restart, or detection of a Home Assistant restart, ring-mqtt sends full state every 30 seconds for 3 minutes. This is because, on some slower systems, HA will send online state via MQTT before it is really ready to receive updates, but ring-mqtt has no way to know this, so the workaround was just to send that initial state mulitple times.

You should be able to easily work around this with your notification script if you use an additional condition and only send the image when the motion state is "on".

Stefan300381 commented 1 year ago

understand, thanks for the hint!

btw: I'm still facing several unnoticed events like motion or ding from my ring doorbell pro. As I don't see any other new issue I guess this is not a generic issue, but just me!?

tsightler commented 1 year ago

Unfortunately, I'd have to say it's just you. I certainly haven't noticed any issues with my eight devices. Do you have any examples of cases where you have a phone notificaiton but ring-mqtt didn't get the same notification? Also, make sure you aren't using any notification suppressing features like Smart Alerts.

tsightler commented 1 year ago

There is one similar report with a Doorbell Pro on ring-homebridge, which uses the same ring-client-api underneath. That report was from 3 days ago, so perhaps there's still some chance in something common, but just not widely reported yet.

https://github.com/dgreif/ring/issues/1210

Unfortunately, neither that report or this one provides any details enough to even attempt to track down such an issue so for now there's not much that can be done.

Stefan300381 commented 1 year ago

Thanks. Would highly appreciate to troubleshoot this issue together. I can open a new issue on GitHub.

This morning my wife walked the dog an passed the ring doorbell pro twice. No motion was detected at all via ring-mqtt, but ring app on iphone notified correctly. Same issue every now and then with ding events. I don't have a ring protection plan and no smart alerts. What kind of logs do you need? I'm running in Docker and so far I assumed the issue is based on a performance bottle neck on my NAS. I might be wrong.

Stefan

tsightler commented 1 year ago

Well, I've done a little bit of digging and perhaps I'm also seeing the behavior on my own devices, but I'm not sure why. Since I restarted ring-mqtt yesterday, I haven't received a single notification event.

Unfortunately, this problem is going to require some deep investigation because it is unlikely to be in ring-mqtt itself as it just subscribes and processes notifications. More likely the issue is in ring-client-api or, perhaps some changes are needed to push-receiver, neither of which I maintain, ring-mqtt is just a consumer of those libraries. I also have basically zero time to mess with this right now, so it will likely be a few weeks before I can even attempt to dig into it.

I did also notice that there's a report of dings not working for the intercom as well, which is interesting because it also uses the same push notifications. It seems likely that Ring is rolling out some changes that are negatively affecting the push notification implementation in ring-client-api.

Stefan300381 commented 1 year ago

I see. Just shout if I can be of any help e.g. by providing logs etc.

tsightler commented 1 year ago

I'm going to close this and use this new issue as the base for non-working motion/ding events.

https://github.com/tsightler/ring-mqtt/issues/627