-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathright_garage.yaml
executable file
·48 lines (43 loc) · 968 Bytes
/
right_garage.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
substitutions:
device_name: right_garage
friendly_name: Right Garage
ip_address: 192.168.1.242
esphome:
name: ${device_name}
platform: ESP8266
board: esp01_1m
arduino_version: latest
<<: !include common.yaml
switch:
- platform: gpio
pin: GPIO12
id: relay
binary_sensor:
- platform: gpio
name: ${friendly_name} Switch
id: ${device_name}_switch
pin:
number: GPIO14
mode: INPUT_PULLUP
filters:
- delayed_on: 100ms
- delayed_off: 100ms
cover:
- platform: template
name: ${friendly_name}
id: ${device_name}
device_class: garage
lambda: !lambda |-
if (id(${device_name}_switch).state) {
return cover::COVER_CLOSED;
} else {
return cover::COVER_OPEN;
}
open_action:
- switch.turn_on: relay
- delay: 100ms
- switch.turn_off: relay
close_action:
- switch.turn_on: relay
- delay: 100ms
- switch.turn_off: relay