diff --git a/plugins/google-device-access/fs/README-camera-v1.md b/plugins/google-device-access/fs/README-camera-v1.md new file mode 100644 index 000000000..94811464c --- /dev/null +++ b/plugins/google-device-access/fs/README-camera-v1.md @@ -0,0 +1,7 @@ +## Gen 1 Camera Setup + +Install the Rebroadcast Plugin. Since this is a cloud camera, prebuffering is not enabled by default. This means that any motion leading up to an event may not be captured. Enable prebuffering if your internet service will not have bandwidth issues with a persistent connection continually downloading your camera stream. + +Gen 1 Cameras only provide recent event snapshots. If there was no recent event, you will see "Snapshot Unavailable" in HomeKit while the stream is inactive. If prebuffering is enabled, the snapshots will always be available. + +The Gen 1 Camera requires HomeKit Transcoding to be enabled. Under the HomeKit Transcoding settings, enable transcoding on streams and recordings. Leave the decoder and encoder arguments blank. The defaults have been found to work the most reliably. diff --git a/plugins/google-device-access/fs/README-camera-v2.md b/plugins/google-device-access/fs/README-camera-v2.md new file mode 100644 index 000000000..b25c39aed --- /dev/null +++ b/plugins/google-device-access/fs/README-camera-v2.md @@ -0,0 +1,5 @@ +## Gen 2 Camera Setup + +Install the Rebroadcast Plugin. Since this is a cloud camera, prebuffering is not enabled by default. This means that any motion leading up to an event may not be captured. Enable prebuffering if your internet service will not have bandwidth issues with a persistent connection continually downloading your camera stream. + +Gen 2 Cameras do not provide snapshots. You will see "Snapshot Unavailable" in HomeKit while the stream is inactive. If prebuffering is enabled, the snapshots will always be available. diff --git a/plugins/google-device-access/package-lock.json b/plugins/google-device-access/package-lock.json index a8128030d..a18672887 100644 --- a/plugins/google-device-access/package-lock.json +++ b/plugins/google-device-access/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/google-device-access", - "version": "0.0.75", + "version": "0.0.76", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/google-device-access", - "version": "0.0.75", + "version": "0.0.76", "dependencies": { "@googleapis/smartdevicemanagement": "^0.2.0", "axios": "^0.21.1", diff --git a/plugins/google-device-access/package.json b/plugins/google-device-access/package.json index 7dbb42b24..33f34da24 100644 --- a/plugins/google-device-access/package.json +++ b/plugins/google-device-access/package.json @@ -45,5 +45,5 @@ "@types/node": "^14.17.11", "@types/url-parse": "^1.4.3" }, - "version": "0.0.75" + "version": "0.0.76" } diff --git a/plugins/google-device-access/src/main.ts b/plugins/google-device-access/src/main.ts index 349c609a7..8ba7d06f4 100644 --- a/plugins/google-device-access/src/main.ts +++ b/plugins/google-device-access/src/main.ts @@ -1,4 +1,4 @@ -import sdk, { DeviceManifest, DeviceProvider, HttpRequest, HttpRequestHandler, HttpResponse, HumiditySensor, MediaObject, MotionSensor, OauthClient, Refresh, ScryptedDeviceType, ScryptedInterface, Setting, Settings, TemperatureSetting, TemperatureUnit, Thermometer, ThermostatMode, VideoCamera, MediaStreamOptions, BinarySensor, DeviceInformation, BufferConverter, ScryptedMimeTypes, RTCAVMessage, RTCAVSource, Camera, PictureOptions, ObjectsDetected, ObjectDetector, ObjectDetectionTypes, FFMpegInput, RequestMediaStreamOptions } from '@scrypted/sdk'; +import sdk, { DeviceManifest, DeviceProvider, HttpRequest, HttpRequestHandler, HttpResponse, HumiditySensor, MediaObject, MotionSensor, OauthClient, Refresh, ScryptedDeviceType, ScryptedInterface, Setting, Settings, TemperatureSetting, TemperatureUnit, Thermometer, ThermostatMode, VideoCamera, MediaStreamOptions, BinarySensor, DeviceInformation, BufferConverter, ScryptedMimeTypes, RTCAVMessage, RTCAVSource, Camera, PictureOptions, ObjectsDetected, ObjectDetector, ObjectDetectionTypes, FFMpegInput, RequestMediaStreamOptions, Readme } from '@scrypted/sdk'; import { ScryptedDeviceBase } from '@scrypted/sdk'; import qs from 'query-string'; import ClientOAuth2 from 'client-oauth2'; @@ -17,6 +17,9 @@ const SdmSignalingPrefix = ScryptedMimeTypes.RTCAVSignalingPrefix + 'gda/'; const SdmDeviceSignalingPrefix = SdmSignalingPrefix + 'x-'; const black = fs.readFileSync('black.jpg'); +const readmeV1 = fs.readFileSync('README-camera-v1.md').toString(); +const readmeV2 = fs.readFileSync('README-camera-v2.md').toString(); + function getSdmRtspMediaStreamOptions(): MediaStreamOptions { return { id: 'default', @@ -88,7 +91,7 @@ function toNestMode(mode: ThermostatMode): string { } } -class NestCamera extends ScryptedDeviceBase implements Camera, VideoCamera, MotionSensor, BinarySensor, BufferConverter, ObjectDetector { +class NestCamera extends ScryptedDeviceBase implements Readme, Camera, VideoCamera, MotionSensor, BinarySensor, BufferConverter, ObjectDetector { signalingMime: string; lastMotionEventId: string; lastImage: Promise; @@ -105,6 +108,10 @@ class NestCamera extends ScryptedDeviceBase implements Camera, VideoCamera, Moti this.toMimeType = this.signalingMime; } + async getReadmeMarkdown(): Promise { + return this.isWebRtc ? readmeV2 : readmeV1; + } + // not sure if this works? there is a camera snapshot generate image thing, but it // does not exist on the new cameras. getDetectionInput(detectionId: any, eventId?: any): Promise { @@ -769,6 +776,7 @@ class GoogleSmartDeviceAccess extends ScryptedDeviceBase implements OauthClient, ScryptedInterface.Camera, ScryptedInterface.MotionSensor, ScryptedInterface.ObjectDetector, + ScryptedInterface.Readme, ]; let type = ScryptedDeviceType.Camera;