-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblind.yaml
143 lines (128 loc) · 2.92 KB
/
blind.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
esphome:
name: blind
platform: ESP8266
board: d1_mini_lite
wifi:
ssid: "SSID"
password: "SSIDPWD"
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
#############################
# TIME: open cover based on time
#############################
time:
- platform: homeassistant
id: homeassistant_time
on_time:
- seconds: 0
minutes: 30
hours: 8
days_of_week: MON-FRI
then:
- cover.open: lichtkoepel
- seconds: 0
minutes: 30
hours: 9
days_of_week: SAT-SUN
then:
- cover.open: lichtkoepel
- seconds: 0
minutes: 05
hours: 20
then:
- cover.close: lichtkoepel
#############################
#############################
# Switches for Cover
#############################
#############################
switch:
###########################
# instruct motor to CLOSE #
###########################
- platform: gpio
pin: D4
id: close_pin
# Use interlocking to keep at most one of the two directions on
interlock: &interlock_group [close_pin, open_pin]
# If ESP reboots, do not attempt to restore switch state
restore_mode: always off
###########################
# instruct motor to OPEN #
###########################
- platform: gpio
pin: D3
id: open_pin
interlock: *interlock_group
restore_mode: always off
binary_sensor:
#########################
# ENDSTOP CLOSED ########
#########################
- platform: gpio
pin: D1
id: closed_endstop
filters:
- invert:
#########################
# ENDSTOP OPENED ########
#########################
- platform: gpio
pin: D7
id: opened_endstop
filters:
- invert:
#########################
# OPEN BUTTON ########
#########################
- platform: gpio
id: open_button
pin: D5
on_press:
if:
condition:
# if we are closing, stop:
switch.is_on: close_pin
then:
- cover.stop: lichtkoepel
else:
- cover.open: lichtkoepel
#########################
# CLOSE BUTTON ########
#########################
- platform: gpio
id: close_button
pin: D6
on_press:
if:
condition:
# if we are opening, stop:
switch.is_on: open_pin
then:
- cover.stop: lichtkoepel
else:
- cover.close: lichtkoepel
#############################
#############################
# COVER ########
#############################
#############################
cover:
- platform: endstop
name: "lichtkoepel"
id: lichtkoepel
open_action:
- switch.turn_on: open_pin
open_duration: 16s
open_endstop: opened_endstop
close_action:
- switch.turn_on: close_pin
close_duration: 16s
close_endstop: closed_endstop
stop_action:
- switch.turn_off: close_pin
- switch.turn_off: open_pin
max_duration: 30s