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.43k stars 88 forks source link

Help with generating an event on doorbell button #102

Closed jeffoconnorau closed 3 years ago

jeffoconnorau commented 3 years ago

Describe The Problem: I have the G4 Doorbell, I have activated the feature option for the sensor. However I can't seem to work out how to generate an event upon pressing the doorbell button in HomeKit, or Eve. I have motion detection playing a sound on a chime just fine, but after reading the documentation, and being new to Homekit, I am just not sure how to use the contact sensor, and what I should be doing in HomeKit to integrate an automation event with it. For example, should I be automating an Event for "An Accessory is Controlled", or a "Sensor detects something" or other option ? and then do I configure the event for the "Press Button" or some other option ?

I do not believe this is a bug, just more so a little more explanation in the documentation for what to automate, or look for to help automate things within HomeKit.

To Reproduce: enable contact sensor in homebridge, restart homebridge, and then not sure which accessory or sensor to use to trigger an automation event for doorbell button press in HomeKit or the Eve iPad application.

Thanks for the fantastics plugin, but for a new user of homekit, I just need a little extra detail in the documentation to help me complete the automation tasks. I think I am just missing some detail, or maybe the contact sensor is not showing up as an accessory for me ?

Logs: I can provide logs if required, but I don't know if they would help at this stage. Happy to supply, if they would help.

Show the Homebridge logs here.
Remove any sensitive information.

Homebridge Configuration:


{
            "controllers": [
                {
                    "address": "192.168.1.10",
                    "mqttUrl": "mqtt://mqtt_user:password@192.168.1.11",
                    "password": "password",
                    "username": "homebridge"
                }
            ],
            "options": [
                "Doorbell.ContactSensor"
            ],
            "platform": "UniFi Protect"
        },

Screenshots:

Environment:

hjdhjd commented 3 years ago

Hi there...glad you’re enjoying the plugin!

As to the documentation...it’s pretty explicit, but if you have suggested edits, contribute away. It’s an advanced feature for a reason...don’t jump into the deep end of the pool until you’re sure you know how to swim. :smile:

The contact sensor is a hack, essentially. HomeKit does not provide a way to automate a doorbell ring event. It would be great if it did, and perhaps it will in the future, but right now, there’s no way to create an automation based on a ring event.

So what do we do?

We fake it.

HomeKit does have automation events based on a lot of other things, such as contact sensors. When the doorbell is rung, homebridge-unifi-protect` will also trigger the contact sensor (aka open) if it’s configured. You can use that event to effectively automate a doorbell ring.

Good luck!

brianmedia commented 3 years ago

image

Here's how it looks in my setup. Like he mentioned. When the sensor "opens"

jeffoconnorau commented 3 years ago

Thank you both, I think my issue is that I don't see the doorbell opens sensor in my homekit to then make the automation event possible. I must be missing something as to why it is not appearing in Homekit accessories.

I might try on an iPhone or MacOS app instead of the iPad, though I don't see why that should make a difference. Either way, I know what to debug now 👍

jeffoconnorau commented 3 years ago

I have just worked it out.

I used "Doorbell.ContactSensor" to enable the accessory, instead of "Enable.ContactSensor" - so this was my mistake from reading the documentation, and seeing the text in the readme, as the text to use. It's correctly referenced in the "Advanced Options page" but my brain didn't pick up the difference.

So all good now ! Thanks again.

jeffoconnorau commented 3 years ago

can be close now, as PEBKAC!

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