-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
hallway-switch.yaml
66 lines (60 loc) · 1.36 KB
/
hallway-switch.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
---
substitutions:
name: hallway-switch
friendly_name: Hallway Switch
board: esp8285
ip: '10.6.6.123'
packages:
common: !include modules/common-8266.yaml
switch:
- platform: gpio
id: relay
pin: GPIO13
name: "Relay"
restore_mode: RESTORE_DEFAULT_ON
light:
- platform: status_led
name: "Blue LED"
disabled_by_default: true
pin:
number: GPIO4
inverted: true
binary_sensor:
- platform: gpio
name: "Button"
disabled_by_default: true
pin:
number: GPIO3
inverted: true
mode: INPUT_PULLUP
- platform: gpio
name: "${friendly_name}"
disabled_by_default: true
pin:
number: GPIO14
mode: INPUT_PULLUP
on_state:
- homeassistant.event:
event: esphome.switch
data:
device: ${name}
action: click
on_multi_click:
- timing:
- ON for at most 0.5s
- OFF for at most 0.5s
- ON for at most 0.5s
- OFF for at most 0.5s
then:
- switch.toggle: relay
- timing:
- ON for at most 0.5s
- OFF for at most 0.5s
- ON for at most 0.5s
- OFF for at most 0.5s
- ON for at most 0.5s
- OFF for at most 0.5s
- ON for at most 0.5s
- OFF for at most 0.5s
then:
- button.press: restart_button