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.48k stars 94 forks source link

Cameras regularly delete and re-add #1131

Closed cantcodewontcode closed 1 month ago

cantcodewontcode commented 1 month ago

Homebridge UniFi Protect Version

v7.5.1

Homebridge Platform and OS

Ubuntu Server 22.04

Homebridge Version

v1.8.4

Node Version

v20.17.0

UniFi OS Version

v4.0.18

UniFi Protect Controller Version

v5.0.34

Describe the problem

Regularly, my cameras will be removed and re-added by the Unifi Homebridge app. When this happens, HomeKit sees them as brand new cameras, and all their settings are wiped (no notifications, activity settings, automations, etc. configured).

My HBUP and Cloud Key have a clean network connection to each other, with nothing in between interrupting their communications. This started happening possibly up to 2 months ago (noticed when I realized I hadn't gotten a camera alert in a long long time) and I've noticed the cameras have reset config every week or so. During this time, I've had several Protect application updates, Cloud Key updates, HBUP software updates, and even an update from Ubuntu 20.04 to 22.04. I can't tell what version of code on which product months ago might have aligned with the first occurrence of the bug.

Homebridge HBUP JSON configuration

{
    "controllers": [
        {
            "address": "cloudkey.spryfamily.com",
            "password": "XXXXX",
            "username": "homebridge"
        }
    ],
    "name": "UniFi Protect",
    "options": [
        "Disable.Doorbell.Messages.F4E2C6DA03E5",
        "Disable.Log.HKSV.F4E2C6DA03E5",
        "Disable.Log.Doorbell.F4E2C6DA03E5",
        "Enable.Video.Transcode.Hardware.F4E2C6DA03E5",
        "Disable.Doorbell.Trigger.F4E2C674A9BD",
        "Disable.Log.Doorbell.F4E2C674A9BD",
        "Disable.Log.HKSV.F4E2C674A9BD",
        "Disable.Doorbell.Trigger.F4E2C674A8DE",
        "Disable.Log.Doorbell.F4E2C674A8DE",
        "Disable.Log.HKSV.F4E2C674A8DE",
        "Disable.Doorbell.Trigger.F4E2C674AB49",
        "Disable.Log.Doorbell.F4E2C674AB49",
        "Disable.Log.HKSV.F4E2C674AB49",
        "Disable.Doorbell.Trigger.F4E2C674AA69",
        "Disable.Log.Doorbell.F4E2C674AA69",
        "Disable.Log.HKSV.F4E2C674AA69",
        "Enable.Nvr.SystemInfo.F4E2C6DA03E5"
    ],
    "platform": "UniFi Protect"
}

Relevant log output

[9/28/2024, 11:11:41 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: API error: Protect controller is taking too long to respond to a request. This error can usually be safely ignored.
[9/28/2024, 11:11:41 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: API error: Protect controller is taking too long to respond to a request. This error can usually be safely ignored.
[9/28/2024, 11:11:41 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: API error: Protect controller is taking too long to respond to a request. This error can usually be safely ignored.
[9/28/2024, 11:11:41 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: API error: Protect controller is taking too long to respond to a request. This error can usually be safely ignored.
[9/28/2024, 11:11:41 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: API error: Protect controller is taking too long to respond to a request. This error can usually be safely ignored.
[9/28/2024, 11:12:13 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: API error: Protect controller is taking too long to respond to a request. This error can usually be safely ignored.
[9/28/2024, 11:12:17 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: API error: Protect controller is taking too long to respond to a request. This error can usually be safely ignored.
[9/28/2024, 11:12:17 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: API error: Unable to retrieve the UniFi Protect controller configuration.
[9/28/2024, 11:12:27 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: API error: Connection refused.
[9/28/2024, 11:12:27 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: API error: Connection refused.
[9/28/2024, 11:12:27 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: API error: Unable to retrieve the UniFi Protect controller configuration.
[9/28/2024, 11:13:37 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: API error: Insufficient privileges for this user. Please check the roles assigned to this user and ensure it has sufficient privileges.
[9/28/2024, 11:13:37 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: API error: Insufficient privileges for this user. Please check the roles assigned to this user and ensure it has sufficient privileges.
[9/28/2024, 11:13:37 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: API error: Insufficient privileges for this user. Please check the roles assigned to this user and ensure it has sufficient privileges.
[9/28/2024, 11:13:37 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: API error: Insufficient privileges for this user. Please check the roles assigned to this user and ensure it has sufficient privileges.
[9/28/2024, 11:13:37 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: API error: Insufficient privileges for this user. Please check the roles assigned to this user and ensure it has sufficient privileges.
[9/28/2024, 11:14:37 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: Detected a role change for user 'homebridge': the Administrator role has been disabled.
[9/28/2024, 11:14:37 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: Doorbell [G4 Doorbell Pro]: Removing camera from HomeKit.
[9/28/2024, 11:14:37 PM] [UniFi Protect] Doorbell Package Camera [G4 Doorbell Pro]: Disabling HomeKit Secure Video event recording.
[9/28/2024, 11:14:37 PM] [UniFi Protect] Doorbell [G4 Doorbell Pro]: Disabling HomeKit Secure Video event recording.
[9/28/2024, 11:14:37 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: Front Yard [G5 Bullet]: Removing camera from HomeKit.
[9/28/2024, 11:14:37 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: Side Yard [G5 Bullet]: Removing camera from HomeKit.
[9/28/2024, 11:14:37 PM] [UniFi Protect] Side Yard [G5 Bullet]: Disabling HomeKit Secure Video event recording.
[9/28/2024, 11:14:37 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: Back Porch [G5 Bullet]: Removing camera from HomeKit.
[9/28/2024, 11:14:37 PM] [UniFi Protect] Back Porch [G5 Bullet]: Disabling HomeKit Secure Video event recording.
[9/28/2024, 11:14:37 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: Garage [G5 Bullet]: Removing camera from HomeKit.
[9/28/2024, 11:14:37 PM] [UniFi Protect] Garage [G5 Bullet]: Disabling HomeKit Secure Video event recording.
[9/28/2024, 11:14:37 PM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: Doorbell Package Camera: Removing device from HomeKit. You will need to manually delete the device in the Home app to complete the removal.
[9/29/2024, 12:12:40 AM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: Detected a role change for user 'homebridge': the Administrator role has been enabled.
[9/29/2024, 12:12:40 AM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: Back Porch [G5 Bullet]: Adding camera to HomeKit.
[9/29/2024, 12:12:40 AM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: Garage [G5 Bullet]: Adding camera to HomeKit.
[9/29/2024, 12:12:41 AM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: Doorbell [G4 Doorbell Pro]: Adding camera to HomeKit.
[9/29/2024, 12:12:41 AM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: Side Yard [G5 Bullet]: Adding camera to HomeKit.
[9/29/2024, 12:12:41 AM] [UniFi Protect] Unifi Cloud Key Gen2 Plus [UCK-G2-PLUS]: Front Yard [G5 Bullet]: Adding camera to HomeKit.

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

cantcodewontcode commented 1 month ago

Just to be clear, the user homebridge is a Super Admin on the Unifi Cloud Key (pre-defined role which covers all applications including Protect). This user and its role and password have not changed since initial installation a year ago.

hjdhjd commented 1 month ago

These are issues with the Protect controller that multiple users have reported on the Discord. It isn't HBUP. The Protect controller is buggy in v5 and hopefully Ubiquiti addresses it in the near future. In the meantime, you can use the device delay feature option (located under the NVR feature options section) to have HBUP hold off from removing Protect devices for a longer period of time than the default (which is realtime).

TL;DR: not a bug/issue in HBUP and not something I can do anything about unfortunately. Your issues lie with Ubiquiti and their currently buggy firmware releases. You can mitigate the issue somewhat with the device delay removal feature option.

Wish I had better news.

cantcodewontcode commented 1 month ago

Thanks @hjdhjd. This definitely started back in the 4.x Protect controller code versions. I've set my timeout to 86400.

github-actions[bot] commented 1 month 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.