-
Notifications
You must be signed in to change notification settings - Fork 0
/
garage-door.yaml
executable file
·93 lines (79 loc) · 1.86 KB
/
garage-door.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
esphome:
name: garage-door
platform: ESP8266
board: esp01_1m
wifi:
ssid: !secret ParkisSSID
password: !secret ParkisPassword
manual_ip:
static_ip: !secret ip_garage_door
subnet: 255.255.255.0
gateway: 192.168.1.1
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "garage_door"
password: !secret AccessPointPassword
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: HJrevqiIOwyvZ5iFuHDl6ukkhgZ12uGrPYO0Po35i94=
ota:
switch:
- platform: gpio
pin: GPIO12
id: relay
binary_sensor:
- platform: gpio
pin:
number: GPIO14
mode: INPUT_PULLUP
inverted: TRUE
id: reed_switch
name: Reed Switch
filters:
- delayed_on: 200ms
- delayed_off: 300ms
#on_press:
# then:
# cover.template.publish:
# id: garage_door
# current_operation: IDLE
cover:
- platform: template
name: "Garage Door"
lambda: |-
if (id(reed_switch).state) {
return COVER_CLOSED;
} else {
return COVER_OPEN;
}
open_action:
- switch.turn_on: relay
- delay: 500ms
- switch.turn_off: relay
# - cover.template.publish:
# id: garage_door
# current_operation: OPENING
# - delay: 19s
# - cover.template.publish:
# id: garage_door
# current_operation: IDLE
close_action:
- switch.turn_on: relay
- delay: 500ms
- switch.turn_off: relay
# - cover.template.publish:
# id: garage_door
# current_operation: CLOSING
stop_action:
- switch.turn_on: relay
- delay: 500ms
- switch.turn_off: relay
# - cover.template.publish:
# id: garage_door
# current_operation: IDLE
device_class: garage
id: garage_door