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

Support CameraClipPreview for Nest Doorbell (battery) #53

Open osy opened 1 year ago

osy commented 1 year ago

getEventImage() in Camera.ts only queries CameraEventImage. However, on the Nest Doorbell (battery), CameraClipPreview is used instead. https://developers.google.com/nest/device-access/traits/device/camera-clip-preview describes the preview as

A clip preview is a 10 frame video file in mp4 format. You can choose to show the mp4 video file, or transcode it to another format (for example, an animated gif) in order to show a complete 10 frame sequence. The device client capabilities should be considered when selecting a clip preview method.

Since it doesn't seem like Homebridge supports animated previews, it would be nice to pick one of the frame, convert it to JPEG, and attach it to this.image so getSnapshot() can use it. Maybe the frame number can be a user configurable option.

potmat commented 1 year ago

Hi @osy, so as it stands right now do you see any event images?

osy commented 1 year ago

Nope, just the Google logo.

potmat commented 1 year ago

I don't have one of the new doorbells, so there's no way for me to develop/debug this. If anyone out there does, and can create a PR it would be appreciated.

parkr commented 1 year ago

Some prior art: https://github.com/home-assistant/core/issues/85551#issuecomment-1420960719