hjdhjd / homebridge-unifi-protect

:video_camera: Complete HomeKit integration for all UniFi Protect device types with full support for most features including HomeKit Secure Video, and more. https://homebridge.io
Other
1.39k stars 83 forks source link

Can't enable HKSV for G5 Pro, works fine on G3 Bullet #1033

Closed nriley closed 6 months ago

nriley commented 6 months ago

Homebridge UniFi Protect Version

v6.16.0

Homebridge Platform and OS

Synology DS918+/DSM 7.1.1-42962 Update 6/Docker

Homebridge Version

v1.7.0

Node Version

v18.16.0

UniFi OS Version

v3.2.7

UniFi Protect Controller Version

v2.10.11

Describe the problem

I upgraded a G3 Bullet to a G5 Pro camera and now cannot enable recording via HomeKit Secure Video. I tried decreasing the resolution to low and turning off the time shift buffer but it did not help. I have no trouble streaming from the camera, or recording with my other G3 Bullet camera.

Here's the Home app when I try to enable recording. I don't see anything in the Homebridge log when this happens.

image

Homebridge HBUP JSON configuration

{
    "controllers": [
        {
            "address": "xxx",
            "name": "arnolda",
            "password": "xxxxx",
            "username": "homebridge"
        }
    ],
    "platform": "UniFi Protect",
    "options": [
        "Disable.Doorbell.Messages.[UDM Pro MAC address]",
        "Disable.Log.Doorbell.[UDM Pro MAC address]",
        "Enable.Video.Transcode.Hardware.[UDM Pro MAC address]",
        "Disable.Video.Transcode.Hardware.[front camera MAC address]",
        "Disable.Video.Transcode.HighLatency.[front camera MAC address]",
        "Disable.Video.HKSV.TimeshiftBuffer.[front camera MAC address]",
        "Enable.Video.HKSV.Record.Only.Low.[front camera MAC address]"
    ]
}

Relevant log output

Example of startup and streaming from front camera:

[1/6/2024, 3:55:31 PM] Homebridge v1.7.0 (HAP v0.11.1) (Homebridge) is running on port 51826.
[1/6/2024, 3:55:31 PM] [UniFi Protect] Using FFmpeg version: 6.0-homebridge-alpine-x86_64-static.
[1/6/2024, 3:55:32 PM] [UniFi Protect] arnolda [UDM-PRO]: Connected to unifi.hpn.sabi.net (UniFi Protect 2.10.11 running on UniFi OS 3.2.7).
[1/6/2024, 3:55:32 PM] [UniFi Protect] arnolda [UDM-PRO]: Discovered nvr: arnolda [UDM Pro] (address: 192.168.2.1 mac: xxx).
[1/6/2024, 3:55:32 PM] [UniFi Protect] arnolda [UDM-PRO]: Discovered camera: Front camera [G5 Pro] (address: 192.168.2.43 mac: xxx).
[1/6/2024, 3:55:32 PM] [UniFi Protect] arnolda [UDM-PRO]: Discovered camera: Rear camera [G3 Bullet] (address: 192.168.2.44 mac: xxx).
[1/6/2024, 3:55:32 PM] [UniFi Protect] arnolda [UDM-PRO] Front camera [G5 Pro]: HomeKit Secure Video event recording configured to use only: Low.
[1/6/2024, 3:55:32 PM] [UniFi Protect] arnolda [UDM-PRO] Rear camera [G3 Bullet]: HomeKit Secure Video event recording enabled: 1920x1080@30fps (High), 2,000 kbps (4 second timeshift buffer).
[1/6/2024, 5:46:59 PM] [UniFi Protect] arnolda [UDM-PRO] Front camera [G5 Pro]: Streaming request from 192.168.2.105: 1280x720@30fps, 299 kbps. Using 1280x720@30fps (Medium), 2,000 kbps.
[1/6/2024, 5:47:28 PM] [UniFi Protect] arnolda [UDM-PRO] Front camera [G5 Pro]: Stopped video streaming session.

Acknowledgment that you are only running UniFi OS and UniFi Protect releases from the Ubiquiti Official release channel

hjdhjd commented 6 months ago

Thanks for the report - this isn’t an issue in HBUP, but in HomeKit in iOS 17+…seems to have improved in 17.2, but still flaky at times. Try rebooting your HomeKit hubs (Apple TVs or HomePods)…there’s not really much I can do on the HBUP end here - we receive the request to enable HKSV from HomeKit and respond to it accordingly…I’d also suggest you try the unifi-protect channel on the Homebridge Discord - others have run into similar issues post-iOS17. Annoying to say the least I’m afraid.

I definitely would not recommend disabling the timeshift buffer or forcing the recording quality to low unless it’s absolutely essential from a system perspective, but I presume you did it for testing purposes only. 😄

Sorry for the suboptimal answer here…

Best of luck.

nriley commented 6 months ago

@hjdhjd Thanks, restarting my home hub (Apple TV) worked perfectly. I only disabled the timeshift buffer and set the quality to low because it was recommended in https://github.com/hjdhjd/homebridge-unifi-protect/blob/main/docs/HomeKitSecureVideo.md#performance-considerations (and I thought this may have been an issue because I'd never tried using a 4K camera before and the Synology is a bit underpowered).

Would you consider making changes to https://github.com/hjdhjd/homebridge-unifi-protect/blob/main/docs/HomeKitSecureVideo.md as it suggests the exact opposite ("No, you do not need to keep rebooting your Home hubs to make things work")?

github-actions[bot] commented 6 months ago

This issue is locked to prevent necroposting on closed issues. Please create a new issue for related support requests, bug reports, or feature suggestions.