Doorbird integration

I’ve tried this automation and get this error:

2018-01-24 14:42:40 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from “doorbird ip”

I’ve double checked the Doorbird logon details in config.yaml and it’s right, sounds like Doorbird is not auth to HA? Any ideas?

I realize now that I’m an idiot…

My test instance of HA doesn’t have an API/HTTP password, so it worked and I didn’t think to authenticate API calls. I will work on a fix ASAP.

1 Like

Not an idiot at all, easily over looked! Let me know when you a chance to correct it and I’ll test.
Many thanks!

1 Like

I have pushed a fix and created a pull request, so now it’s up to the HA devs to accept it.

1 Like

While I haven’t moved over to this API’s ring notification (still using the proxy version), I have tied this into TTS using Bluetooth speakers with my RPi. I have my Pi connect to my Echos, and they will let me know when someone is ringing the door. There are a few known issues connecting to some Echo devices using RPis, but my Echo dot seems to consistently work. Other ideas may be to flash some lights, send some push notifications, etc.

Here’s my automation converted to use the trigger (but untested). Probably doesn’t make sense to put it in the documentation as I’m using multiple unofficial components to do this.

- id: NotifyDoorbell
  alias: 'Notify of ringing doorbell'
  initial_state: 'on'
  trigger:
    platform: event
    event_type: doorbird_doorbell
  action:
    service: tts.google_say
    data:
      entity_id: media_player.tts_bluetooth_speaker
      message: 'Ding Dong! Someone is at the front door!'
2 Likes

doorbird_doorbell event now works as of 0.63 - thanks @Klikini!
here’s my working config for playing the doorbell on Sonos if anyone needs it:

an automation:

- alias: Doorbell
  trigger:
  - platform: event
    event_type: doorbird_doorbell
  action:
    - service: script.turn_on
      data:
        entity_id: script.doorbell

calls this script:

doorbell:
  alias: Ring Doorbell
  sequence:
    - service: media_player.sonos_snapshot
      data:
        entity_id: media_player.kitchen
    - service: media_player.volume_set
      data:
        entity_id: media_player.kitchen
        volume_level: 0.60
    - service: media_player.play_media
      data:
        entity_id: media_player.kitchen
        media_content_id: http://10.0.26.20/sounds/doorbell.mp3
        media_content_type: music
    - delay:
        seconds: 4
    - service: media_player.sonos_restore
      data:
        entity_id: media_player.kitchen
4 Likes

Thank you @reynos, this works perfectly. The sonos_snapshot and sonos_restore services where new to me, but this is brilliant to be able to save and restore the state of the speaker.

My issue was that the event was never triggered. I found that when I went in to the Doorbird APP under Administration and HTTP Calls the address of my HomeAssistant server was set to localhost - when changing this to the internal IP of the server the Event was now triggered when pressing the Doorbird Button.

2 Likes

Hey @Klikini I just enabled SSL and the doorbell event seems to have broken, can you check please? Thanks.

I think this would happen because the DoorBird is still connecting to HA using the local IP and not using HTTPS.

I’m not sure of how to get the actual hostname, I’ll look into it.

I can connect locally to my HA instance using https://10.x.x.x (albeit after a browser warning that the URL does not match the cert) if that’s any help…

Did you installed a valid certificate on your HA instance? Maybe the DoorBird can only deal with valid certificates. If so, the DoorBird must connect by hostname, not by ip. Please review the DoorBird notification parameters first by making a request to your DoorBird api, something like:

http://<deviceip>/bha-api/info.cgi

This is what I plan to do.

The current DoorBird component code gets the LAN IP of the HA machine and uses that. Once I get time to work and test it, I’ll attempt to read the base_url option of the http component and use that instead, otherwise fall back to the IP address if it isn’t set up.

I just looked at the code and it should work fine with SSL.

Could you please share your http component configuration?

If you need more info that this I’ll PM you…
http:
api_password: !secret http_api_password
ssl_certificate: !secret ssl_certificate_loc
ssl_key: !secret ssl_key_loc
base_url: !secret base_url

The component should be using the base_url, so double-check that it’s correct.

Otherwise, please go to http://_doorbird_lan_ip_here_/bha-api/notification.cgi, log in with the same user account you have in your component configuration. It should look something like this:

{"BHA": { "RETURNCODE": "1", "NOTIFICATIONS": [{"event": "doorbell1","subscribe": "1","url": "http://_home_assistant_url_/api/doorbird/doorbell","user": "","password": "","relaxation": "10"}]}}`.

Then try going to the exact/entire url value and see if it responds correctly (it should just say OK) and serves a valid SSL certificate.

I finally had time to troubleshoot this on my setup. Your instructions above do fire the doorbell event if i use the local IP address. Also, if in the Doorbird app i go into Admin and under HTTP Calls I change the fully qualified domain name (eg duckdns.org) to the local IP (10.x.x.x) it all works fine, but of course this setting does not stick once I restart HA. Is a solution to set the URL to LAN IP instead of FQDN?

First off thanks so much for this! I have the doorbell event working great, my question is does this work with any other events? Motion to be more specific? Thanks

I would like to use duckdns domain as base_url, but if I do it, it doesn’t work because Doorbird tries to reach ha server through duckdns, and not through local ip. I have to set local ip in base_url to get it working.

Please, can you add a “url” property to Doorbird component, and use it instead of base_url? You can use base_url if component’s url is not defined (as telegram component does). So we can have base_url with duckdns, and Doorbird url with private ip.

While the motion event is documented for the DoorBird API, it doesn’t seem to work, so I didn’t include support for it.

yep same problem I’m having, @Klikini any chance you can have a look at it when you have time please?