-
Notifications
You must be signed in to change notification settings - Fork 17
/
smart-doorbell.yaml
130 lines (111 loc) · 2.41 KB
/
smart-doorbell.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
esphome:
name: smart-doorbell
project:
name: zuidwijk.smart-doorbell
version: "1.0"
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
wifi:
# remove leading '#' and fill in your wifi details
# ssid: !secret wifi_ssid
# password: !secret wifi_password
ap:
# Enable fallback hotspot (captive portal) in case wifi connection fails
ssid: "smart-doorbell"
captive_portal:
improv_serial:
esp32_improv:
authorizer: none
#doesnt work together with captive_portal
esp32_ble_tracker:
scan_parameters:
interval: 1100ms
window: 1100ms
active: true
bluetooth_proxy:
active: true
web_server:
port: 80
dashboard_import:
package_import_url: github://zuidwijk/esphome-doorbell/smart-doorbell.yaml@main
import_full_config: true
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: GPIO5
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_mode: disabled
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: GPIO4
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"