The doorbell is a modified relay hat for a Wemos. It's adjusted so that the Wemos get the power from the doorbell powersupply. No extra powersupply needed to power the Wemos :)
I've created 2 versions of ESPHome yaml code for my ESPHome based DoorBell:
When I'm working in my office (attic), I sometimes won't hear the bell on the main floor. I have therefore a second bell on the attic. To trigger the 2nd bell via an automation, I'm using an API service and a script to tidy it up
api:
services:
- service: dingdong
then:
- script.execute: dingdong_script
script:
id: dingdong_script
then:
if:
condition:
- switch.is_on: chime_active
then:
- switch.turn_on: relay
- delay: 200ms
- switch.turn_off: relay
- delay: 600ms
- switch.turn_on: relay
- delay: 200ms
- switch.turn_off: relay
- delay: 600ms
- switch.turn_on: relay
- delay: 200ms
- switch.turn_off: relay
That together with te rest of the esphome yaml code is the dingdong.yaml file
I'm using 3 services in my automation: App notification, Light notification and 2nd doorbell notification. These happens when somebody is pushing the doorbell, no matter if it is mute. Both main and secondary bell have each their own mute switch (
- id: '<random generated id>'
alias: Notify Doorbell
description: ''
trigger:
- platform: state
entity_id: binary_sensor.doorbell
from: 'off'
to: 'on'
condition: []
action:
- service: notify.mobile_app_iphone
data:
title: Deurbel gaat
message: Er belt iemand aan
- service: light.turn_on
data:
flash: short
target:
entity_id: light.notify
- service: esphome.dingdong_dingdong