-
Notifications
You must be signed in to change notification settings - Fork 31
/
esphome_doorbell.yaml
136 lines (118 loc) · 2.96 KB
/
esphome_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
131
132
133
134
135
esphome:
name: doorbell
platform: ESP32
board: esp-wrover-kit
wifi:
ssid: !secret wifi_not_ssid
password: !secret wifi_not_pwd
manual_ip:
static_ip: 192.168.3.24
gateway: 192.168.3.1
subnet: 255.255.255.0
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
binary_sensor:
- platform: gpio
pin: GPIO33
name: doorbell PIR
device_class: motion
- platform: gpio
pin:
number: GPIO34
mode: INPUT_PULLUP
inverted: True
name: doorbell button
# On press show ding dong page and activate doorbell script in Home Assistant
on_press:
then:
- display.page.show: ding_page
- component.update: doorbell_display
- delay: 2s
- display.page.show: name_page
- component.update: doorbell_display
- homeassistant.service:
service: script.turn_on
data:
entity_id: "script.doorbell"
# If front door is opened, show come in page
- platform: homeassistant
name: "Doorbell Copy Door Relay"
entity_id: switch.door_lock_relay
id: door_lock
on_press:
then:
- display.page.show: come_in_page
- component.update: doorbell_display
- delay: 5s
- display.page.show: name_page
- component.update: doorbell_display
- platform: status
name: doorbell status
sensor:
- platform: wifi_signal
name: doorbell WiFi Signal
update_interval: 10s
- platform: uptime
name: doorbell Uptime
switch:
- platform: restart
name: "Doorbell Restart"
esp32_camera:
name: Doorbell Camera
external_clock:
pin: GPIO32
frequency: 20MHz
i2c_pins:
sda: GPIO13
scl: GPIO12
data_pins: [GPIO5, GPIO14, GPIO4, GPIO15, GPIO18, GPIO23, GPIO36, GPIO39]
vsync_pin: GPIO27
href_pin: GPIO25
pixel_clock_pin: GPIO19
power_down_pin: GPIO26
resolution: 640x480
max_framerate: 5 fps
idle_framerate: 0 fps
jpeg_quality: 10
vertical_flip: true
horizontal_mirror: true
i2c:
sda: GPIO21
scl: GPIO22
font:
- file: "fonts/times-new-roman.ttf"
id: tnr1
size: 20
- file: "fonts/times-new-roman.ttf"
id: tnr2
size: 40
time:
- platform: homeassistant
id: homeassistant_time
display:
- platform: ssd1306_i2c
model: "SSD1306 128x64"
rotation: 180
address: 0x3C
id: doorbell_display
pages:
# Name page
- id: name_page
lambda: |-
it.print(34, 0, id(tnr1), "Peter");
it.print(29, 20, id(tnr1), "Marcus");
it.print(8, 43, id(tnr1), "Havard Olai");
# Ding Dong page
- id: ding_page
lambda: |-
it.print(64, 0, id(tnr2), TextAlign::TOP_CENTER, "DING");
it.print(64, 64, id(tnr2), TextAlign::BASELINE_CENTER, "DONG");
# Welcome in page
- id: come_in_page
lambda: |-
it.print(64, 0, id(tnr2), TextAlign::TOP_CENTER, "KOM");
it.print(64, 64, id(tnr2), TextAlign::BASELINE_CENTER, "INN");