Bron: https://frenck.dev/diy-smart-doorbell-for-just-2-dollar/

  • ESP01S
  • Relais
  • ESPHome
  • Home Assistant

 

Aansluitschema:

Grijze kabel vanuit de gong:
Blauw in bel trafo (links)
Rood in relais (2)

Blauw/wit vanuit bel trafo (rechts) naar relais (1)

Grijze kabel vanuit de deurbel:
Blauw naar relais (4)
Rood naar gebogen pin ESP

Voeding
Volledig zwart naar relais (5)
Witte onderbroken strepen naar relais (4)

 

esp relay

 

deurbelha

 

 

substitutions:
  display_name: Deurbel

esphome:
  name: deurbel
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "xxx"
  password: "xxx"
  power_save_mode: none  
  manual_ip:
    # Set this to the IP of the ESP
    static_ip: xxx
    # Set this to the IP address of the router. Often ends with .1
    gateway: xxx
    # The subnet of the network. 255.255.255.0 works for most home networks.
    subnet: xxx     

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${display_name} Fallback Hotspot"
    password: "4igB4c7XdnRr"

# Enable logging.
logger:

# Enable Home Assistant API.
api:

# Enable over-the-air updates.
ota:

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

# Text sensors with general information.
text_sensor:
  # Expose ESPHome version as sensor.
  - platform: version
    name: ${display_name} ESPHome versie
  # Expose WiFi information as sensors.
  - platform: wifi_info
    ip_address:
      name: ${display_name} IP
    ssid:
      name: ${display_name} SSID

# Sensors with general information.
sensor:
  # Uptime sensor.
  - platform: uptime
    name: ${display_name} Uptime
    filters:
      - lambda: return x / 3600.0;
    unit_of_measurement: "hours"
    accuracy_decimals: 2        

  # WiFi Signal sensor.
  - platform: wifi_signal
    name: ${display_name} 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'

# Exposed switches.
switch:
  # Switch to restart the doorbell.
  - platform: restart
    name: ${display_name} Restart

  # Switch to turn on/off the chime.
  - platform: gpio
    id: relay
    inverted: true
    name: ${display_name} Chime
    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: ${display_name} 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 representing the
# Doorbell button push.
binary_sensor:
  - platform: gpio
    id: button
    name: ${display_name} Button
    pin:
      # Connected to GPIO on the ESP-01S.
      number: GPIO2
      mode: INPUT_PULLUP
      inverted: true
    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

 

Foto's ter referentie voordat dit netjes is weggewerkt:

chrome dtMVGO9Pya

chrome 1ErFUfkbNN

3