Hikvision-Addons icon indicating copy to clipboard operation
Hikvision-Addons copied to clipboard

2 Way Audio not working in Frigate Card

Open Daz42 opened this issue 1 year ago • 17 comments

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 avatar Feb 05 '24 17:02 Daz42

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

Daz42 avatar Feb 05 '24 17:02 Daz42

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?

pergolafabio avatar Feb 05 '24 17:02 pergolafabio

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!

Daz42 avatar Feb 05 '24 18:02 Daz42

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.

TokarevSergey avatar Mar 05 '24 16:03 TokarevSergey

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!!

pergolafabio avatar Apr 24 '24 07:04 pergolafabio

Thank you

TokarevSergey avatar Apr 29 '24 20:04 TokarevSergey

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

pergolafabio avatar Apr 30 '24 15:04 pergolafabio

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

TokarevSergey avatar Apr 30 '24 15:04 TokarevSergey

Same, but the curl is working great!!

pergolafabio avatar Apr 30 '24 15:04 pergolafabio

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

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 и запускаю ее с помошью скрипта звук вске равно прерывистый. Подскажите может я чтото не так понял.

TokarevSergey avatar May 13 '24 18:05 TokarevSergey

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"

pergolafabio avatar May 13 '24 19:05 pergolafabio

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?

TokarevSergey avatar May 21 '24 08:05 TokarevSergey

correct

pergolafabio avatar May 21 '24 08:05 pergolafabio

правильный

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 avatar May 21 '24 09:05 TokarevSergey

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"

TokarevSergey avatar May 21 '24 09:05 TokarevSergey

yeah thats why i do

pergolafabio avatar May 21 '24 10:05 pergolafabio

admin:XXXXX-X PUT

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

TokarevSergey avatar May 21 '24 10:05 TokarevSergey