-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHA-blueprint-rollerblind.yaml
142 lines (136 loc) · 4.76 KB
/
HA-blueprint-rollerblind.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
blueprint:
name: Rollo Steuerung Fernbedienung (Zigbee)
description: Steuere ein Rollo mit einer Zigbee-Fernbedienung (Hoch und Runter). Stoppt das Rollo, wenn es bereits in Bewegung ist.
domain: automation
input:
remote:
name: Fernbedienung
description: Die Zigbee-Fernbedienung, die zum Steuern des Rollos verwendet wird.
selector:
device:
integration: {}
hoch_button:
name: Hoch Button
description: Der Button für Hoch auf der Fernbedienung.
selector:
entity:
domain: button
device_class: button
runter_button:
name: Runter Button
description: Der Button für Runter auf der Fernbedienung.
selector:
entity:
domain: button
device_class: button
rollo:
name: Rollo
description: Das zu steuernde Rollo.
selector:
entity:
domain: cover
trigger:
- platform: device
device_id: !input remote
domain: button
entity_id: !input hoch_button
type: pressed
id: Hoch
- platform: device
device_id: !input remote
domain: button
entity_id: !input runter_button
type: pressed
id: Runter
action:
- choose:
# --- Wenn Hoch gedrückt wird ---
- conditions:
- condition: trigger
id: Hoch
sequence:
- choose:
# Falls das Rollo gerade schließt oder öffnet, stoppe es
- conditions:
- condition: or
conditions:
- condition: state
entity_id: !input rollo
state: closing
- condition: state
entity_id: !input rollo
state: opening
sequence:
- service: logbook.log
data:
name: "Rollo Steuerung"
message: "Stoppe Rollo, da Hoch gedrückt wurde"
- service: cover.stop_cover
target:
entity_id: !input rollo
- wait_template: "{{ is_state(input.rollo, 'stopped') }}"
- service: logbook.log
data:
name: "Rollo Steuerung"
message: "Rollo gestoppt"
# Falls das Rollo nicht bereits öffnet, öffne es
- conditions:
- condition: not
conditions:
- condition: state
entity_id: !input rollo
state: opening
sequence:
- service: logbook.log
data:
name: "Rollo Steuerung"
message: "Öffne Rollo, da Hoch gedrückt wurde"
- service: cover.open_cover
target:
entity_id: !input rollo
# --- Wenn Runter gedrückt wird ---
- conditions:
- condition: trigger
id: Runter
sequence:
- choose:
# Falls das Rollo gerade öffnet oder schließt, stoppe es
- conditions:
- condition: or
conditions:
- condition: state
entity_id: !input rollo
state: opening
- condition: state
entity_id: !input rollo
state: closing
sequence:
- service: logbook.log
data:
name: "Rollo Steuerung"
message: "Stoppe Rollo, da Runter gedrückt wurde"
- service: cover.stop_cover
target:
entity_id: !input rollo
- wait_template: "{{ is_state(input.rollo, 'stopped') }}"
- service: logbook.log
data:
name: "Rollo Steuerung"
message: "Rollo gestoppt"
# Falls das Rollo nicht bereits schließt, schließe es
- conditions:
- condition: not
conditions:
- condition: state
entity_id: !input rollo
state: closing
sequence:
- service: logbook.log
data:
name: "Rollo Steuerung"
message: "Schließe Rollo, da Runter gedrückt wurde"
- service: cover.close_cover
target:
entity_id: !input rollo
- delay: "00:00:02" # 2 Sekunden Verzögerung als zusätzliche Absicherung
mode: restart