diff --git a/external/ring-client-api b/external/ring-client-api index 2d3fac10c..b158042d3 160000 --- a/external/ring-client-api +++ b/external/ring-client-api @@ -1 +1 @@ -Subproject commit 2d3fac10c7d60126d5ef64ec6da80d17741566e1 +Subproject commit b158042d3c90a9179800ebbf79d6650e47d28ce1 diff --git a/plugins/ring/README.md b/plugins/ring/README.md index 374955928..88bdcd4cc 100644 --- a/plugins/ring/README.md +++ b/plugins/ring/README.md @@ -37,17 +37,21 @@ Do not enable prebuffer on Ring cameras and doorbells. ## Problems and Solutions -I can see artifacts in HKSV recordings +### Motion and Doorbell Events are not delivered. + +See the [Ring Notification Troubleshooting](https://github.com/dgreif/ring/wiki/Notification-Troubleshooting) guide and clear all devices. + +### I can see artifacts in HKSV recordings - Check WiFi connection of the camera. If Camera have low signal, it will cause Packet Loss and create artifacts in the recordings. -I can constantly see Live View recodings in Ring App +### I can constantly see Live View recodings in Ring App - Turn off "PAM DIFF", "OPEN CV" and "PREBUFFER". All of these will cause continous connection to Live View. This will stop motion event delivery and clutter Ring app with Live View Recordings. -Not all motions are recorded in Home app (they dont match with Ring app) +### Not all motions are recorded in Home app (they dont match with Ring app) - Check your motion settings in Ring app. I recommend to turn off "Smart Alerts", sometimes when notifications are turned off for "Other Motion" it will caouse that only "People" motion Events are sent to Scrypted. -Do I need to pay for Ring Connect in order to record Ring Doorbell Motion in HKSV? +### Do I need to pay for Ring Connect in order to record Ring Doorbell Motion in HKSV? - No. -Recording in HKSV starts few seconds after recording in Ring app +### Recording in HKSV starts few seconds after recording in Ring app - The reason for this issue is usually a delay in the network's processing. When motion is detected by Ring, the information is sent to its server and then relayed back to scrypted. Even with a fast, wired network, there is often some lag and video capture may be lost during events. diff --git a/plugins/ring/package-lock.json b/plugins/ring/package-lock.json index 9cbac2e91..b6ac21291 100644 --- a/plugins/ring/package-lock.json +++ b/plugins/ring/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/ring", - "version": "0.0.113", + "version": "0.0.117", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@scrypted/ring", - "version": "0.0.113", + "version": "0.0.117", "dependencies": { "@koush/ring-client-api": "file:../../external/ring-client-api", "@scrypted/common": "file:../../common", diff --git a/plugins/ring/package.json b/plugins/ring/package.json index 05bf63be8..01287808e 100644 --- a/plugins/ring/package.json +++ b/plugins/ring/package.json @@ -44,5 +44,5 @@ "got": "11.8.6", "socket.io-client": "^2.5.0" }, - "version": "0.0.113" + "version": "0.0.117" } diff --git a/plugins/ring/src/main.ts b/plugins/ring/src/main.ts index 07df7eea0..f55c3953b 100644 --- a/plugins/ring/src/main.ts +++ b/plugins/ring/src/main.ts @@ -1,11 +1,12 @@ +import { sleep } from '@scrypted/common/src/sleep'; import sdk, { Device, DeviceProvider, ScryptedDeviceBase, ScryptedDeviceType, ScryptedInterface, Setting, Settings, SettingValue } from '@scrypted/sdk'; import { StorageSettings } from '@scrypted/sdk/storage-settings'; +import crypto from 'crypto'; import { RingLocationDevice } from './location'; -import { generateUuid, Location, RingBaseApi, RingRestClient } from './ring-client-api'; -import { sleep } from '@scrypted/common/src/sleep'; +import { Location, RingBaseApi, RingRestClient } from './ring-client-api'; const { deviceManager, mediaManager } = sdk; - + class RingPlugin extends ScryptedDeviceBase implements DeviceProvider, Settings { loginClient: RingRestClient; api: RingBaseApi; @@ -92,11 +93,11 @@ class RingPlugin extends ScryptedDeviceBase implements DeviceProvider, Settings }; } + if (!this.settingsStorage.values.systemId) + this.settingsStorage.values.systemId = crypto.createHash('sha256').update(crypto.randomBytes(32)).digest('hex'); + this.discoverDevices() .catch(e => this.console.error('discovery failure', e)); - - if (!this.settingsStorage.values.systemId) - this.settingsStorage.values.systemId = generateUuid(); } waiting = false; @@ -123,6 +124,7 @@ class RingPlugin extends ScryptedDeviceBase implements DeviceProvider, Settings this.api?.disconnect(); this.api = new RingBaseApi({ + controlCenterDisplayName: 'scrypted-ring', refreshToken: this.settingsStorage.values.refreshToken, ffmpegPath: await mediaManager.getFFmpegPath(), locationIds,