-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcode.yaml
101 lines (82 loc) · 1.74 KB
/
code.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
esphome:
name: gate
friendly_name: GATE
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "<YOU_KEY"
ota:
password: "<YOU_OTA_PASSWORD>"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Gate Fallback Hotspot"
password: "<YOU_FAILBACK_PASSWORD>"
captive_portal:
########################################
status_led:
pin: 13
binary_sensor:
# Кнопка 1
- platform: gpio
pin:
number: 9
mode: INPUT_PULLUP
inverted: true
name: "button1"
id: button1
# Нажатие кнопки1 переключает реле1
on_click:
min_length: 50ms
max_length: 350ms
then:
- switch.turn_on: relay1
- delay: 350ms
- switch.turn_off: relay1
- delay: 350ms
- switch.turn_off: relay1
# Кнопка 2
- platform: gpio
pin:
number: 0
mode: INPUT_PULLUP
inverted: true
name: "button2"
id: button2
# Нажатие кнопки2 переключает реле2
on_click:
min_length: 50ms
max_length: 350ms
then:
- switch.turn_on: relay2
- delay: 350ms
- switch.turn_off: relay2
- delay: 350ms
- switch.turn_off: relay2
switch:
# Реле 1
- platform: gpio
name: "relay1"
pin: GPIO12
id: relay1
icon: "mdi:gate"
interlock: [relay2]
on_turn_on:
- delay: 350ms
- switch.turn_off: relay1
# Реле 2
- platform: gpio
name: "relay2"
pin: GPIO5
id: relay2
icon: "mdi:gate-open"
interlock: [relay1]
on_turn_on:
- delay: 350ms
- switch.turn_off: relay2