diff --git a/plugins/unifi-protect/package-lock.json b/plugins/unifi-protect/package-lock.json index 4b0210e38e..dec805eebe 100644 --- a/plugins/unifi-protect/package-lock.json +++ b/plugins/unifi-protect/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/unifi-protect", - "version": "0.0.138", + "version": "0.0.139", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/unifi-protect", - "version": "0.0.138", + "version": "0.0.139", "license": "Apache", "dependencies": { "@koush/unifi-protect": "file:../../external/unifi-protect", diff --git a/plugins/unifi-protect/package.json b/plugins/unifi-protect/package.json index bd1a0e6ceb..d10ae17db0 100644 --- a/plugins/unifi-protect/package.json +++ b/plugins/unifi-protect/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/unifi-protect", - "version": "0.0.138", + "version": "0.0.139", "description": "Unifi Protect Plugin for Scrypted", "author": "Scrypted", "license": "Apache", diff --git a/plugins/unifi-protect/src/camera.ts b/plugins/unifi-protect/src/camera.ts index 8e0244347f..9b76210b6c 100644 --- a/plugins/unifi-protect/src/camera.ts +++ b/plugins/unifi-protect/src/camera.ts @@ -317,7 +317,8 @@ export class UnifiCamera extends ScryptedDeviceBase implements Notifier, Interco const rtspChannel = camera.channels.find(check => check.id.toString() === vso.id); const { rtspAlias } = rtspChannel; - const u = `rtsps://${this.protect.getSetting('ip')}:7441/${rtspAlias}` + const ip = (this.protect.getSetting('useConnectionHost') !== 'false' && camera.connectionHost) || this.protect.getSetting('ip'); + const u = `rtsps://${ip}:7441/${rtspAlias}` const data = Buffer.from(JSON.stringify({ url: u, diff --git a/plugins/unifi-protect/src/main.ts b/plugins/unifi-protect/src/main.ts index c3ebf3cdec..8567a9e6a7 100644 --- a/plugins/unifi-protect/src/main.ts +++ b/plugins/unifi-protect/src/main.ts @@ -562,6 +562,13 @@ export class UnifiProtect extends ScryptedDeviceBase implements Settings, Device placeholder: '192.168.1.100', value: this.getSetting('ip') || '', }, + { + key: 'useConnectionHost', + title: 'Use Connection Host', + description: 'Uses the connection host to route to connect to the RTSP Stream, and is required for stacked UNVR configuraitons. Disabling this setting will always use the configured Unifi Protect IP for RTSP streaming.', + type: 'boolean', + value: this.getSetting('useConnectionHost') !== 'false', + } ]; if (!isInstanceableProviderModeEnabled()) {