Code kopieren & zu Dashboards
1# Garagentor Dashboard Card
2# Steuerung und Überwachung des Garagentors mit Status-Anzeige
3type: vertical-stack
4cards:
5 # Header mit Garagentor Status
6 - type: horizontal-stack
7 cards:
8 - type: markdown
9 content: |
10 # 🏠 Garage
11 **{{ states('cover.garage_door') | title }}**
12 card_mod:
13 style: |
14 ha-card {
15 background: linear-gradient(135deg,
16 {% if is_state('cover.garage_door', 'open') %}#4caf50
17 {% elif is_state('cover.garage_door', 'closed') %}#2196f3
18 {% elif is_state('cover.garage_door', 'opening') or is_state('cover.garage_door', 'closing') %}#ff9800
19 {% else %}#9e9e9e
20 {% endif %},
21 {% if is_state('cover.garage_door', 'open') %}#388e3c
22 {% elif is_state('cover.garage_door', 'closed') %}#1976d2
23 {% elif is_state('cover.garage_door', 'opening') or is_state('cover.garage_door', 'closing') %}#f57c00
24 {% else %}#757575
25 {% endif %});
26 color: white;
27 border-radius: 15px 15px 0 0;
28 text-align: center;
29 }
30
31 # Schnell-Status Icons
32 - type: glance
33 entities:
34 - entity: binary_sensor.garage_door_contact
35 name: "Tor"
36 - entity: binary_sensor.garage_motion
37 name: "Bewegung"
38 - entity: binary_sensor.garage_light_barrier
39 name: "Lichtschranke"
40 columns: 3
41 card_mod:
42 style: |
43 ha-card {
44 background: rgba(255,255,255,0.1);
45 color: white;
46 border-radius: 0 15px 0 0;
47 border: none;
48 }
49
50 # Hauptsteuerung
51 - type: horizontal-stack
52 cards:
53 # Garagentor Steuerung
54 - type: vertical-stack
55 cards:
56 # Cover-Steuerung mit Animation
57 - type: cover
58 entity: cover.garage_door
59 name: "Garagentor"
60 card_mod:
61 style: |
62 ha-card {
63 border-radius: 15px;
64 overflow: hidden;
65 }
66 .state {
67 {% if is_state('cover.garage_door', 'opening') or is_state('cover.garage_door', 'closing') %}
68 animation: pulse 2s infinite;
69 {% endif %}
70 }
71 @keyframes pulse {
72 0% { opacity: 1; }
73 50% { opacity: 0.5; }
74 100% { opacity: 1; }
75 }
76
77 # Manuelle Buttons
78 - type: horizontal-stack
79 cards:
80 - type: button
81 name: "Öffnen"
82 icon: "mdi:garage-open"
83 tap_action:
84 action: call-service
85 service: cover.open_cover
86 target:
87 entity_id: cover.garage_door
88 hold_action:
89 action: more-info
90 card_mod:
91 style: |
92 ha-card {
93 background: linear-gradient(45deg, #4caf50, #388e3c);
94 color: white;
95 border-radius: 10px;
96 }
97
98 - type: button
99 name: "Stopp"
100 icon: "mdi:stop"
101 tap_action:
102 action: call-service
103 service: cover.stop_cover
104 target:
105 entity_id: cover.garage_door
106 card_mod:
107 style: |
108 ha-card {
109 background: linear-gradient(45deg, #ff9800, #f57c00);
110 color: white;
111 border-radius: 10px;
112 }
113
114 - type: button
115 name: "Schließen"
116 icon: "mdi:garage"
117 tap_action:
118 action: call-service
119 service: cover.close_cover
120 target:
121 entity_id: cover.garage_door
122 hold_action:
123 action: more-info
124 card_mod:
125 style: |
126 ha-card {
127 background: linear-gradient(45deg, #2196f3, #1976d2);
128 color: white;
129 border-radius: 10px;
130 }
131
132 # Status und Sensoren
133 - type: entities
134 title: "📊 Status & Sensoren"
135 entities:
136 - entity: sensor.garage_door_position
137 name: "Position"
138 icon: "mdi:garage-variant"
139 - entity: binary_sensor.garage_door_contact
140 name: "Tor-Kontakt"
141 icon: "mdi:garage-alert-variant"
142 - entity: binary_sensor.garage_motion
143 name: "Bewegung erkannt"
144 icon: "mdi:motion-sensor"
145 - entity: binary_sensor.garage_light_barrier
146 name: "Lichtschranke"
147 icon: "mdi:gate"
148 - entity: sensor.garage_door_battery
149 name: "Batterie Fernbedienung"
150 icon: "mdi:battery"
151 card_mod:
152 style: |
153 ha-card {
154 border-radius: 15px;
155 }
156
157 # Garage Umgebung
158 - type: horizontal-stack
159 cards:
160 # Beleuchtung
161 - type: entities
162 title: "💡 Beleuchtung"
163 entities:
164 - entity: switch.garage_main_light
165 name: "Hauptlicht"
166 icon: "mdi:ceiling-light"
167 - entity: switch.garage_work_light
168 name: "Arbeitslicht"
169 icon: "mdi:desk-lamp"
170 - entity: switch.garage_automatic_light
171 name: "Automatiklicht"
172 icon: "mdi:lightbulb-auto"
173 card_mod:
174 style: |
175 ha-card {
176 border-radius: 15px;
177 }
178
179 # Weitere Geräte
180 - type: entities
181 title: "🔌 Geräte"
182 entities:
183 - entity: switch.garage_outlet_1
184 name: "Steckdose 1"
185 icon: "mdi:power-socket-eu"
186 - entity: switch.garage_outlet_2
187 name: "Steckdose 2"
188 icon: "mdi:power-socket-eu"
189 - entity: switch.garage_ventilation
190 name: "Lüftung"
191 icon: "mdi:fan"
192 - entity: sensor.garage_temperature
193 name: "Temperatur"
194 icon: "mdi:thermometer"
195 card_mod:
196 style: |
197 ha-card {
198 border-radius: 15px;
199 }
200
201 # Sicherheit und Überwachung
202 - type: conditional
203 conditions:
204 - entity: binary_sensor.garage_security_issue
205 state: "on"
206 card:
207 type: markdown
208 content: |
209 ## ⚠️ Sicherheitshinweis
210
211 {% if is_state('binary_sensor.garage_door_open_too_long', 'on') %}
212 🕐 **Tor seit {{ states('sensor.garage_door_open_duration') }} Minuten geöffnet**
213 {% endif %}
214
215 {% if is_state('binary_sensor.garage_light_barrier_blocked', 'on') %}
216 🚧 **Lichtschranke blockiert** - Hindernis im Torbereich
217 {% endif %}
218
219 {% if is_state('binary_sensor.garage_door_battery_low', 'on') %}
220 🔋 **Batterie der Fernbedienung schwach** ({{ states('sensor.garage_door_battery') }}%)
221 {% endif %}
222 card_mod:
223 style: |
224 ha-card {
225 background: rgba(244, 67, 54, 0.1);
226 border: 2px solid #f44336;
227 border-radius: 15px;
228 }
229
230 # Zeitgesteuertes öffnen/schließen
231 - type: entities
232 title: "⏰ Automatik"
233 entities:
234 - entity: input_boolean.garage_auto_close
235 name: "Automatisches Schließen"
236 icon: "mdi:garage-alert"
237 - entity: input_number.garage_auto_close_delay
238 name: "Schließen nach (min)"
239 icon: "mdi:timer"
240 - entity: input_boolean.garage_night_mode
241 name: "Nachtmodus"
242 icon: "mdi:sleep"
243 - entity: automation.garage_welcome_home
244 name: "Willkommen-Automatik"
245 icon: "mdi:home-assistant"
246 card_mod:
247 style: |
248 ha-card {
249 border-radius: 15px;
250 }
251
252 # Schnellaktionen
253 - type: horizontal-stack
254 cards:
255 - type: button
256 name: "Wegfahren"
257 icon: "mdi:car"
258 tap_action:
259 action: call-service
260 service: script.garage_leaving_home
261 card_mod:
262 style: |
263 ha-card {
264 background: linear-gradient(45deg, #9c27b0, #7b1fa2);
265 color: white;
266 border-radius: 15px;
267 }
268
269 - type: button
270 name: "Heimkommen"
271 icon: "mdi:home-import-outline"
272 tap_action:
273 action: call-service
274 service: script.garage_arriving_home
275 card_mod:
276 style: |
277 ha-card {
278 background: linear-gradient(45deg, #4caf50, #388e3c);
279 color: white;
280 border-radius: 15px;
281 }
282
283 - type: button
284 name: "Wartung"
285 icon: "mdi:wrench"
286 tap_action:
287 action: call-service
288 service: script.garage_maintenance_mode
289 card_mod:
290 style: |
291 ha-card {
292 background: linear-gradient(45deg, #ff9800, #f57c00);
293 color: white;
294 border-radius: 15px;
295 }
296
297 - type: button
298 name: "Sicherheit"
299 icon: "mdi:shield-check"
300 tap_action:
301 action: call-service
302 service: script.garage_security_check
303 card_mod:
304 style: |
305 ha-card {
306 background: linear-gradient(45deg, #f44336, #d32f2f);
307 color: white;
308 border-radius: 15px;
309 }