pergolafabio / Hikvision-Addons

Home Assistant: Hikvision Doorbell
188 stars 41 forks source link

Get doorbell button press state change #235

Open sesardelaisla opened 6 days ago

sesardelaisla commented 6 days ago

Is there an existing feature request for this?

Add-on

Doorbell

Your feature request

Hello,

Would it be possible to get some sort of status/entity change when the doorbell BUTTON is pushed, regardless of the calling state? What I would like to achieve is to have some sort of "silent" notification or partial DnD mode. The idea is to enable a "disabled" schedule/template in the doorbell so no calls are executed according to https://github.com/pergolafabio/Hikvision-Addons/issues/231. Caller will hear the "not available" message upon button press. However, selected doorbell users could get a push notification through an automation, so they can call the doorbell back if they really want to respond. A SIP dashboard card would work great for this, because the notification could actionable and have an URI to call the doorbell on the fly.

pergolafabio commented 6 days ago

hmm, not sure if that will work, if you hear a "not avaible" message, it means the outdoor unit isnt able to call something, and i dont think there is any event then logged ... you could maybe setup the sip script at scheduled times , so you dont have the "calling failed/unaavaible" message, that way the sensor / event is fired and you can start your automation

this script below, was intented to fake/simulate an indoor extensions, that register on your primary indoor station, but you can change it , so it can register on your outdoor station at the time intervals you need... but remember, if the script is activated, it wont be able to call your real indoor station/hikconnect ...

https://github.com/pergolafabio/Hikvision-Addons/blob/main/asterisk/hikvision_register.py

pergolafabio commented 6 days ago

use this sip nr 10010110001 as username instead of the 10000000005 as in the script 10010110001 is the sip number from your indoor extension (faked) also change line 69 , change 5061 to 5060 ... the hikvision devices are hardcoded to send the invite back to port 5060 , so then your script intercepts the incoming call too , you can then trigger an sensor ...

pergolafabio commented 6 days ago

in example 0.17 is the IP from your OS, where you run the script on, 0.71 should be your outdoor station

sesardelaisla commented 6 days ago

Interesting workaround... Will check that fake indoor panel approach to see whether I can achieve what I want. Will share feedback if I move forward. Thanks!