tomasbedrich / home-assistant-hikconnect

A Home Assistant integration to communicate with Hikvision smart doorbells via Hik-Connect cloud.
40 stars 9 forks source link

No Entities Created #15

Closed King-Cole closed 2 years ago

King-Cole commented 2 years ago

Hi, glad to see such an integration being worked on!

Wanted to offer my two cents that installation was a breeze, but once the Integration was added, it found two devices (both with the name of my device as given in the the Hik Connect app) but offers no entities for them. I am using a HikVision DS-HD1.

blubkens commented 2 years ago

Same here, 2 devices but no entities.

tomasbedrich commented 2 years ago

Hi, thanks for your report. Can you both please follow the debugging guide and send me the details so that I can verify what's happening on your side? Thanks

peteshoard commented 2 years ago

What entities should be created?

I have 8 Camera Channels, 2 of those are doorbells, one door lock and other things like line crossing detection etc... should these be showing up - the only thing that has an entity is the lock.

Thanks

blubkens commented 2 years ago

I’m using an EZVIZ DB1 with HikVision firmware. Do you still want me to debug?

tomasbedrich commented 2 years ago

@peteshoard that is a great question actually.

The integration is currently expected to create only lock entities, nothing else. So if you have cameras, PIRs, etc.. None of these are supported yet.

That applies to @King-Cole and @joopjuh too: if you have remotely controllable locks available in your Hikconnect app and they are not available using this integration, it is a bug (then please follow the debugging guide). If you have other types of devices, then it is a feature request (then please provide more details on what do you request).

King-Cole commented 2 years ago

Hi @tomasbedrich, thanks for elaborating. Yes, I'm in the same boat as joopjuh with an EZVIZ DB1 doorbell flashed with HikVision firmware. From the app we are able to perform actions like arming/disarming the doorbell camera (to record events that happen when an individual gets close), see the last event (person to walk close to the camera), and receive calls when the doorbell is pressed. So far, the only way anyone has been able to get this last feature to work in Home Assistant is via a PowerShell script that watches the network logs for the doorbell to try and call out. I'm sure it is likely a challenge, but to capture such an event via your integration would be a windfall!

tomasbedrich commented 2 years ago

@King-Cole thanks for detailed description. To be absolutely clear: do you have an electronic lock, which can be unlocked using Hikconnect app and it doesn't show up in Home Assistant?

If you can point me to resources about watching network logs, that would be nice. Thank you.

leeandy1 commented 2 years ago

@King-Cole I'm following this also as I have the EZVIZ DB1. I am still using the original firmware from EZVIZ and my device is connected to a Hikvision NVR and the Hik-Connect app. It works as expected with 24h recording to the NVR if required and I get call and motion notifications through the cloud on Hik-Connect. It would be great if @tomasbedrich could get these notification into Home Assistant somehow.

tomasbedrich commented 2 years ago

Hi @leeandy1, I'm sorry but it is practically impossible for me to implement such feature without me having a physically same device in my hands. Only if you are comfortable with Wireshark / Fiddler and can capture traffic from Hikconnect app for me. Then I can possibly try to implement that in Python according to a PCAP file.

blubkens commented 2 years ago

Hi Tomas,

Exactly what @leeandy1 describes, we can basically do everything with the device but just not capture the button press. I've been searching around and found the following solution which i think @King-Cole uses to capture it via network log. https://community.home-assistant.io/t/getting-ezviz-db1-or-hikision-or-lacie-doorbell-presses/250884

#! /bin/bash tail -fn0 /PATHTOTHEPIHOLELOG/pihole.log|while read;do echo "$REPLY"|grep -q "alarm.eu.s3.amazonaws.com" && curl -X POST -H "Authorization: Bearer LONGLIVEDACCESSTOKENFROMHOMEASSISTANT" -H "Content-Type: application/json" -d '{"entity_id": "switch.THENAMEOFYOURDOORBELLINHOMEASSISTANT"}' http://HOMEASSISTANTIP:8123/api/services/switch/turn_on;done

If you are able to capture the alarm.eu.s3.amazonaws.com with python that would be the solution, i think. My programming skills is far from good so i might make it sound like something super easy. Anyway, i understand if this would be a stretch to far for this plugin.

The following models are basically the same but different branding and firmware. HIKVISION (DS-HD1), RCA (HSDB2A), EZVIZ (DB1), LAVIEW (LV-PDB1630-U), NELLY'S (NSC-DB2), LTS (LTH-7132-WIFI) I've used the following link for more information about the doorbell. https://ipcamtalk.com/threads/new-rca-hsdb2a-3mp-doorbell-ip-camera.31601/page-101

Let me know if this helps. And ofcourse thanks in advance for putting any time into this! Cheers.

pergolafabio commented 2 years ago

just for info, you can also use the SDK script to test capture/motion events, it connects directly to doorbell on port 8000

then no need for cloud

https://github.com/laszlojakab/hikvision-intercom-python-demo

blubkens commented 2 years ago

just for info, you can also use the SDK script to test capture/motion events, it connects directly to doorbell on port 8000

then no need for cloud

https://github.com/laszlojakab/hikvision-intercom-python-demo

I'm already using ONVIF to capture motion events, however when i go outside to take out the trash it will trigger motion. Currently i set up motion to trigger TTS to speakers and send picture to Android TV. So it is not the ideal setup as not every movement at the front door is a visitor.

tomasbedrich commented 2 years ago

@joopjuh that is an interesting knowledge, but doesn't help anyhow to this integration. This integration is focused on Hik-Connect cloud-based communication only, because in some scenarios it's impossible to communicate on the same LAN with the Hikvision device.

The expert on local connections is @pergolafabio. :)

tomasbedrich commented 2 years ago

Everyone, to wrap it up – sorry to say that, but the features you request are out of scope of this integration.

As a learning from this discussion, I have updated a README (e5d19ac425d17cfcc8533a7d0b8b65416abeab62) to set clear expectations about the scope and features which one may expect to be available.

Closing this issue for now. Feel free to re-open if there is an actual bug that no entities are created and they should be according to README.