-
Notifications
You must be signed in to change notification settings - Fork 7
/
covers.yaml
157 lines (150 loc) · 6.15 KB
/
covers.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
########################################################################################################################
# Office Curtains #
########################################################################################################################
- platform: template
covers:
office_curtain_left:
device_class: curtain
friendly_name: Office Curtain Left
optimistic: true # Force optimistic mode, i.e. open-close state is kept internally
open_cover:
- service: switch.turn_on
target:
entity_id: switch.office_curtain_left_relay2
close_cover:
- service: switch.turn_on
target:
entity_id: switch.office_curtain_left_relay1
stop_cover:
- service: switch.turn_off
target:
entity_id: switch.office_curtain_left_relay1
- service: switch.turn_off
target:
entity_id: switch.office_curtain_left_relay2
office_curtain_right:
device_class: curtain
friendly_name: Office Curtain Right
optimistic: true # Force optimistic mode, i.e. open-close state is kept internally
open_cover:
- service: switch.turn_on
target:
entity_id: switch.office_curtain_right_relay1
close_cover:
- service: switch.turn_on
target:
entity_id: switch.office_curtain_right_relay2
stop_cover:
- service: switch.turn_off
target:
entity_id: switch.office_curtain_right_relay1
- service: switch.turn_off
target:
entity_id: switch.office_curtain_right_relay2
# There is something called cover_group, maybe use that instead?
# https://www.home-assistant.io/integrations/cover.template/#multiple-covers
- platform: group
name: Office Curtains
entities:
- cover.office_curtain_left
- cover.office_curtain_right
########################################################################################################################
# Office Blinds #
########################################################################################################################
- platform: template
covers:
office_blinds:
device_class: blind
friendly_name: Office Blinds
tilt_optimistic: true # Force tilt optimistic mode, i.e. open-close state is kept internally
value_template: "{{ is_state('binary_sensor.office_blinds_contact', 'on') }}"
open_cover:
- service: cover.set_cover_tilt_position
target:
entity_id: cover.office_blinds
data:
tilt_position: 100
close_cover:
- service: cover.set_cover_tilt_position
target:
entity_id: cover.office_blinds
data:
tilt_position: 0
stop_cover:
- service: cover.stop_cover
target:
entity_id: cover.office_blinds_raw
set_cover_tilt_position:
# first close close cover entirely
- service: cover.close_cover
target:
entity_id: cover.office_blinds_raw
- wait_template: "{{ is_state('binary_sensor.office_blinds_contact', 'off') }}"
timeout: "00:00:06"
- service: cover.stop_cover
data:
entity_id: cover.office_blinds_raw
# if titlt position is 0, we stop, otherwise we now move to the target tilt position
- condition: template
value_template: "{{ tilt | int > 0 }}"
- service: cover.open_cover
target:
entity_id: cover.office_blinds_raw
- wait_template: "{{ is_state('binary_sensor.office_blinds_contact', 'on') }}"
timeout: "00:00:02"
- delay: "00:00:0{{ (tilt * 0.025) }}"
- service: cover.stop_cover
data:
entity_id: cover.office_blinds_raw
# open_cover:
# - service: cover.open_cover
# target:
# entity_id: cover.office_blinds_raw
# - delay: "00:00:05"
# - service: cover.stop_cover
# data:
# entity_id: cover.office_blinds_raw
########################################################################################################################
# Hallway Curtains #
########################################################################################################################
- platform: template
covers:
hallway_curtain:
device_class: curtain
friendly_name: Hallway Curtain
optimistic: true # Force optimistic mode, i.e. open-close state is kept internally
open_cover:
- service: switch.turn_on
target:
entity_id: switch.front_door_curtain_relay2
close_cover:
- service: switch.turn_on
target:
entity_id: switch.front_door_curtain_relay1
stop_cover:
- service: switch.turn_off
target:
entity_id: switch.front_door_curtain_relay1
- service: switch.turn_off
target:
entity_id: switch.front_door_curtain_relay2
########################################################################################################################
# Bedroom Window #
########################################################################################################################
- platform: template
covers:
master_bedroom_window:
device_class: window
friendly_name: Master Bedroom Window
value_template: "{{ is_state('binary_sensor.bedroom_window', 'on') }}"
open_cover:
- service: script.open_bedroom_window
close_cover:
- service: script.close_bedroom_window
stop_cover:
- service: switch.turn_off
target:
entity_id: switch.bedroom_window_close_relay
- service: switch.turn_off
target:
entity_id: switch.bedroom_window_open_relay