forked from konnected-io/esphome-secplus-gdo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample-cfg.yaml
309 lines (276 loc) · 6.8 KB
/
example-cfg.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
external_components:
- source: github://gelidusresearch/esphome-secplus-gdo
components: [ secplus_gdo ]
refresh: 0s
substitutions:
id_prefix: grgdo1
friendly_name: "GDO"
uart_tx_pin: GPIO22 # J4 Pin 1 or 3 Red CTRL
uart_rx_pin: GPIO21 # J4 Pin 1 or 3 Red CTRL
input_obst_pin: GPIO23 # J4 Pin 4 Grey OBST - not required with secplus_gdo
dry_contact_open_pin: GPIO17 # J4 Pin 6 Green
dry_contact_close_pin: GPIO19 # J4 Pin 7 Blue
dry_contact_light_pin: GPIO18 # J4 Pin 8 Orange
garage_door_cover_name: Garage Door
garage_light_name: Garage Light
garage_openings_name: Garage Openings
garage_lock_name: Lock
garage_motion_name: Motion
garage_obstruction_name: Obstruction
garage_motor_name: Motor
garage_button_name: Wall Button
garage_sync_name: Synced
esp32:
board: esp32dev
framework:
type: esp-idf
logger:
baud_rate: 921600
level: DEBUG
# Enable Home Assistant API
api:
encryption:
key: "PUT YOUR KEY HERE"
ota:
- platform: esphome
esphome:
name: gdo1
friendly_name: gdo1
comment: "ESP32: Garage Door Opener"
libraries:
- https://github.com/gelidusresearch/gdolib # Note clean the build files to ensure it updates the lib
platformio_options:
build_flags:
- -Wl,--wrap=esp_panic_handler
- -DUART_SCLK_DEFAULT=UART_SCLK_APB
wifi:
on_connect:
lambda: id(grgdo).start_gdo();
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "gdo1"
password: ""
ap_timeout: 10s
captive_portal:
# improv_serial:
# esp32_improv:
# authorizer: false
web_server:
status_led:
pin: GPIO4
secplus_gdo:
id: grgdo
input_gdo_pin: ${uart_rx_pin}
output_gdo_pin: ${uart_tx_pin}
light:
- platform: secplus_gdo
name: Garage Door Light
secplus_gdo_id: grgdo
id: gdo_light
cover:
- platform: secplus_gdo
name: Garage Door
secplus_gdo_id: grgdo
id: gdo_door
text_sensor:
- platform: version
name: ESPHome Version
hide_timestamp: true
sensor:
- platform: secplus_gdo
secplus_gdo_id: grgdo
id: gdo_openings
type: openings
name: "Garage Door Openings"
unit_of_measurement: "openings"
icon: mdi:open-in-app
- platform: dht
model: DHT22
pin: GPIO3
temperature:
name: "Temperature"
accuracy_decimals: 1
humidity:
name: "Humidity"
accuracy_decimals: 1
update_interval: 60s
lock:
- platform: secplus_gdo
id: gdo_lock_remotes
secplus_gdo_id: grgdo
name: "Lock remotes"
binary_sensor:
- platform: secplus_gdo
name: "Garage Motion Sensor"
id: gdo_motion
secplus_gdo_id: grgdo
device_class: motion
type: motion
- platform: secplus_gdo
name: "Garage Door Obstruction Sensor"
id: gdo_obst
secplus_gdo_id: grgdo
device_class: problem
type: obstruction
- platform: secplus_gdo
name: "Garage Door Motor"
id: gdo_motor
secplus_gdo_id: grgdo
device_class: running
type: motor
- platform: secplus_gdo
name: "Garage Button"
id: gdo_button
secplus_gdo_id: grgdo
entity_category: diagnostic
type: button
- platform: secplus_gdo
name: $garage_sync_name
id: gdo_synced
secplus_gdo_id: grgdo
type: sync
device_class: connectivity
- platform: gpio
id: "${id_prefix}_dry_contact_open"
pin:
number: ${dry_contact_open_pin} # dry contact for opening door
inverted: true
mode:
input: true
pullup: true
name: "Dry contact open"
entity_category: diagnostic
on_press:
- if:
condition:
binary_sensor.is_off: ${id_prefix}_dry_contact_close
then:
- cover.open: gdo_door
- platform: gpio
id: "${id_prefix}_dry_contact_close"
pin:
number: ${dry_contact_close_pin} # dry contact for closing door
inverted: true
mode:
input: true
pullup: true
name: "Dry contact close"
entity_category: diagnostic
on_press:
- if:
condition:
binary_sensor.is_off: ${id_prefix}_dry_contact_open
then:
- cover.close: gdo_door
- platform: gpio
id: "${id_prefix}_dry_contact_light"
pin:
number: ${dry_contact_light_pin} # dry contact for triggering light
inverted: true
mode:
input: true
pullup: true
name: "Dry contact light"
entity_category: diagnostic
on_press:
then:
- light.toggle: gdo_light
disabled_by_default: false
switch:
- platform: secplus_gdo
id: gdo_learn
type: learn
secplus_gdo_id: grgdo
name: Learn
icon: mdi:plus-box
entity_category: config
- platform: secplus_gdo
id: gdo_toggle_only
type: toggle_only
secplus_gdo_id: grgdo
name: Toggle Only
icon: mdi:plus-box
select:
- platform: secplus_gdo
id: gdo_protocol
secplus_gdo_id: grgdo
name: protocol
icon: mdi:settings
entity_category: config
number:
- platform: secplus_gdo
name: Opening duration
secplus_gdo_id: grgdo
entity_category: config
id: gdo_open_duration
type: open_duration
unit_of_measurement: "ms"
- platform: secplus_gdo
name: Closing duration
secplus_gdo_id: grgdo
entity_category: config
id: gdo_close_duration
type: close_duration
unit_of_measurement: "ms"
- platform: secplus_gdo
name: Client ID
secplus_gdo_id: grgdo
entity_category: config
id: gdo_client_id
type: client_id
mode: box
- platform: secplus_gdo
name: Rolling Code
secplus_gdo_id: grgdo
entity_category: config
id: gdo_rolling_code
type: rolling_code
mode: box
# Remidiates wall button brownouts by throttling TX activity
# 350ms recommened on 880LM units
#- platform: secplus_gdo
# name: Min Command Interval
# secplus_gdo_id: grgdo
# entity_category: config
# id: gdo_min_command_interval
# type: min_command_interval
# mode: box
# unit_of_measurement: "ms"
# Add Time to Close (TTC) control, 0s = disabled
# - platform: secplus_gdo
# name: Time to Close
# secplus_gdo_id: grgdo
# entity_category: config
# id: gdo_time_to_close
# type: time_to_close
# mode: box
# unit_of_measurement: "s"
button:
- platform: restart
name: Restart
id: restart_button
entity_category: config
- platform: factory_reset
name: Factory Reset
entity_category: config
- platform: template
name: Reset door timings
entity_category: config
on_press:
- number.set:
id: gdo_open_duration
value: 0
- number.set:
id: gdo_close_duration
value: 0
- button.press:
id: restart_button
- platform: template
name: Re-sync
entity_category: config
on_press:
- number.increment:
id: gdo_client_id
- button.press:
id: restart_button