Doorbell with home assistant

Like most people I have been working from home for a while now. Since my workplace is upstairs most of the time I don't hear the doorbell when ringing. A bit frustrating when you are waiting for a package that you just missed. Time for an upstairs doorbell.

Since my home-assistant setup already gets a trigger when someone is at the door adding an extra doorbell should be fairly simple. Here is the setup I have used for this:

Total costs: EUR 9,20 (including shipping).


Final result




All components have been glued inside the doorbell housing. The result is shown in the picture above. The components can be soldered together using the following schematics:

Schematics

Although the doorbell should be operated at 12V it works at 5V. When gluing everything inside the casing it looks like this:


You will need to make a small hole for the power cord. The components have been glued with thermal glue. Before gluing in the Wemos D1 you will need to program it.


Programming the Wemos D1 using ESPHome in home assistant

Within home assistant browse to the ESPHome tab and create a new node. Fill in the correct name and the rest of the fields can be filled in with random characters. You will edit the file after the node is created and copy the contents of doorbellswitch2.yaml. The '.substitutions.yaml' needs to be added manually, for instance using a terminal or with the 'file editor' addon. The '.substitutions.yaml' needs to be stored in: '/config/esphome/'

.substitutions.yaml
wifi_ssid: "your_ssid"
wifi_password: "your_passwd"
ota_passwd: "ota_passwd"
api_passwd: "api_passwd"

doorbelswitch2.yaml
substitutions:
  plug_name: doorbellswitch2
  locatie: hal
  <<: !include .substitutions.yaml

esphome:
  name: ${plug_name}
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: ${wifi_ssid}
  password: ${wifi_password}
  manual_ip:
    static_ip: <static_ip>
    gateway: <gateway>
    subnet: <subnet>

ota:
  password: ${ota_passwd}

api:
  password: ${api_passwd}
web_server:
  port: 80

# Enable logging
logger:

time:
  - platform: homeassistant
    id: homeassistant_time

switch:
  - platform: gpio
    pin: D1
    name: "Doorbell Switch 2"
    id: doorbellswitch2
  - platform: template
    name: "Ring doorbell upstairs"
    icon: "mdi:bell-ring"
    id: ringdoorbell2
    turn_on_action:
    - switch.turn_on: doorbellswitch2
    - delay: 4s
    - switch.turn_off: doorbellswitch2


After you have added the node and programmed it, home assistant will automatically discover the new node and ask you to configure it. Using a simple automation script you can call the switch 'switch.ringdoorbell2' to ring the new doorbell.








Reacties

Populaire posts van deze blog

Simple outdoor PIR sensor for home assistant