potmat / homebridge-google-nest-sdm

A Homebridge plugin for Google Nest devices that uses the Google Smart Device Management API. Supports Cameras, Doorbells, Displays, and Thermostats. Includes support for HomeKit Secure Video.
ISC License
140 stars 17 forks source link

Doorbell chime twice per press #85

Closed Stormeh closed 1 year ago

Stormeh commented 1 year ago

Hi - I've got the 2021 Nest Doorbell (battery) - I've got it setup successfully on homebridge and is working for all intents and purposes.

However I've noticed when I press the doorbell, there will be 2 chimes - It appears on both STARTED and ENDED a notification will be sent to my device and my homepods will also chime.

[6/5/2023, 3:07:39 PM] [homebridge-google-nest-sdm] Event received: { "eventThreadState": "STARTED" [6/5/2023, 3:07:39 PM] [homebridge-google-nest-sdm] Doorbell ring! Entrance Doorbell

[6/5/2023, 3:07:58 PM] [homebridge-google-nest-sdm] Event received: { "eventThreadState": "ENDED" [6/5/2023, 3:07:58 PM] [homebridge-google-nest-sdm] Doorbell ring! Entrance Doorbell

potmat commented 1 year ago

Interesting, I have the legacy doorbell, which sends only a single event. It looks like the new ones send "updatable" events. Apparently you get an event for when the doorbell ring has started, optionally if it's still ringing, and when it ended.

Why you would need to know this, or what you're expected to do with it I'm not sure.

However, it looks like a code change of some kind will be necessary.

potmat commented 1 year ago

Just pushed v1.1.4 which should fix the issue.

I spent some time trying to play around with caching events so that I could use the motion start/stop events, but in the end I ignored them and used the same motion decay time I've always used, the extra complexity of accurately reporting when motion has "started" and "stopped" wasn't worth it.

Stormeh commented 1 year ago

Thank you so much - Tested and it's working perfectly.