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.5k stars 95 forks source link

Animal detection interpreted as vehicle for occupancy #1040

Closed nickhandel closed 10 months ago

nickhandel commented 10 months ago

Homebridge UniFi Protect Version

6.16.0

Homebridge Platform and OS

macOS Sonoma

Homebridge Version

1.7.0

Node Version

20.11.0

UniFi OS Version

3.2.9

UniFi Protect Controller Version

2.11.21

Describe the problem

I have an automation that's set to open the gate when a vehicle is detected on the approach (from inside the property). Our front gate has started opening for the dog, which is slightly unfortunate. I'm using the config feature in the plugin that presents vehicle detection as an occupancy event to HomeKit.

My best guess is that the plugin is treating an Animal detection (which I think is quite new) as a vehicle detection.

Is that conceivable?

Thanks!

Homebridge HBUP JSON configuration

{
    "bridge": {
        "name": "Homebridge 93A3",
        "username": "",
        "port": 51608,
        "pin": "847-72-047",
        "advertiser": "bonjour-hap",
        "bind": [
            "en0"
        ]
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "FibaroHC",
            "url": "http://fibaro**",
            "username": "",
            "password": "",
            "pollerperiod": 3,
            "thermostattimeout": 7200,
            "thermostatmaxtemperature": 100,
            "adminUsername": "**",
            "adminPassword": "**",
            "securitysystem": "disabled",
            "addRoomNameToDeviceName": "disabled",
            "logsLevel": 1,
            "advControl": 0,
            "_bridge": {
                "username": "******",
                "port": 46024
            },
            "platform": "FibaroHC"
        },
        {
            "controllers": [
                {
                    "address": "protect.*****",
                    "password": "",
                    "username": "homebridge****"
                }
            ],
            "name": "UniFi Protect",
            "options": [
                "Enable.SecuritySystem.Alarm",
                "Enable.Video.Transcode.Hardware",
                "Enable.Device.SyncName",
                "Enable.Motion.OccupancySensor.Duration.300",
                "Enable.Motion.OccupancySensor.AC8BA99F7809",
                "Disable.Motion.OccupancySensor.Person.AC8BA99F7809",
                "Enable.Motion.OccupancySensor.Vehicle.AC8BA99F7809",
                "Enable.Motion.SmartDetect.AC8BA99F7809",
                "Enable.Motion.OccupancySensor.D021F99304FF",
                "Enable.Motion.OccupancySensor.Duration.D021F99304FF.15",
                "Enable.Motion.OccupancySensor.Vehicle.D021F99304FF",
                "Disable.Motion.OccupancySensor.Person.D021F99304FF",
                "Enable.Motion.SmartDetect.D021F99304FF",
                "Enable.Motion.OccupancySensor.Duration.AC8BA99F7809.10",
                "Enable.Motion.Duration.5",
                "Enable.Doorbell.Trigger"
            ],
            "_bridge": {
                "username": "*******",
                "port": 52712
            },
            "platform": "UniFi Protect"
        },
        {
            "devices": [
                {
                    "api_key": "******",
                    "device_id": "******",
                    "name": "Kitchen TV",
                    "ip": "192.168.***",
                    "mac": "a0:d7****",
                    "options": [
                        "Frame.RealPowerMode",
                        "Frame.ArtSwitch.Disable",
                        "Frame.PowerSwitch.Disable"
                    ],
                    "inputs": [
                        {
                            "type": "app"
                        }
                    ],
                    "switches": [
                        {
                            "name": "Art Mode"
                        }
                    ]
                },
                {
                    "api_key": "*******",
                    "device_id": "**********",
                    "name": "Living Room TV",
                    "ip": "192.168.1*",
                    "mac": "f0:70:4f:*",
                    "options": [
                        "Frame.RealPowerMode",
                        "Frame.ArtSwitch.Disable",
                        "Frame.PowerSwitch.Disable"
                    ],
                    "inputs": [
                        {
                            "type": "app"
                        }
                    ]
                }
            ],
            "_bridge": {
                "username": "******",
                "port": 53072
            },
            "platform": "SamsungTizen"
        },
        {
            "username": "*********",
            "password": "",
            "serialnumber": "AL500212*",
            "powerLoadingThreshold": 1500,
            "socLoadingThreshold": 50,
            "refreshTimerInterval": 60000,
            "power_image_filename": "/tmp/alpha_power_image.png",
            "logrequestdata": false,
            "tibberEnabled": false,
            "tibberThresholdSOC": 60,
            "tibberThresholdCnts": 0.01,
            "triggerImageFilename": "/tmp/tibber_image.png",
            "platform": "AlphaEssPlatform",
            "_bridge": {
                "username": "0E:29:C******",
                "port": 47451
            }
        },
        {
            "name": "Shelly NG",
            "mdns": {
                "enable": false,
                "interface": "en0"
            },
            "devices": [
                {
                    "id": "shellyplus2pm-fcb467a4d2b4",
                    "name": "Garage Lights",
                    "exclude": false,
                    "hostname": "garage-li**********",
                    "switch:0": {
                        "exclude": false,
                        "type": "switch"
                    },
                    "switch:1": {
                        "exclude": false,
                        "type": "switch"
                    },
                    "switch:2": {
                        "exclude": false,
                        "type": "switch"
                    },
                    "switch:3": {
                        "exclude": false,
                        "type": "switch"
                    },
                    "cover:0": {
                        "exclude": false,
                        "type": "window"
                    }
                },
                {
                    "id": "shelly1minig3-84fce64",
                    "name": "Workshop Lights",
                    "exclude": false,
                    "hostname": "workshop-********",
                    "switch:0": {
                        "exclude": false,
                        "type": "switch"
                    },
                    "switch:1": {
                        "exclude": false,
                        "type": "switch"
                    },
                    "switch:2": {
                        "exclude": false,
                        "type": "switch"
                    },
                    "switch:3": {
                        "exclude": false,
                        "type": "switch"
                    },
                    "cover:0": {
                        "exclude": false,
                        "type": "window"
                    }
                }
            ],
            "_bridge": {
                "username": "0E:EC:C6:2D:A3:17",
                "port": 41148
            },
            "platform": "ShellyNG"
        },
        {
            "name": "Shelly",
            "admin": {
                "enabled": true
            },
            "_bridge": {
                "username": "******C",
                "port": 32743
            },
            "platform": "Shelly"
        }
    ],
    "disabledPlugins": [
        "homebridge-alphaess"
    ]
}

Relevant log output

I can't see any relevant log entries - did I miss something in the config that writes relevant smart detections to Homebridge Logs?

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

hjdhjd commented 10 months ago

Thanks for the report. HBUP shouldn’t care what other occupancy types have been added (it dynamically adapts to the particular environment given camera capabilities and firmware versions drive all the detection types).

Turn on motion logging for the cameras in question and see what HBUP says is being detected. You should also take a close look at the Protect detection logs on the controller and see what detection types it picked up.

I’ll take a closer look at my end and see if there’s something going on…but at the moment, I don’t see anything obvious. I’ll test a few scenarios myself, but in the meantime…if you can do the above it would be helpful.

The last and most frustrating option would be a Protect controller bug…but let’s eliminate configuration issues and HBUP first.

Let’s get this figured out.

hjdhjd commented 10 months ago

This should be addressed in the next release of HBUP. I’ll be publishing one this weekend. Thanks for the report.

nickhandel commented 10 months ago

That's great - thanks. I had enabled logging on that camera and was trying to persuade the dog to cooperate so I could see how it was reported in HBUP; looks as though you beat me to it!

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