forked from geerlingguy/pico-w-garage-door-sensor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgarage-door.yml
93 lines (85 loc) · 1.94 KB
/
garage-door.yml
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-pico
rp2040:
board: rpipicow
framework:
# Required until https://github.com/platformio/platform-raspberrypi/pull/36 is merged
platform_version: https://github.com/maxgerhardt/platform-raspberrypi.git
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
ota:
safe_mode: true
password: !secret ota_password
api:
password: !secret api_password
logger:
level: DEBUG
output:
# Built-in LED
- platform: gpio
pin:
number: 32 # 25 for Pico (non-W)
mode: output
id: LED
binary_sensor:
# East Garage Door
- platform: gpio
pin:
number: 2
mode:
input: true
pullup: true
output: false
open_drain: false
pulldown: false
inverted: false
name: East Garage Door
id: east_garage_door
device_class: garage_door
filters:
- delayed_on: 10ms
disabled_by_default: false
publish_initial_state: true
on_state:
then:
- if:
condition:
or:
- binary_sensor.is_on: east_garage_door
- binary_sensor.is_on: west_garage_door
then:
- output.turn_on: LED
else:
- output.turn_off: LED
# West Garage Door
- platform: gpio
pin:
number: 3
mode:
input: true
pullup: true
output: false
open_drain: false
pulldown: false
inverted: false
name: West Garage Door
id: west_garage_door
device_class: garage_door
filters:
- delayed_on: 10ms
disabled_by_default: false
publish_initial_state: true
on_state:
then:
- if:
condition:
or:
- binary_sensor.is_on: east_garage_door
- binary_sensor.is_on: west_garage_door
then:
- output.turn_on: LED
else:
- output.turn_off: LED