Which transistor do I need for my ESP8266 to ring a doorbell?

Outside at the front door, I have replaced my old Siedle Doorbell button by a Reolink Doorbell. However, I would like to use my classic Siedle HTA 811 doorbell gong instead of the Reolink Chime.

So, my idea is to ring the Siedle HTA 811 doorbell by using an ESP8266, which will get a signal by the reolink doorbell via Homeassistant. I have a 12V AC power source (needed by Siedle HTA 811) and a 5V DC power source (needed by the ESP8266).

Now I would like to know how I have to switch the whole thing so that my plan works. In particular, I would like to know whether my circuit diagram is correct and what type of transistor (T in the diagram) I need.

I hope you can help me. Many thanks in advance.

schaltplan-klingel-esp

Maybe Frenck’s doorbell is something for you?

1 Like

@aceindy
No, unfortunately not. This setup requires the doorbell button to ring the doorbell. In Frenck’s doorbell, the doorbell sends a signal to the Smart Home. However, I have replaced the classic doorbell button so that in my case the Smart Home shall send a signal to the doorbell.

Hmm…
Frenck’s doorbell has the button (as senor) AND the chime (as control) available:

So from HA I can monitor the button as well as trigger the chime (relay)
(And it can also inhibit the relay, but the button will still work…so it is used as a silent trigger; at my place when the doorbell is pushed after 19:30 I only get a notification on my phone and TV, so the kids won’t wake up).

In your case, you can trigger the chime on the Siedle HTA 811 doorbell when the reolink doorbell has been pushed (so you don need to use the button input; you can use any sensor within HA to trigger the chime ;))

Basically, you could even activate the chime when you flush the toilet (provided the toilet flush has a sensor :smiley:)

In your case it would make it even easier, as you don’t need to break out the GPIO-2 pin, you can just ommit that.
image

1 Like

What about replacing the transistor with a 5v Dry relay so there is no chance of AC running back to destroy the ESP.

1 Like

Ok, you are right. However, I do not really understand, how my circuit diagram should look like. The “smart device” as it is described in your article, will not be connected to the push button in my case. So how will I have to connect the components?


Your esp may have 5v rail to connect relay to or you may have to power it directly from your 5v source. Ground connects to any ground on esp or 5v supply.

Connecting a transistor to 12 AC source which probably has an inductive load (the bell) could cause a very high Voltage spike that would kill the esp.

1 Like

Thank you very much! How would the diagram look like with the ESP-01S Chip and relay module? I like that solution, because I would have to integrate only one new component instead of two.

If you are talking about the ESP01 attached to a relay board then the schematic is pretty much the same except there are no wires between the relay and ESP.

1 Like

Have they licked that problem with the ESP-01s relay module that flicks on briefly when it get’s powered up?

@Spiro
Yes…they did…this worked for me

@MSco i think it is easier/cheaper to go for the esp01 with relay board:


(so no need for you to bent/break out GPIOpin 2 as mentioned in Frenck’s tutorial :wink: )

2 Likes

This solution looks great! I think I will try that. Thank you very much! :slight_smile:

Just FYI, my automation:

alias: Front DoorBell Notify when activated
description: send
trigger:
  - platform: state
    to: "on"
    entity_id: binary_sensor.doorbell_button
    from: "off"
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: media_player.living_room_tv
            state: "on"
        sequence:
          - data:
              message: DingDong, someone at the door !!
            action: notify.living_room_tv
    alias: When TV is on send notification to TV
  - entity_id: camera.doorcam
    data:
      filename: "{{ snapshot_create_file_path }}"
    action: camera.snapshot
  - action: notify.mobile_app_iphone_ip12
    metadata: {}
    data:
      message: "{{ notification_title }}"
      title: "{{ notification_message }}"
      data: >-
        {% set android_data = {"image": "%s"} |
        format(snapshot_access_file_path) %} {% set ios_data = {"attachment":
        {"url": "%s", "content_type": "JPEG"}} |
        format(snapshot_access_file_path) %} {{ ios_data if is_ios else
        android_data }}
    alias: Send to Phone
variables:
  is_ios: true
  notification_title: The Doorbell was activated!
  notification_message: "{{ binary_sensor_name }} was activated!"
  snapshot_create_file_path: /config/www/tmp/snapshot_{{ states[camera].object_id }}.jpg
  snapshot_access_file_path: "{{ snapshot_create_file_path | replace('/config/www','/local') }}"
  binary_sensor: binary_sensor.doorbell_button
  binary_sensor_name: "{{ states[binary_sensor].name }}"

In your case you’ll need to change binary_sensor.doorbell_button entry here:

entity_id: binary_sensor.doorbell_button
binary_sensor: binary_sensor.doorbell_button

into your sensor which represents your reolink button…

1 Like

This is my yaml code for the esp01s component. I took the code from the linked tutorial. However, the tutorial is already 5 years old, so I would like to ask, if there is some deprecated stuff in my code, which today normally would be done in a better way:

esphome:
  name: esp8266-eg-klingel
  friendly_name: ESP8266-EG-Klingel

esp8266:
  board: esp01_1m
  early_pin_init: false

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "*****"

ota:
  - platform: esphome
    password: "****"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp8266-Eg-Klingel"
    password: "****"

captive_portal:

# Enable Web server.
web_server:
  port: 80

# Sync time with Home Assistant.
time:
  - platform: homeassistant
    id: homeassistant_time

# Sensors with general information.
sensor:
  # Uptime sensor.
  - platform: uptime
    name: Doorbell Uptime

  # WiFi Signal sensor.
  - platform: wifi_signal
    name: Doorbell WiFi Signal
    update_interval: 60s

# Global to store the on/off state of the chime
globals:
  - id: chime
    type: bool
    restore_value: true
    initial_value: 'true'

switch:

  - platform: restart
    name: restart

  - name: doorbell
    id: relay
    inverted: true
    platform: gpio
    pin: GPIO0

  # Switch to turn on/off chime when
  # doorbell button is pushed.
  #
  # It creates a "virtual" switch based
  # on a global variable.
  - platform: template
    name: chime_active
    id: chime_active
    turn_on_action:
      - globals.set:
          id: chime
          value: 'true'
    turn_off_action:
      - globals.set:
          id: chime
          value: 'false'
    lambda: |-
      return id(chime);

Look pretty OK to me.

You already implemented this:

esp8266:
  board: esp01_1m
  early_pin_init: false

Which prevents the chime from being called during start-up/reboot of the esp.

And you also have included the recently added api key:

api:
  encryption:
    key: "*****"

So that should be it :wink:

1 Like

@MSco
To finalize it, you should mark the topic that solved it for you as solution :wink:

@aceindy I would like to, but I cannot find a “solution” button here to mark a post.

I have installed the ESP01 to one of my doorbells and it works fine, but with one issue. It is exactly the issue described here.

When the esp01 gets disconnected from power source and connected again, it gives power to the gpio pin for some milliseconds and the doorbell rings for some milliseconds. Any idea? As you can see in my yaml, I already use the early_pin_init: false

Only the original poster can mark it a solved, look for this:
image

And that is weird, this works for me:

esp8266:
  board: esp01_1m
  early_pin_init: false

esphome:
  name: doorbell
  comment: DoorBell

ESPhome is up-to-date?
Not sure exactly when this was introduced, but for sure it works in the current version (2024.8.3).