koush / scrypted

Scrypted is a high performance video integration and automation platform
https://scrypted.app
Other
4.16k stars 247 forks source link

Alexa not recognizing Unifi G4 Doorbell Pro as doorbell via Scrypted Alexa plugin #903

Closed alams154 closed 1 year ago

alams154 commented 1 year ago

Scrypted recognizes the G4 Doorbell Pro as a doorbell within the Scrypted Unifi Protect Plugin: image

but that is not reflected in the Alexa app where it is only recognized as a camera: image

I'm assuming that it should be detected as a doorbell type based on this script https://github.com/koush/scrypted/blob/main/plugins/alexa/src/types/doorbell.ts

Unifi Setup: UDM Pro running UniFi OS 3.0.20 and Protect 2.8.28

Scrypted Setup: Unifi Protect Plugin running 0.0.133 Scypted Cloud running 0.1.14 (with Port Forwarding disabled) Alexa running 0.2.5

Scrypted is running as a docker container through docker-compose with the following service:

scrypted:
        image: koush/scrypted
        container_name: scrypted
        devices:
            - /dev/dri:/dev/dri
        environment:
            - SCRYPTED_WEBHOOK_UPDATE_AUTHORIZATION=Bearer REDACTED
            - SCRYPTED_WEBHOOK_UPDATE=http://localhost:10444/v1/update
        volumes:
            - ./scrypted_data:/server/volume
        network_mode: host
        restart: unless-stopped

I am able to see the live view for all the Unifi cameras (including the doorbell) from within the Alexa app.

Should the G4 be detected as a doorbell in the Alexa app? I'm not sure what logs would help or what would be the best way to collect logs that might help debug this but please let me know if you need any additional information.

The main feature I am after is having the doorbell view show up on my Echo Show devices after the doorbell is pressed which I am hoping is possible if the G4 is detected as a doorbell.

Thanks for any help on this and the hard work on Scrypted!

koush commented 1 year ago

be888d21

Might need to unlink and remove the doorbell and relink it.

alams154 commented 1 year ago

be888d2

Might need to unlink and remove the doorbell and relink it.

Unlink and remove the doorbell from UniFi? I've tried to remove and relink the doorbell from Scrypted and Alexa but that has not fixed the issue.

koush commented 1 year ago

Not sure then. @nberardi might know why its not popping up on the Echo Show.

nberardi commented 1 year ago

There technically is no difference, the Camera type and Doorbell type are only display types. However it appears there was a regression somewhere in the plugin that started identifying doorbells as cameras.

The main feature I am after is having the doorbell view show up on my Echo Show devices after the doorbell is pressed which I am hoping is possible if the G4 is detected as a doorbell.

You need to enable Doorbell Press Notifications in order for them to show up as a video feed on the Echo Shows.

koush commented 1 year ago

It looks like it has never been the Doorbell type:

https://github.com/koush/scrypted/commit/c85d45050fa2a75e79a0cb07c89e6cbb4963240d#diff-ad258a446da0bc78a3b40b82e5d3124649b8eeb9e6bf436dc6489884d6a51564

I made Doorbell the primary type with my change, but I am unsure that does anything.

I did notice that your refactor changed the order of capabilities, where the doorbell capability was previously first in the list. I wonder is maybe the issue?

Tbh I'm not sure if doorbell rings have ever worked. I figured it was just the Doorbell Press Ntoficiation as you mentioned.

koush commented 1 year ago

Specifying only the DOORBELL type makes it unviewable in the Alexa app. Must specify both Doorbell and Camera.

alams154 commented 1 year ago

Sorry, I made you go on a wild goose chase. It completely went over my head that you had posted a commit in your first reply so I didn’t even try relinking after the update to the Alexa plugin. The doorbell and camera function of the G4 are now working. I won’t be home until Thursday to test the Echo Show functionality but I’m betting that will work now.

Sorry again and thanks for the quick fix for the issue.

nberardi commented 1 year ago

Doorbell rings do work, the type is only for display purposes. We define the namespace Alexa.DoorbellEventSource which is what enables the Doorbell Press Notification in the Alexa app. Which sends through a ring event from the BinarySensor.

We also define both display categories, first DOORBELL, secondly CAMERA. I can check internally, but my guess is because the CAMERA type is being defined, and customers would expect to see the doorbell in their security cameras. That they are prioritizing the CAMERA type over DOORBELL.