DIY Smart Doorbell with Android notifications

Indeed, I use traefik on my bas to make it available remote. It also works on my Android mobile phone.

Only thing: the HTML 5 notifications come in a bit too late…

Thanks for your assistance. In the doorpi-card.js , I can see that the open door button code is as below. What I would like to do is trigger an automation when the button is pressed. Can you please advise how I can do this.

+ 'Open Door' +

mwc-button raised id=‘btn-open-door-1’>` + ‘Open Door’ +

Blockquote

</mwc-button>

sorry to trouble you again.
How do I resize the custom doorpi card? I would like it to be full size, ie fill the screen, it is currently the size of a card.

Set the tab to panel mode

1 Like

For the WhatsApp integration, you can use this API that is Free and working well so far:

The same API provider (callmebot) allows Telegram Phone Calls that might be pretty convinient for this project because it actually ring your phone instead of sending a text msg.

From some reason when I create the custom card in the lovelace I get a blinking error pops and fades saying custom card not found. The resources are set correctly. The resources definitions where changed in the last few versions to a new place.
Can anyone help?

Hi.

Can some share the Traefik yml and toml so I can verify the setup.

Which version of HA are you using?

Here is my traefik.toml. Note that it is still traefik 1.x

debug = false

logLevel = "ERROR"
defaultEntryPoints = ["https","http"]

[entryPoints]
  [entryPoints.http]
  address = ":80"
    [entryPoints.http.redirect]
    entryPoint = "https"
  [entryPoints.https]
  address = ":443"
    [entryPoints.https.tls]
      #[[entryPoints.https.tls.certificates]]
      #certFile = "/certificates/live/dehuysser.be/fullchain.pem"
      #keyFile = "/certificates/live/dehuysser.be/privkey.pem"

[retry]

[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "your-domain.com"
watch = true
exposedByDefault = false

[acme]
email = "your-email"
storage = "acme.json"
entryPoint = "https"
# caServer = "https://acme-staging-v02.api.letsencrypt.org/directory"
onHostRule = true
  [acme.httpChallenge]
  entryPoint = "http"

[file]

[backends]
  [backends.backend-homeassistant]
    [backends.backend-homeassistant.servers]
    [backends.backend-homeassistant.servers.server-homeassistant-ext]
    url = "http://ha-ip-address:8123"
    weight = 0
  [backends.backend-doorbell]
    [backends.backend-doorbell.servers]
    [backends.backend-doorbell.servers.server-doorbell-ext]
    url = "http://doorbell-ip-address:9090"
    weight = 0

[frontends]
  [frontends.frontend-homeassistant]
    backend = "backend-homeassistant"
    passHostHeader = true
    InsecureSkipVerify = true
    [frontends.frontend-homeassistant.routes]
    [frontends.frontend-homeassistant.routes.route-homeassistant-ext]
    rule = "Host:homeassistant.your-domain.com"
  [frontends.frontend-doorbell]
    backend = "backend-doorbell"
    passHostHeader = true
    InsecureSkipVerify = true
    [frontends.frontend-doorbell.routes]
    [frontends.frontend-doorbell.routes.route-doorbell-ext]
    rule = "Host:doorbell.your-domain.com"

Hi.

Update.
I have the doorpi working on the RPi 3 B with let’s encrypt etc. The only thing that is left is the custom card. I am now in version 0.108.9 which is the latest version of HA.
I keep getting an intermittent message on the lovelace: Custom element doesn’t exist: doorpi-card.
I did changed something in the doorpi-card.js - the names of the buttons from everywhere etc. to other stuff. These names appear twice in the code. I also tried to move the js files while updating the resources location definition. No change. It does not work and keep blinking the above error.
I would appreciate help.

Hi again.

BTW, as I have mentioned I have created a readme file which will be a copy/paste setup instructions. I handled the SSL with certbot (let’s encrypt). Very simple and it works.
The last thing that needs fixing is the doorpi-card.js. The custom card throws an error probably due to changes in the custom card rules as per the following post:
https://developers.home-assistant.io/blog/2020/02/18/106-custom-card-changes/#helper-functions”.
The card can’t be detected so the doorbell does not work under HA.

1 Like

Does anyone have a working setup with HA 0.107.x or above. The doorpi-card.js is causing errors on this HA version and above. It looks like it is not loaded properly or at all.

Hi my doorbell works fine in ha 110.4 hassio. only issue is it does not work in iOS. Post your card code I’ll take a look compare. My doorbell works great on a pc and android.

1 Like

2 Likes

Hello,

I’m planning to build this doorbell but I’m also planning to integrate it in a lovelace pannel with an “Open door” button (opening the door is managed with another integration).

As I’m on iOS, I was wondering if the iOS app is using the latest webkit and so is able to do WebRTC ?

My dream scenario is the following :

  • Someone ring at the door
  • iPhones get a notification
  • iPhone user click on the notification which fires the Home Assistant iOS App showing the lovelace pannel with the doorbell video and an Open Door button

Question is… would the iOS user be able to talk and listen to the person ringing at the door ?

V.
p.s. I’m planning to have a Pi for the doorbell while another one is running Home Assistant inside the house and managing all other aspects of home automation.

First of all, I would like to thank @rdehuyss for this amazing project but I’m struggling with it for the last few days and I cannot make it fully working.

My problems are as follows:

  1. When I press the physical Doorbell button, the mjpeg streaming works fine and all three buttons appears in the Lovelace card : OPEN DOOR, ACCEPT and REJECT

  2. If I press REJECT ,everything is fine, the buttons are restored to initial state and only OPEN DOOR remain on the card.

  3. If I press ACCEPT in the Web Console, I got the error “getUserMedia not supported” so I modified, in the file doorpi-card.js, the makecall() “navigator.getUserMedia” with “navigator.mediaDevices.getUserMedia”. WIth this, the error is gone and now I receive a popup from the browser to allow permission to use the microphone, the microphone icon is blinking, as it is in use, but I cannot hear any sound from the doorbell mic.

  4. When I press the END button, I get another error “Uncaught TypeError: this.signalObj.hangup is not a function” and the session remains open and END button stays on the card. The END button dissapears only when the automation executes (service: input_boolean.turn_off
    entity_id: input_boolean.doorbell). This problem I could not figure out how to solve it.

Did any of you, using this project, have similar problems, or there are any recent updates of the .js source files?

I’m currently use HA 0.112.4 + Firefox 78.0.2 (and Safari 13.1.1)

Thanks.

Did you already test chrome? I never tested it in firefox/safari.

Exact stacktraces from the console also help for debugging.

Hey mate
Are you trying to use ha through your iPhone
I can’t get it to work. Works fine on a pc and android phone for me.The .js files need a rework because iOS is picky about how everything is worded but if it is changed it may not function on android. Or that what I have read.chrome and Firefox are just a front on an iPhone so it doesn’t make a difference. https://webrtchacks.com/guide-to-safari-webrtc/
Maybe you can make sense of this.

I have returned to the unfinished project after dealing with other projects.
Actually I have embedded the system into an old Urmet Synthsis system that broke down.
It is working but not fully and as it should.
I am using latest HA as of today and Rpi 3.
The problems are:
The doorpi card no longer generates an error but the screen is empty. Nothing on it.
I have changed the buttons names, I have set the url as the one I use (https).
What I have seen in the doorpi-card.js file a line of code that opens the stream using wss://. Trying to use this on my browser shows an error (wss://my host:9090/stream/webrtc) while the https one woks on the browser. None works on HA.
What am I doing wrong. Could someone send a uv4l config file to compare with.