ebaauw / homebridge-nb

Homebridge plugin for Nuki Bridge
Apache License 2.0
52 stars 3 forks source link

Disable doorbell notification on geofence RTO #55

Closed timgrewe closed 2 years ago

timgrewe commented 2 years ago

When I press my doorbell with RTO activated through Nuki's geofencing, I still get the doorbell notification through HomeKit. I haven't been able to replicate this with RTO manually enabled but I haven't tested this extensively.

Is this a bug or expected behaviour?

ebaauw commented 2 years ago

HomeKit notifications are handled by Apple in iCloud, and configured through the Home app. HomeKit accessories don't even know about them, let alone that they can influence them.

Homebridge NB fires the Doorbell service's Stateless Programmable Switch when the Opener reports a ringActionState. I don't really use RTO myself, but I if the Opener still rings in RTO mode, this is to be expected.

I could probably add a Mute option not to fire the Doorbell, ignoring the ringActionState, but this would be an all-or-nothing setting: as I said before: an accessory cannot selectively enable or disable HomeKit notifications.

timgrewe commented 2 years ago

I see. But couldn't the Doorbell's Stateless Programmable Switch only be fired if the Opener reports "state": 1 (i.e. online) in its callback?

ebaauw commented 2 years ago

I could probably add a Mute option not to fire the Doorbell, ignoring the ringActionState, but this would be an all-or-nothing setting: as I said before: an accessory cannot selectively enable or disable HomeKit notifications.

I already expose Enabled on the Doorbell service for this.

But couldn't the Doorbell's Stateless Programmable Switch only be fired if the Opener reports "state": 1 (i.e. online) in its callback?

No, just clear Enabled when setting RTO, and set Enabled when clearing RTO. You could even create a HomeKit automation to do this automatically when changing RTO.

sercontri commented 2 years ago

I could probably add a Mute option not to fire the Doorbell, ignoring the ringActionState, but this would be an all-or-nothing setting: as I said before: an accessory cannot selectively enable or disable HomeKit notifications.

+1