home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.73k stars 30.46k forks source link

Reolink integration not showing doorbell notification for Reolink Doorbell #87134

Closed Kepro closed 1 year ago

Kepro commented 1 year ago

The problem

Reolink integration not showing the camera as a doorbell in the home kit integration,

image

The more likely question is, if this integration should provide automatically linked_doorbell_sensor (from https://www.home-assistant.io/integrations/homekit/#linked_doorbell_sensor) or if this integration can provide it automatically 🤔

if nope, should we update documentation? (I can do that)

What version of Home Assistant Core has the issue?

2023.2.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Reolink

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

diagnostic log config_entry-homekit-0b91fabfe70646541ef30e334922d2b2.json.txt

you can see that linked_motion_sensor is there but not linked_doorbell_sensor

home-assistant[bot] commented 1 year ago

Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (homekit) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `homekit` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign homekit` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


homekit documentation homekit source (message by IssueLinks)

Kepro commented 1 year ago

ah, bot picked Homekit instead of Reolink... ping @starkillerOG

starkillerOG commented 1 year ago

@Kepro the "Visitor" binary sensor are the doorbell presses, so you can use that entity_id to configure it in YAML.

@bdraco I know nothing about HomeKit, is it possible to set the linked_doorbell_sensor automatically? Do I have to set some sort of device class or something in the reolink integration code to let HomeKit recognize the correct binary sensor?

Kepro commented 1 year ago

Hey @starkillerOG thanks for reply, yeah I was digging into homekit/reolink integration, but as I was using "UI" integration rather than YAML, but yeah after 2 hours I ended up with YAML :)

but yeah I'm pointing this out because people will "expect" to work it out of the box, so any help from code or even from documentation will help... :-) both of you great work btw!

- name: Doorbell
  port: 21066
  mode: accessory
  filter:
    include_entities:
      - camera.doorbell_sub
  entity_config:
    camera.doorbell_sub:
      support_audio: true
      linked_motion_sensor: binary_sensor.doorbell_motion
      linked_doorbell_sensor: binary_sensor.doorbell_visitor
smarthomejunkie commented 1 year ago

I can confirm that the visitor entity is not reliable. When someone pushes the doorbell button, the visitor entity sometimes turns to "on", but most of the time it does not respond. Also, the visitor-detected trigger does not work because of this. This worked fine in the HACS integration that I used before.

I had the HACS integration and the official integration installed simultaneously and removed the HACS integration because entities were shown double. Not sure if that has something to do with this behavior.

starkillerOG commented 1 year ago

@smarthomejunkie can you tell me more about your configuration: Wifi or PoE doorbell? Which firmware version? direct connection or connected to NVR? If NVR, connected to which channel and what is the NVR firmware?

The custom reolink integration or ONVIF integration can interfer with the pushes, please only use the official reolink integration when testing and reboot HomeAssistant if you removed a custom integration.

smarthomejunkie commented 1 year ago

@smarthomejunkie can you tell me more about your configuration: Wifi or PoE doorbell? Which firmware version? direct connection or connected to NVR? If NVR, connected to which channel and what is the NVR firmware?

The custom reolink integration or ONVIF integration can interfer with the pushes, please only use the official reolink integration when testing and reboot HomeAssistant if you removed a custom integration.

I use the WiFi version with the latest firmware v3.0.0.1459_22102806 I connected it directly to HA. The custom integration is removed a couple of days ago and I rebooted HA multiple times after that. I will try to remove the integration, reboot HA and reinstall the integration.

smarthomejunkie commented 1 year ago

Okay, I removed the official integration, rebooted HA and installed the official integration again and I can confirm that that solved the issue.

starkillerOG commented 1 year ago

@smarthomejunkie good to hear it is working for you now.

If you appreciate the reolink integration and want to support its development, please consider sponsering the upstream library.

smarthomejunkie commented 1 year ago

@smarthomejunkie good to hear it is working for you now.

If you appreciate the reolink integration and want to support its development, please consider sponsering the upstream library.

Done ;)

starkillerOG commented 1 year ago

Thank you so much!, you are my first monthly sponsor :)

smarthomejunkie commented 1 year ago

Thank you so much!, you are my first monthly sponsor :)

I know how important that is. I am dependent on sponsorships myself.

avdgaag1984 commented 1 year ago

I have this problem too. I use the official integration of Reolink. All sensors work except the visitor. It just doesn't respond, removed the integration several times, but this doesn't want to solve it. I have had the reolink at home for a week, at first I couldn't get it to work via Hacs either. All Hacs integrations related to Reolink are no longer there. It is not the Reolink itself, since their app neatly gives the notifications.

home-assistant[bot] commented 1 year ago

reolink documentation reolink source

bdraco commented 1 year ago

@Kepro the "Visitor" binary sensor are the doorbell presses, so you can use that entity_id to configure it in YAML.

@bdraco I know nothing about HomeKit, is it possible to set the linked_doorbell_sensor automatically?

Do I have to set some sort of device class or something in the reolink integration code to let HomeKit recognize the correct binary sensor?

If the binary sensor has device class occupancy and it's on the same device as the camera it will automatically get picked up

avdgaag1984 commented 1 year ago

@Kepro the "Visitor" binary sensor are the doorbell presses, so you can use that entity_id to configure it in YAML. @bdraco I know nothing about HomeKit, is it possible to set the linked_doorbell_sensor automatically? Do I have to set some sort of device class or something in the reolink integration code to let HomeKit recognize the correct binary sensor?

If the binary sensor has device class occupancy and it's on the same device as the camera it will automatically get picked up

Do you have an example how i can configured this?

Kepro commented 1 year ago

@avdgaag1984 you can do it as I done it

- name: Doorbell
  port: 21066
  mode: accessory
  filter:
    include_entities:
      - camera.doorbell_sub
  entity_config:
    camera.doorbell_sub:
      support_audio: true
      linked_motion_sensor: binary_sensor.doorbell_motion
      linked_doorbell_sensor: binary_sensor.doorbell_visitor

rest is for @starkillerOG to implement it to reolink integration, thanks @bdraco for info!

avdgaag1984 commented 1 year ago

@avdgaag1984 you can do it as I done it

- name: Doorbell
  port: 21066
  mode: accessory
  filter:
    include_entities:
      - camera.doorbell_sub
  entity_config:
    camera.doorbell_sub:
      support_audio: true
      linked_motion_sensor: binary_sensor.doorbell_motion
      linked_doorbell_sensor: binary_sensor.doorbell_visitor

rest is for @starkillerOG to implement it to reolink integration, thanks @bdraco for info!

Okay Thanks, should just stand? And that port number where do I get it from

Kepro commented 1 year ago

@avdgaag1984 please follow official documentation https://www.home-assistant.io/integrations/homekit/ or wait for fix/implementation :-)

avdgaag1984 commented 1 year ago

@avdgaag1984 please follow official documentation https://www.home-assistant.io/integrations/homekit/ or wait for fix/implementation :-)

I think I misread, I don't have homekit running on my home assistant. But I do have problems with my visitor sensor :(

smarthomejunkie commented 1 year ago

I have this problem too. I use the official integration of Reolink. All sensors work except the visitor. It just doesn't respond, removed the integration several times, but this doesn't want to solve it. I have had the reolink at home for a week, at first I couldn't get it to work via Hacs either. All Hacs integrations related to Reolink are no longer there. It is not the Reolink itself, since their app neatly gives the notifications.

The HACS integrations are still there. You might have to add the repository to HACS first in your case. It's this one: https://github.com/JimStar/reolink_cctv

But, the official integration does work on my side now. Not sure why it's not working on yours.

yaggermr commented 1 year ago

Home Assistant 2023.2.2 Supervisor 2023.01.1 Operating System 9.5 Frontend 20230202.0 - latest

Reolink Wi-FI Doorbell Firmware v3.0.0.1459_22102806 Running through the NVR or Standalone the visitor doesn't report on state. I have tried removing the addon rebooting and readding it but I still don't get Visitor update on state. I will try the hacs version and report if that works to report Visitor state. Thanks for working on the Reolink Integration.

It also fails to report for me using https://github.com/JimStar/reolink_cctv Hacs integrations it simply shows as off or unavailable

starkillerOG commented 1 year ago

If the binary sensor has device class occupancy and it's on the same device as the camera it will automatically get picked up

@bdraco but that would mean the states will show in the UI as occupied and not occupied instead of on and off right? I personnaly think those states would be a bit weird for a doorbell press...

Kepro commented 1 year ago

@starkillerOG well answer it again :D on / off for the visitor is still "somebody is on your front door and pressed the bell" so it's more likely occupancy rather than on/off state no?

starkillerOG commented 1 year ago

@Kepro sure, I will change it to occupancy, I don't have strong fealings about it.

PR to implement the device class is here: https://github.com/home-assistant/core/issues/87134

bdraco commented 1 year ago

If the binary sensor has device class occupancy and it's on the same device as the camera it will automatically get picked up

@bdraco but that would mean the states will show in the UI as occupied and not occupied instead of on and off right?

I personnaly think those states would be a bit weird for a doorbell press...

Yes. That's is historically what has been used for doorbells in all the other integrations.

starkillerOG commented 1 year ago

@avdgaag1984 could you provide some extra info about your setup: Doorbell Wifi or POE? Direct connection or through NVR? Firmware version of doorbell (and if applicaple NVR)? Do you use HTTP or HTTPS for the local connection to HomeAssistant? What URL do you have configured under settings->system->network->Home Assistant URL->local network?

starkillerOG commented 1 year ago

@yaggermr alright you do seem to have the latest firmware version of the wifi doorbell. The visitor sensor of the doorbell will not work when connected to a NVR on the latest released NVR firmware. Beta NVR firmware v3.0.0.211_23011204 fixes this issue, you can request beta firmware from reolink support, release firmware is expected in a few weeks. (stated in the reolink homeassistant docs).

When connecting the Wifi doorbell directly to HomeAssistant on the latest firmware it can work. Probably the webhook pushes are not comming through correctly: What URL do you have configured under settings->system->network->Home Assistant URL->local network?

avdgaag1984 commented 1 year ago

@avdgaag1984 could you provide some extra info about your setup: Doorbell Wifi or POE? Direct connection or through NVR? Firmware version of doorbell (and if applicaple NVR)? Do you use HTTP or HTTPS for the local connection to HomeAssistant? What URL do you have configured under settings->system->network->Home Assistant URL->local network?

can is change a setting when i want both (http and https) ?

Kepro commented 1 year ago

I would say just use automatic, using https in local (home) network is not necessary

avdgaag1984 commented 1 year ago

I would say just use automatic, using https in local (home) network is not necessary

When i put the setting on Automatic i can not add the integration of reolink. i get than an error

And the network give this error:

image

starkillerOG commented 1 year ago

@avdgaag1984 the problem is the https. Reolink products can not deal with https, so the reolink doorbell fails to call the HomeAssistant webhook because it cannot send the message to the https webhook url. To make it work you will have to be using a HTTP local connection. (You can use HTTPS for internet connection of course)

starkillerOG commented 1 year ago

@avdgaag1984 this PR https://github.com/home-assistant/core/pull/87332 will implement a way for the reolink integration to automatically notify people if they use a HTTPS local connection which is incompatible with reolink push notifications.

avdgaag1984 commented 1 year ago

@avdgaag1984 the problem is the https. Reolink products can not deal with https, so the reolink doorbell fails to call the HomeAssistant webhook because it cannot send the message to the https webhook url. To make it work you will have to be using a HTTP local connection. (You can use HTTPS for internet connection of course)

But the motion and person sensor do work via https. How can I make an http connection in home assistant?

mhoogenbosch commented 1 year ago

Following this thread, my issue was the HTTPS portion too. I have both internally and externally configured my HA to respond to a FQDN with a valid certificate.

I changed this, reinstalled the integration and it worked. Hopefully there are no downsides to changing the internal address.

Thanks.

avdgaag1984 commented 1 year ago

Following this thread, my issue was the HTTPS portion too. I have both internally and externally configured my HA to respond to a FQDN with a valid certificate.

I changed this, reinstalled the integration and it worked. Hopefully there are no downsides to changing the internal address.

Thanks.

How do you do this in your certifcate? I am not a hero with certificates

mhoogenbosch commented 1 year ago

Following this thread, my issue was the HTTPS portion too. I have both internally and externally configured my HA to respond to a FQDN with a valid certificate. I changed this, reinstalled the integration and it worked. Hopefully there are no downsides to changing the internal address. Thanks.

How do you do this in your certifcate? I am not a hero with certificates

I'm using a free certificate of Let's Encrypt, my nginx proxy manager is doing the renewals and does the reverse proxy functionality. My internal DNS just points to the internal IP of the ngix and externally port 443 is redirected to the reverse proxy too. So basically HA isn't doing anything with certificates, all is handled by my reverse proxy.

avdgaag1984 commented 1 year ago

Following this thread, my issue was the HTTPS portion too. I have both internally and externally configured my HA to respond to a FQDN with a valid certificate. I changed this, reinstalled the integration and it worked. Hopefully there are no downsides to changing the internal address. Thanks.

How do you do this in your certifcate? I am not a hero with certificates

I'm using a free certificate of Let's Encrypt, my nginx proxy manager is doing the renewals and does the reverse proxy functionality. My internal DNS just points to the internal IP of the ngix and externally port 443 is redirected to the reverse proxy too. So basically HA isn't doing anything with certificates, all is handled by my reverse proxy.

I dont understand this. I have also a Let's Encrypt Certificate and my dns i have don it with duckdns

avdgaag1984 commented 1 year ago

@avdgaag1984 the problem is the https. Reolink products can not deal with https, so the reolink doorbell fails to call the HomeAssistant webhook because it cannot send the message to the https webhook url. To make it work you will have to be using a HTTP local connection. (You can use HTTPS for internet connection of course)

But why the motion and person sensors works with https? And the visitor not? Can Only the visitor not handle with https?

starkillerOG commented 1 year ago

@avdgaag1984 motion and person are also polled every 60 seconds, visitor can not yet be polled in latest release firmware (it can in beta firmware and will be polled in the future). However when relying on polling, it will be slow and you will miss a lot of events.

If you turn on debug logging for the reolink integration you can see the ONVIF events beeing received to check if the webhook is working. If you see a info log with "Reolink ONVIF event channel....." then the webhook is working.

avdgaag1984 commented 1 year ago

ONVIF

As soon as I press the doorbell, I don't see anything in the log about it. I find this a difficult problem since I can't manage to get this working via http. Is there a clear explanation available somewhere on how I can solve this?

starkillerOG commented 1 year ago

@avdgaag1984 For the reolink integration the local network url must be http in order for the component to work properly.

I don't now much about how to properly configure the HomeAssistant Network setup. I can only tell you how I have things setup: I did not configure a HTTPS certificate in HomeAssistant itself. I have http://192.168.x.xxx:8123/ as the local address I have https://....duckdns-adress... as internet address

Then I have the the Duck DNS addon to update my duckdns IP adress Then I have the Nginx Proxy Manager addon configured to only allow https external connections to my HomeAssistant with a letsencrypt certificate.

I cant tell you any more, you could try the HomeAssistant documentation, form or chat for network configuration support.

avdgaag1984 commented 1 year ago

Nginx Proxy Manager

Do you have some screenshots of this, i have als a certficate of Let's Encrypt and i use duckdns. How do you configured this in nginx Proxy Manager?

starkillerOG commented 1 year ago

see https://theprivatesmarthome.com/how-to/set-up-nginx-proxy-manager-in-home-assistant/

avdgaag1984 commented 1 year ago

see https://theprivatesmarthome.com/how-to/set-up-nginx-proxy-manager-in-home-assistant/

Thanks for the link, will take a look at this. See that at some point you have to create a certificate. Can't I use my current certificate for this

mhoogenbosch commented 1 year ago

see https://theprivatesmarthome.com/how-to/set-up-nginx-proxy-manager-in-home-assistant/

Thanks for the link, will take a look at this. See that at some point you have to create a certificate. Can't I use my current certificate for this

You mentioned you are using Let's encrypt. If you would use the proxy manager functionality (https://nginxproxymanager.com/) which has a seriously easy docker config, it does the requests to Let-s encrypt for you. Then there is no reason to reuse old 3-month valid let-s encrypt certicates.

avdgaag1984 commented 1 year ago

I have installed the NGINX Home Assistant SSL proxy addon, i can now access my home assistant with http. But i can not access with https What i am doing wrong

avdgaag1984 commented 1 year ago

I have also try the nginx proxy manager I have followd the manual, maria DB won't started and de Nginx proxy manager won't started. But i can login to the nginx proxy manager

image

avdgaag1984 commented 1 year ago

I have installed the NGINX Home Assistant SSL proxy addon, i can now access my home assistant with http. But i can not access with https What i am doing wrong

I have it done again i see the addon is not starting. I have checked the logs, i can not see an error

image

image

avdgaag1984 commented 1 year ago

I have installed the NGINX Home Assistant SSL proxy addon, i can now access my home assistant with http. But i can not access with https What i am doing wrong

I have it done again i see the addon is not starting. I have checked the logs, i can not see an error

image

image

I have fix it, NGINX is now running and the Reolink Doorbell is working.