ESPHome based doorbell is in the store!

After some testing, making the code ready and taking some photo’s, it’s finally in my store.

Finally the doorbell is ready! After version 1.0, 1.1 and 1.2, finally version 1.3 is ready for large usage. I’ve designed the doorbell primarily for my own usage. Yet after talking to some people within the Home Assistant and ESPHome community, I noticed that there are some different doorbell systems. One uses AC, other DC. Some works on 8 volts and some on 24 volts. The buck converter can handle up to max 50 volts, and the capacitors on the power input are max 50 volt. Therefor I rate the maximum input at 30~40 volt.

How does it work?

It’s quite simple how a doorbell works. The doorbell is connected to the doorbell-transformer. One wire goes through the doorbell push button. This breaks the circuit and will only ring when the push button is pressed, that makes the circuit.

When using the ESPHome Doorbell, this is the same. Only this time the relay controls the circuit for the doorbell, and the doorbell push button controls the Wemos D1 ESP.

The onboard buck converter provides 5 volt for the Wemos D1, so no external power supply is needed.

Old/normal doorbell setup

I’m not a genius in drawing on the computer, sorry πŸ˜‚

New setup with ESPHome Doorbell

I’m not a genius in drawing on the computer, sorry πŸ˜‚

The ESPHome code

I’ve made two versions of code, one default and one made for a ding-dong bell, which I use. The reason for a ding-dong version I use is that I can make it ding-dong 3-times when pressed. The default version is simple on when pressed and off when released.

Default ESPHome YAML code

esphome:
  name: doorbell
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password


# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

time:
  - platform: homeassistant
    id: homeassistant_time

text_sensor:
  - platform: version
    name: Doorbell ESPHome Version
  - platform: wifi_info
    ip_address:
      name: Doorbell IP
    ssid:
      name: Doorbell SSID
    bssid:
      name: Doorbell BSSID

sensor:
  - platform: uptime
    name: Doorbell Uptime
  - platform: wifi_signal
    name: Doorbell WiFi Signal
    update_interval: 60s

globals:
  - id: chime
    type: bool
    restore_value: true
    initial_value: 'true'

switch:
  - platform: gpio
    pin:
      number: D1
      inverted: false
    name: "Doorbell Relay"
    id: relay
    internal: true
    icon: mdi:alarm-bell
  - platform: restart
    name: "Doorbell Restart"
  - platform: template
    name: Doorbell Chime Active
    id: chime_active
    restore_state: false
    turn_on_action:
      - globals.set:
          id: chime
          value: 'true'
    turn_off_action:
      - globals.set:
          id: chime
          value: 'false'
    lambda: |-
      return id(chime);
    
binary_sensor:
  - platform: gpio
    pin:
      number: D5
      mode: INPUT_PULLUP
      inverted: true
    name: "Doorbell"
    filters:
      # Small filter, to debounce the button press.
      - delayed_on: 25ms
      - delayed_off: 25ms
    on_press:
      # Only turn on the chime when it is active.
      then:
        if:
          condition:
            - switch.is_on: chime_active
          then:
            - switch.turn_on: relay
    on_release:
      # On release, turn of the chime.
      - switch.turn_off: relay        

  - platform: status
    name: "Status Doorbell"

DingDong ESPHome YAML code

esphome:
  name: doorbell
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password


# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

time:
  - platform: homeassistant
    id: homeassistant_time

text_sensor:
  - platform: version
    name: Doorbell ESPHome Version
  - platform: wifi_info
    ip_address:
      name: Doorbell IP
    ssid:
      name: Doorbell SSID
    bssid:
      name: Doorbell BSSID

sensor:
  - platform: uptime
    name: Doorbell Uptime
  - platform: wifi_signal
    name: Doorbell WiFi Signal
    update_interval: 60s

globals:
  - id: chime
    type: bool
    restore_value: true
    initial_value: 'true'

switch:
  - platform: gpio
    pin:
      number: D1
      inverted: false
    name: "Doorbell Relay"
    id: relay
    internal: true
    icon: mdi:alarm-bell
  - platform: restart
    name: "Doorbell Restart"
  - platform: template
    name: Doorbell Chime Active
    id: chime_active
    restore_state: false
    turn_on_action:
      - globals.set:
          id: chime
          value: 'true'
    turn_off_action:
      - globals.set:
          id: chime
          value: 'false'
    lambda: |-
      return id(chime);
    
binary_sensor:
  - platform: gpio
    pin:
      number: D5
      mode: INPUT_PULLUP
      inverted: true
    name: "Doorbell"
    filters:
      - delayed_on: 50ms
      - delayed_off: 3000ms # prevents from re-ringing within 3 seconds
    on_press:
      then:
        if:
          condition:
            - switch.is_on: chime_active
          then:
            - switch.turn_on: relay
            - delay: 400ms
            - switch.turn_off: relay
            - delay: 400ms
            - switch.turn_on: relay
            - delay: 400ms
            - switch.turn_off: relay
            - delay: 400ms
            - switch.turn_on: relay
            - delay: 400ms
            - switch.turn_off: relay            

  - platform: status
    name: "Status Doorbell"

Precompiled version of ESPHome Doorbell

21 comments

  1. Igor

    Hi,

    Thinking about buying the doorbell. What time do you expect to have them ready if I order today?

    Thanks!
    Igor

    1. Marcel

      All orders are shipped same day if possible, otherwise next business day.

      Yet I didn’t expected to sell that much on one day, so I’m out of relays. I expect them within about 10 days. When I get them, I can send them immediately.

      So depending on your country within about two weeks (for now).

      1. Igor

        Cool, just wanted to make sure you will get them for sure (you never know with China orders…could take months)?

        1. Marcel

          Nah, most components I get from Farnell, only some I get from Ali (10 days shipping). And If I’m running out of stock, and I know it takes months to resupply, I won’t let people order them (no backorder possible πŸ˜‰ )

      2. Igor

        Another quick question…I’m on a roll πŸ˜€
        I’m measuring around 3V on the doorbell itself when the button is not pressed obviously.
        Is that enough power to power up the ESP?

    1. Marcel

      Yes and no… The Wemos is needed. If the Wemos dies, the doorbell won’t work. If the network of home-assistant goes down, than it still works. I hope that answers your question?

      I still use the same Wemos since the very first model in February 2019, so over 2 years now. Those things won’t break quickly, as long they used properly πŸ˜‰

  2. MP

    Hi,

    Great project. Do you ship to Toronto, Canada? I tried adding my address in the car but it shows “No shipping options were found for TORONTO ON, Canada”.

    Thanks.

    1. Marcel

      Hi, that’s because there isn’t a shipping price known (yet). Let me look it up for you πŸ™‚

    2. Marcel

      I’ve looked up, and have added outside Europe to the list for a fixed rate of €7 without tracking. Tracking is possible to Toronto, yet quite expensive πŸ™

  3. Joris

    Hi,

    Just to be sure before ordering πŸ™‚ This will work with a Hager ST002N 8V ~ 1A doorbell transformer?

    Thanks

    1. Marcel

      Well at least it should work. I’ve got an 8v ac transformer and that’s working.

      It based on Dutch doorbell systems (mostly 8~12v ac). And the max is 50v dc (I limit my board to use 40v max).

  4. W

    Hoi Marcel. Interesting! I’m afraid I need some help to see if/how it will work for my setup. I have an old fashioned chime (looks just like the one in your picture), and a wire from the chime to the power group box, which has a 230V to 8V transformer (ABB Beltrafo TS 8/8SW). Same as your drawing except: I don’t know where the wires are to/from the doorbell button. Probably hidden from my view, behind wooden panels. I don’t see any other wires going into the power group box, which I don’t understand. Any ideas?

    1. Marcel

      Probably all wires are coming together in the doorbell… I’ll mail you, otherwise there will be too much slow chat πŸ˜‰

        1. Marcel

          Yeah I think so, depending on the length of the cable. The longer the cable, the more resistance is has… So basically yes, but untested.

  5. Alain

    Hope they will be in stock soon.
    Currently, I switch off all the power during “nap” time. But this causes me to miss some deliveries.

Leave a Reply

Your email address will not be published. Required fields are marked *

Leave the field below empty!