pergolafabio / Hikvision-Addons

Home Assistant: Hikvision Doorbell
179 stars 41 forks source link

2 Way Audio not working in Frigate Card #184

Open Daz42 opened 8 months ago

Daz42 commented 8 months ago

What happened?

Not an issue with the Hikvision Camera Integration - however I was unable to consistently get 2 way audio from the Frigate card for the Hikvision Camera Integration. This is an issue being dealt with but in the meantime we are using the web-rtc card which works but slightly clunky.

Add-on

Hikvision Doorbell

What version of the add-on are you running?

3.0.14

Installation type

Home Assistant add-on

Relevant log output

No response

Relevant configuration

No response

Anything else?

No response

Daz42 commented 8 months ago

I would like to add a guide for those wanting to get their Hikvision doorbell working with the web-rtc card complete with mp3 playback. Eventually it will be updated for the Frigate card when 2 way audio is resolved with it. Home Assistant Hikvision Doorbell (for web) As-Built v1.0.docx

pergolafabio commented 8 months ago

Great guide , not sure if I need to combine it or not... Gonna wait for the frigate updates first, because that card is nicer indeed... Also next update doesn't require frigate add-on/integration...

Just question, why do you have the camera defined 2 times in go2rtc , why not use the first one for the mp3 also?

Daz42 commented 8 months ago

I tried using the first one but could not get the mp3 to play for the life of me. When I defined it again but with channel 102 it works reliably every time. Also another weirdness, when I update webrtc-camera to version 3.5.1 then I start having issues with mp3 playback and intermittent 2 way audio. I'm on master which is working but obviously should move on once I find out why it's playing up!

TokarevSergey commented 7 months ago

You managed to solve the problem. I have a Hikvision camera and doorbell. The problem was this. At first there was sometimes intermittent two-way communication. And now when I press the microphone, the sound disappears.

pergolafabio commented 5 months ago

ok, found the issue!!

https://github.com/dermotduffy/frigate-hass-card/issues/1356 fixed in this: https://github.com/AlexxIT/go2rtc/pull/967 https://github.com/AlexxIT/go2rtc/issues/962

The issue that two way audio isnt working the second time, is that the "close" command is not being used in the go2rtc addon, it will be implemlented later!!

for now i send the command below, right after you do the answer/hangup and before pressing the mic button, this makes the previous twoway audio close first...

"curl -i --digest -u admin:XXXX-X PUT http://192.168.0.70/ISAPI/System/TwoWayAudio/channels/1/close"

I keep this one open, untill a new go2rtc addon is released!!

TokarevSergey commented 5 months ago

Thank you

pergolafabio commented 5 months ago

update 1.9.0 is released, but seems the issue is still present, i still send the curl , before i start two way audio

TokarevSergey commented 5 months ago

Thank you. I'm really looking forward to the fix.

pergolafabio commented 5 months ago

Same, but the curl is working great!!

TokarevSergey commented 4 months ago

ок, нашел проблему!!

dermotduffy/frigate-hass-card#1356 исправлено здесь: AlexxIT/go2rtc#967 AlexxIT/go2rtc#962

Проблема, из-за которой двусторонняя аудиосвязь не работает во второй раз, заключается в том, что команда «закрыть» не используется в аддоне go2rtc, она будет реализована позже!

на данный момент я отправляю команду ниже, сразу после того, как вы ответите/повесите трубку и перед нажатием кнопки микрофона, это сначала закроет предыдущую двустороннюю аудиосвязь...

"curl -i --digest -u admin:XXXX-X PUT http://192.168.0.70/ISAPI/System/TwoWayAudio/channels/1/close"

Я оставляю этот вопрос открытым, пока не выйдет новый аддон go2rtc!!

Добрый вечер не могу заставить это работать. У вас получилось. Я делаю в файле configuration.yaml запись shell_command: doorbelltvaoff: curl -i --digest -u admin:ST008855h PUT http://10.0.0.11/ISAPI/System/TwoWayAudio/channels/1/close и запускаю ее с помошью скрипта звук вске равно прерывистый. Подскажите может я чтото не так понял.

pergolafabio commented 4 months ago

I do this in the frigate card for my "phone/answer" button:

            - type: custom:frigate-card-menu-icon
              icon: mdi:phone
              tap_action:
                - action: call-service
                  service: script.answer_call
                - action: custom:frigate-card-action
                  frigate_card_action: unmute
                - action: custom:frigate-card-action
                  frigate_card_action: microphone_unmute

First i do the script, to make my answer+hangup+close audio Then i do the frigate unmute functions for mic/audio

This is my script:

answer_call:
  alias: Deur open answer call
  sequence:
  - service: button.press
    entity_id: button.ds_kh9510_answer_call
  - delay: 
      milliseconds: 500
  - service: button.press
    entity_id: button.ds_kh9510_hangup_call
  - service: shell_command.hikvision_close_audio

and my shell command is:

hikvision_close_audio: "curl -i --digest -u admin:XXXXX-X PUT http://192.168.0.70/ISAPI/System/TwoWayAudio/channels/1/close"

TokarevSergey commented 4 months ago

hikvision_close_audio: "curl -i --digest -u admin:XXXXX-X PUT http://192.168.0.70/ISAPI/System/TwoWayAudio/channels/1/close"

hikvision_close_audio: "curl -i --digest -u admin:XXXXX -X PUT http://192.168.0.70/ISAPI/System/TwoWayAudio/channels/1/close" A space was missing before -X, is this correct?

pergolafabio commented 4 months ago

correct

TokarevSergey commented 4 months ago

правильный

Damn, nothing works. All the same, the sound gets quieter and then starts to break up if I log in several times and go to the card with a microphone.

type: custom:webrtc-camera url: DoorBellCh2 mode: webrtc media: video, audio, microphone muted: false style: 'video {aspect-ratio: 16/9; object-fit: fill;}'

Only reloading the Go2rtc configuration helps

TokarevSergey commented 4 months ago

I do this in the frigate card for my "phone/answer" button:

            - type: custom:frigate-card-menu-icon
              icon: mdi:phone
              tap_action:
                - action: call-service
                  service: script.answer_call
                - action: custom:frigate-card-action
                  frigate_card_action: unmute
                - action: custom:frigate-card-action
                  frigate_card_action: microphone_unmute

First i do the script, to make my answer+hangup+close audio Then i do the frigate unmute functions for mic/audio

This is my script:

answer_call:
  alias: Deur open answer call
  sequence:
  - service: button.press
    entity_id: button.ds_kh9510_answer_call
  - delay: 
      milliseconds: 500
  - service: button.press
    entity_id: button.ds_kh9510_hangup_call
  - service: shell_command.hikvision_close_audio

and my shell command is:

hikvision_close_audio: "curl -i --digest -u admin:XXXXX-X PUT http://192.168.0.70/ISAPI/System/TwoWayAudio/channels/1/close"

So how is everything right? hikvision_close_audio: "curl -i --digest -u admin:XXXXX-X PUT http://192.168.0.70/ISAPI/System/TwoWayAudio/channels/1/close"

hikvision_close_audio: "curl -i --digest -u admin:XXXXX -X PUT http://192.168.0.70/ISAPI/System/TwoWayAudio/channels/1/close"

pergolafabio commented 4 months ago

yeah thats why i do

TokarevSergey commented 4 months ago

admin:XXXXX-X PUT

admin:XXXXX-X PUT admin:XXXXX -X PUT