2 Way audio Intercom for Reolink doorbell made easy

Hi, Thanks to @victorigualada and all the comments above I have managed to get this set up. There are a few problems I have not been able to solve…

  1. The first popup to appear (camera feed without audio) has a header “Front Door Fluent” which I have not been able to remove.
  2. There is a 3-7 second delay between answering on the first popup and the second popup with audio appearing.
  3. The auto response button does not work. - I did manage to get one of the pregenerated reolink auto responses to play by taking control and editing the yaml, but ideally I would be able to programme my own responses.
  4. The audio continues feeding from the doorbell to the tablet after the popup is closed. I can see this was mentioned in some of the more recent comments from @Linux85 and @dcapslock and others but I count not tell if there was a solution to this.

If anyone can help me out with any of the above it would be greatly appreciated, I am still fairly new to HA and have been trying to use LLMs to help me at points but as mentioned in the comments above they are not great at this. Thanks again.

Background: Recently I have addressed a similar issue with the standard more-info dialog and how it is closed with Browser Mod. There is now (beta) a close option in browser_mod.more_info to close the dialog rather directly rather than relying on empty entity, which mitigates this issue for more-info.

I believe there are similar issues here. It has to do with the way the Home Assistant dialog manager manages reusing the same dialog element in that to make sure its on top it reappends the element, which means a disconnect and reconnect to the DOM. This then can cause wierd issues like audio stream staying connected.

To verify this, I would expect that if you don’t ‘answer’ then there would be no audio issue after ‘hangup’ on teh first popup. It is only when you ‘answer’, and the popup is ‘reused’, that there will be an issue.

The workaround should be to use a Browser Mod sequence to close the popup before opening the new popup. So L76 of Blueprint Gist you would use a sequence, something like…

            tap_action:
              action: call-service
              service: browser_mod.sequence
              service_data:
                browser_id: !input browser_ids
                sequence:
                  - service: browser_mod.close_popup
                  - service: browser_mod.delay # May not be needed, but might assist to allow any closure tasks to complete
                    data:
                      delay: 1 # ms
                  - service: browser_mod.popup # can leave out browser_id here as the sequence has targetted the browser(s)
                    data:
                      content:
                        type: picture-elements
                        # etc... 

If I may, I will leave to others to test and update as I don’t have a device, but happy to provide support.

1 Like

I may likely have done this wrong but this didn’t work for me.

Taking control of a fresh blueprint dosen’t give me the same layout as the Blueprint Gist link. As best I could tell the “tap action” line referenced here was on line 39, I inserted the following under my browser id on line 55:

                  - service: browser_mod.close_popup
                  - service: browser_mod.delay 
                    data:
                      delay: 1 
                  - service: browser_mod.popup 
                    data:
                      content:

Probably best if someone who knows what they are doing tests this but wanted to give my results anyway.

You are missing the change from updated call-service action being browser_mod.sequence

              action: call-service
              service: browser_mod.sequence
              service_data:
                browser_id: !input browser_ids
                sequence:
                  - service: browser_mod.close_popup
                  - service: browser_mod.delay 
                    data:
                      delay: 1 
                  - service: browser_mod.popup 
                    data:
                      content:

Sorry, yes I missed that change. Now the first popup closes when I press answer but the second popup dosent open at all.

chceck your indents after the changed code.

Apologies again for missing something obvious, I started again from a fresh blueprint, input the changed code and noticed that the indents did not match. I’m not sure what the correct way to resolve this would be. Would I move everything below across 6 spaces to match up?

            sequence:
              - service: browser_mod.close_popup
              - service: browser_mod.delay # May not be needed, but might assist to allow any closure tasks to complete
                data:
                  delay: 1 # ms
              - service: browser_mod.popup # can leave out browser_id here as the sequence has targetted the browser(s)
                data:
                  content:
                    type: picture-elements
            content:
              type: picture-elements
              card_mod: null
              style: |

Yes. And remove the 2 doubled up lines which I included to assist with alignment.

I included the doubled lines in the example because I wasn’t sure what to remove.
Originally I only added new code, without changing any indents.
I’ve tried moving the indents out by 6 spaces to various points below to match up but I still can’t get it to work. It wouldn’t save if I moved the entire code and if I moved the indents up to the end of a section of code it might let me save but the second popup wouldn’t open.
I’m really not experienced with this to know where I might be going wrong here, hopefully someone else will have better results.

DM me with your code and I can assist.

Thanks to @dcapslock the continuing audio problem has beens resolved. I don’t want to give confusing instuctions so hopefully he won’t mind explaining the fix.

I’m still hoping to find a solution to these other problems if possible;

  • The first popup to appear (camera feed without audio) has a header “Front Door Fluent” which I have not been able to remove.
  • There is a 3-7 second delay between answering on the first popup and the second popup with audio appearing.
  • The auto response button does not work. - I did manage to get one of the pregenerated reolink auto responses to play by taking control and editing the yaml, but ideally I would be able to programme my own responses.

so I managed to edit the blueprint and import it again, unfortunately I’m still having the audio issue after hanging up, I can still here the sound from the doorbell.

how did you solve it ? was adding the sequence enough ?

here is the blueprint

blueprint:
  name: 2-way audio doorbell popups
  description: Trigger a popup and perform actions when a visitor rings the doorbell with 2-way audio
  author: victorigualada
  domain: automation
  input:
    doorbell_sensor:
      name: Doorbell Sensor
      description: The binary sensor triggered when the doorbell is pressed.
      selector:
        entity:
          domain: binary_sensor
    browser_ids:
      name: Browser IDs
      description: List of Browser Mod IDs for displaying the popup.
      selector:
        device:
          multiple: true
          filter:
            - integration: browser_mod
    camera_entity:
      name: Camera Entity
      description: The camera to display in the popup. This should be the normal stream produced by the camera.
      selector:
        entity:
          domain: camera
    go2rtc_url:
      name: 2-way audio go2rtc stream
      description: The stream exposed by go2rtc that includes 2-way audio. This MUST match the stream name configured in go2rtc
      default: camera.2way_audio_doorbell
    open_gate_script:
      name: Open Gate Script
      description: The script to open the gate.
      default: null
      selector:
        entity:
          domain: script

trigger:
  - platform: state
    entity_id: !input doorbell_sensor
    from: "off"
    to: "on"

action:
  - service: browser_mod.popup
    data:
      size: normal
      browser_id: !input browser_ids
      style: |-
        ha-dialog {
          --mdc-dialog-min-width: 600px !important;
        }
        .content {
          width: auto !important;
        }
      content:
        type: picture-elements
        elements:
          # Pick-up button
          - type: icon
            style:
              left: 15%
              bottom: 0
              background-color: "#4CAF50"
              color: white
              padding: 14px
              font-size: 18px
              border: none
              border-radius: 50px
              display: inline-flex
              align-items: center
              cursor: pointer
              z-index: 1
            icon: mdi:phone
            tap_action:
              action: call-service
              service: browser_mod.popup
              service_data:
                size: wide
                dismissable: true
                style: |-
                  ha-dialog {
                    --mdc-dialog-min-width: 600px !important;
                  }
                  .content {
                    width: auto !important;
                  }
                browser_id: !input browser_ids
                sequence:
                  - service: browser_mod.close_popup
                  - service: browser_mod.delay
                    data:
                      delay: 1
                  - service: browser_mod.popup
                    data:
                      content:
                        type: picture-elements
                content:
                  type: picture-elements
                  card_mod:
                  style: |
                    #root { max-height: 436.65px }
                  elements:
                    - type: icon
                      icon: mdi:phone-off
                      tap_action:
                        action: call-service
                        service: browser_mod.close_popup
                      style:
                        left: 85%
                        bottom: 0
                        width: 20px
                        background-color: "#f44336"
                        color: white
                        padding: 14px
                        font-size: 18px
                        border: none
                        border-radius: 50px
                        display: inline-flex
                        align-items: center
                        cursor: pointer
                        z-index: 1
                    - type: icon
                      icon: mdi:lock-open
                      tap_action:
                        action: call-service
                        service: script.turn_on
                        service_data:
                          entity_id: !input open_gate_script
                      style:
                        left: 15%
                        bottom: 0
                        background-color: "#2196F3"
                        color: white
                        padding: 14px
                        font-size: 18px
                        border: none
                        border-radius: 50px
                        display: inline-flex
                        align-items: center
                        cursor: pointer
                        z-index: 1
                    - type: custom:webrtc-camera
                      ui: true
                      url: !input go2rtc_url
                      media: video,audio,microphone
                      mode: webrtc
                      style:
                        position: absolute
                        top: 50%
                        left: 50%
                        width: 100%
                        height: 100%
                      card_mod:
                        style: |
                          .fullscreen {display: none}
                          .screenshot {display: none}
                          .pictureinpicture {display: none}
                          video {aspect-ratio: 16/9}
                  image: https://upload.wikimedia.org/wikipedia/commons/c/ca/1x1.png
          # Hang-up button
          - type: icon
            style:
              left: 85%
              bottom: 0
              width: 20px
              background-color: "#f44336"
              color: white
              padding: 14px
              font-size: 18px
              border: none
              border-radius: 50px
              display: inline-flex
              align-items: center
              cursor: pointer
              z-index: 1
            icon: mdi:phone-off
            tap_action:
              action: call-service
              service: browser_mod.close_popup
          # Open door button
          - type: icon
            style:
              left: 50%
              bottom: 0
              background-color: "#2196F3"
              color: white
              padding: 14px
              font-size: 18px
              border: none
              border-radius: 50px
              display: inline-flex
              align-items: center
              cursor: pointer
              z-index: 1
            icon: mdi:lock-open
            tap_action:
              action: call-service
              service: script.turn_on
              service_data:
                entity_id: !input open_gate_script
          # Camera stream
          - type: custom:more-info-card
            entity: !input camera_entity
            style:
              position: absolute
              top: 50%
              left: 50%
              width: 100%
              height: 100%
              z-index: 0
            card_mod:
              style: |
                :host { padding: 0}
                .card-header { display: none;}
                .card-content { padding: 0; margin-top: 0 }
        image: https://upload.wikimedia.org/wikipedia/commons/c/ca/1x1.png
        card_mod:
          style: |
            #root { height: 420px }

  - wait_template: >-
      {{ states('!input doorbell_sensor') == 'off' }}
    timeout: "60"
    continue_on_timeout: true

  - service: browser_mod.close_popup
    data:
      browser_id: !input browser_ids

mode: single

You need to give a tag to the second popup as well.

...
      content:
        type: picture-elements
        elements:
          # Pick-up button
          - type: icon
            style:
              left: 15%
              bottom: 0
              background-color: "#4CAF50"
              color: white
              padding: 14px
              font-size: 18px
              border: none
              border-radius: 50px
              display: inline-flex
              align-items: center
              cursor: pointer
              z-index: 1
            icon: mdi:phone
            tap_action:
              action: call-service
              service: browser_mod.popup
              service_data:
                tag: answer-popup # <- add tag here. Can be anything
                size: wide
                dismissable: true
                style: |-
                  ha-dialog {
                    --mdc-dialog-min-width: 600px !important;
                  }
                  .content {
                    width: auto !important;
                  }
                browser_id: !input browser_ids
1 Like

thanks it works now !

I noticed tho that the after finishing the call, the first popup is still there, but closes up after few seconds, I don’t know if it has something to do with the browser_mod.delay we added, i tried to tweak it and remove it, it didn’t fix it, and the popup doesn’t close at all. so i put it back.

You may also try the original code with the addition of tag for second popup and forgo the sequence. It may work as well and to fix the audio lingering.

Hi today i asked you on discord to add me login jac… im would liek to thank you for providing that solution above. My setting is almost the same, got:

  1. HAOS
  2. Cloudflared
  3. Reolink D340B Videodorbell (WiFi version)
  4. Flull Kiosk Pro on old tablet (Huawei MediaTab T5 10") to created mainly doorbell viewer and for rest ha stuff including rest camera and panes…

My questions are mainly about:
In your go2rtc configuration you wrote:

- ffmpeg:https://myLOCALipADDRESS/flv?port=1935&app=bcs&stream=channel0_main.bcs
 - rtsp://xxxx:[email protected]:554
  1. Doest this mean you are using rtmp with default port 1935 and rtsp with default port 554 ? So i guess if i use onvif also for unifi protect therfore i have to have rtmp, rtsp, onvif, https am i right?
    basic port 9000 - related to reolink app is no longer need if this will work properly - i can be turned off by switching off “enable uid” in doorbell camera settings WebGUI right?

Sub question - theres added app:bcs and later bcs stream channel and morevoer it is thru https connection or rtmp ?

EDIT:
Found answer on: Introduction to FLV Stream

This is a proper Reolink FLV Stream to add it to go2rtc have to add

ffmpeg:

in front of line.

What kind of go2rtsp you use default integration or addon or maybe its somekow added by webrtc HACS addon (GitHub - AlexxIT/WebRTC: Home Assistant custom component for real-time viewing of almost any camera stream using WebRTC and other technologies.) ?

  1. I also get error message (in my conf i changed dourbel to vf) on first stream:

[rtsp] error=streams: exec/rtsp
[AVFormatContext @ 0x7fd568d76d40] Unable to choose an output format for ‘myvol’; use a standard extension for the filename or specify the format manually.
[out#0 @ 0x7fd562deb4c0] Error initializing the muxer for myvol: Invalid argument
Error opening output file myvol.
Error opening output files: Invalid argument
stream=vf

After removing:

#audio=myvol

From command it shows stream inside go2rtc, is it needed for tablet itself (and should go error on HAOS pc WebGUI) ?

Second stream vf_2way doesn’t show any error while its conf is related to vf stream like this (set to local IP also):

    vf_2way:
        - ffmpeg:vf#video=copy
        - rtsp://myACCOUNT:myPASS@myLOCALdoorbellIP:554/h264Preview_01_sub
  1. About general Fully Kiosk settings - did you set as main “go to url” cloudflare https URL or local URL ??
    In case as you set default Fullly Kiosk Home page can you tell wont it suffer for transfering whole connection thru local - > internet server to domain related - >local back and then with answer local → again internet server to domain related → local again ??

  2. in Advance Camera Card:

  camera_entity: camera.deurbel

Does it calls to original camera entitiy (if so there are two of them high res and low res resoluton (provided from Reolink Integration) or it calls to go2rtc entity ? If so i guess in my situation it should be camera.vf am i right? but there is no such entity - i mean go2rtc doesn’t provide entity.

Did you manged to work ?

no it doesn’t work :frowning:

thanks for reply - really hope that @MaximVB86 will respond with some solution. I tried to described every “corner” of issue. Do you use Fully Kiosk ? If yes did you managed any other away for doorbell ?

EDIT:
I think to get it work propably it is needed to install HAOS Addon WebRTC and propably create generic camera somehow on top of that.

go2rtc:
  streams:
    # example for connecting to a standard Reolink camera
    your_reolink_camera:
      - "ffmpeg:http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=username&password=password#video=copy#audio=copy#audio=opus"
    your_reolink_camera_sub:
      - "ffmpeg:http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=username&password=password"
    # example for connectin to a Reolink camera that supports two way talk
    your_reolink_camera_twt:
      - "ffmpeg:http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=username&password=password#video=copy#audio=copy#audio=opus"
      - "rtsp://username:password@reolink_ip/Preview_01_sub
    your_reolink_camera_twt_sub:
      - "ffmpeg:http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=username&password=password"
      - "rtsp://username:password@reolink_ip/Preview_01_sub
    # example for connecting to a Reolink NVR
    your_reolink_camera_via_nvr:
      - "ffmpeg:http://reolink_nvr_ip/flv?port=1935&app=bcs&stream=channel3_main.bcs&user=username&password=password" # channel numbers are 0-15
      - "ffmpeg:your_reolink_camera_via_nvr#audio=aac"
    your_reolink_camera_via_nvr_sub:
      - "ffmpeg:http://reolink_nvr_ip/flv?port=1935&app=bcs&stream=channel3_ext.bcs&user=username&password=password"

Data about reolink for further analysis…

Changing Reolink integration low resolution feed name into camera.deurbel couses Could not get camera endpoint for this live provider (incomplete configuration?) .

Can someone help me out how to create entity (i guess Generic Camera Integration) based on go2rtc Core HA Integration ?