knuckleheadsmiff / homebridge-garagedoor-ryobi

Homebridge plugin for Ryobi GDO (Garage Door Opener)
4 stars 4 forks source link

Notification Issues #23

Open fatkid98 opened 3 years ago

fatkid98 commented 3 years ago

I’m not sure if I’m the only one, but my open/close notifications only work about 25% of the time. I’ve made sure that it’s set to receive notifications any time, so it’s not a location issue. My plug-in is up-to-date. I am running the plug-in through Hoobs, which is also up-to-date. Functionality of the opener works fine, opens and closes through the app and via Siri.

knuckleheadsmiff commented 3 years ago

I’ve seen this too but it is not consistent and I don’t see anything in the logs showing an issue. I scan the code again but I’m not sure where the issue is.

I’ve also noticed however that I always don’t get notifications from ryobi’s app as well.

fatkid98 commented 3 years ago

It could also be an iOS 14 issue as well. I can’t comment on the Ryobi notifications, as I have those turned off. I just wanted to make sure I wasn’t the only one experiencing the issue within the Home app. Thank you all for your hard work. I appreciate it.

knuckleheadsmiff commented 3 years ago

Ok, I just ran some tests. It is something about home app or the hub (an AppleTV, iPad or the apple speaker In your home) on iOS. I’m seeing the status get updated correctly on my phone and iPad but notifications only sometimes happening even though they are set to notify.

Worse is I just realized that I can’t find how to control notifications independently on the Apple Watch (I never noticed this before but that is where I usually see notification when operating my garage door.)

knuckleheadsmiff commented 3 years ago

I found this related issue from another HomeKit plugin: https://github.com/hjdhjd/homebridge-myq/pull/149

I’ll look more at this when I get the chance to see if it applies (notice he did not fix all cases as well.). It’s possible when a major cleanup was done in this code that a sequence of calls changed. Also, I found on GitHub comments related to phone switching between WiFi and cell service (and back) causing notification issues. Not sure if this is related.

knuckleheadsmiff commented 3 years ago

I scanned the code and I don’t see a significant difference when the rewrite happened in the way the code reports the current the door state to homebridge that would account for the change. It is possible the something in homebridge itself (which also had a major rewrite this past year or iOS could explain it but I’m at a loss.

@andyedinborough do you have any theories. I too see this but I can’t tell when this behavior change occurred. I know that it use to work 100%. 😔

knuckleheadsmiff commented 3 years ago

What I’ve noticed is that if I use HomeKit to open/close (from CarPlay) then I see an alert. I don’t see the alert if I use hardwired open or car remote. Even then I’m not getting alerts to my watch but that is a bug in iOS.

knuckleheadsmiff commented 3 years ago

Ok I have a theory and it may indeed be a HomeKit change. I think I get the notification I and only if the target state gets set. This only happens if the door is put into the opening/closing state. I think I have an ideas to fix this and will try it out when I get the chance (may be awhile…)

I believe (it’s something like this) that I can see if the state changed from open to close (or opposite) and then set the target door state. I have to be careful here not to keep toggling the target door state back once set after I notice a change.

knuckleheadsmiff commented 3 years ago

Ok, I’ve confirmed the theory above. When it missing the “opening/closing” states when polling the no notifications happen. This really is a change In behavior in iOS. So the fix will be to detect when going from open to closed without seeing the opening action (do to the long nature of polling) and faking the in between state while handling a few edge conditions correctly.

Still a while until I can get to this but I will….eventually.