Code kopieren & zu Dashboards
Umfassende Überwachung und Steuerung des Energieverbrauchs, der PV-Erzeugung und der Stromkosten in einem zentralen Dashboard. - Energie-Übersicht: Gesamtverbrauch, PV-Erzeugung, Tageskosten - **L...
Umfassende Überwachung und Steuerung des Energieverbrauchs, der PV-Erzeugung und der Stromkosten in einem zentralen Dashboard.
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# Energie-Monitor Dashboard Card
# Überwacht Stromverbrauch, Erzeugung und Kosten
type: vertical-stack
cards:
# Header mit Gesamtverbrauch
- type: horizontal-stack
cards:
- type: statistic
entity: sensor.energy_consumption_total
name: "Gesamtverbrauch"
stat_type: state
unit: "kWh"
card_mod:
style: |
ha-card {
background: linear-gradient(135deg, #ff9800, #f57c00);
color: white;
border-radius: 15px;
text-align: center;
}
- type: statistic
entity: sensor.energy_production_total
name: "PV-Erzeugung"
stat_type: state
unit: "kWh"
card_mod:
style: |
ha-card {
background: linear-gradient(135deg, #4caf50, #388e3c);
color: white;
border-radius: 15px;
text-align: center;
}
- type: statistic
entity: sensor.energy_costs_today
name: "Kosten heute"
stat_type: state
unit: "€"
card_mod:
style: |
ha-card {
background: linear-gradient(135deg, #2196f3, #1976d2);
color: white;
border-radius: 15px;
text-align: center;
}
# Aktuelle Leistung
- type: horizontal-stack
cards:
- type: gauge
entity: sensor.power_consumption_current
name: "Aktueller Verbrauch"
min: 0
max: 5000
unit: "W"
severity:
green: 0
yellow: 2000
red: 4000
card_mod:
style: |
ha-card {
border-radius: 15px;
}
- type: gauge
entity: sensor.power_production_current
name: "Aktuelle PV-Leistung"
min: 0
max: 8000
unit: "W"
severity:
red: 0
yellow: 2000
green: 4000
card_mod:
style: |
ha-card {
border-radius: 15px;
}
# Energie-Fluss Visualisierung
- type: picture-elements
image: /local/images/energy-flow-bg.png
elements:
# Netz
- type: state-label
entity: sensor.grid_power
prefix: "Netz: "
suffix: " W"
style:
top: 15%
left: 15%
color: white
background-color: rgba(0,0,0,0.5)
border-radius: 10px
padding: 5px
# PV-Anlage
- type: state-label
entity: sensor.solar_power
prefix: "Solar: "
suffix: " W"
style:
top: 15%
right: 15%
color: white
background-color: rgba(0,0,0,0.5)
border-radius: 10px
padding: 5px
# Hausverbrauch
- type: state-label
entity: sensor.house_consumption
prefix: "Haus: "
suffix: " W"
style:
bottom: 15%
left: 50%
color: white
background-color: rgba(0,0,0,0.5)
border-radius: 10px
padding: 5px
# Batterie (falls vorhanden)
- type: conditional
conditions:
- entity: sensor.battery_power
state_not: "unavailable"
elements:
- type: state-label
entity: sensor.battery_power
prefix: "Batterie: "
suffix: " W"
style:
top: 50%
right: 15%
color: white
background-color: rgba(0,0,0,0.5)
border-radius: 10px
padding: 5px
# Detaillierte Verbrauchsdaten
- type: horizontal-stack
cards:
# Verbrauch nach Gerätegruppen
- type: entities
title: "🔌 Verbrauch nach Bereichen"
entities:
- entity: sensor.kitchen_power
name: "Küche"
icon: "mdi:chef-hat"
- entity: sensor.living_room_power
name: "Wohnzimmer"
icon: "mdi:sofa"
- entity: sensor.bedroom_power
name: "Schlafzimmer"
icon: "mdi:bed"
- entity: sensor.office_power
name: "Büro"
icon: "mdi:desk"
- entity: sensor.heating_power
name: "Heizung"
icon: "mdi:radiator"
card_mod:
style: |
ha-card {
border-radius: 15px;
}
# Strompreise und Tarife
- type: entities
title: "💰 Strompreise"
entities:
- entity: sensor.electricity_price_current
name: "Aktueller Preis"
icon: "mdi:currency-eur"
- entity: sensor.electricity_price_next_hour
name: "Nächste Stunde"
icon: "mdi:clock-outline"
- entity: binary_sensor.cheap_electricity_hours
name: "Günstige Stunden"
icon: "mdi:flash"
- entity: sensor.feed_in_tariff
name: "Einspeisevergütung"
icon: "mdi:solar-power"
card_mod:
style: |
ha-card {
border-radius: 15px;
}
# Energiebilanz Chart
- type: history-graph
title: "Energieverlauf (24h)"
hours_to_show: 24
refresh_interval: 300
entities:
- entity: sensor.power_consumption_current
name: "Verbrauch"
- entity: sensor.power_production_current
name: "PV-Erzeugung"
- entity: sensor.grid_power
name: "Netzbezug"
card_mod:
style: |
ha-card {
border-radius: 15px;
}
# Optimierungsempfehlungen
- type: conditional
conditions:
- entity: binary_sensor.energy_optimization_available
state: "on"
card:
type: markdown
content: |
## 💡 Optimierungsempfehlungen
{% if is_state('binary_sensor.high_pv_production', 'on') %}
☀️ **Hohe PV-Erzeugung**: Jetzt energieintensive Geräte einschalten (Waschmaschine, Spülmaschine)
{% endif %}
{% if is_state('binary_sensor.cheap_electricity_hours', 'on') %}
💰 **Günstige Strompreise**: Optimaler Zeitpunkt für Elektroauto laden oder Warmwasser
{% endif %}
{% if states('sensor.grid_power') | float > 3000 %}
⚡ **Hoher Netzbezug**: Nicht-essentielle Geräte ausschalten
{% endif %}
{% if states('sensor.battery_soc') | float < 20 %}
🔋 **Batterie niedrig**: Batterie wird geladen, Überschuss verfügbar
{% endif %}
card_mod:
style: |
ha-card {
background: rgba(76, 175, 80, 0.1);
border: 2px solid #4caf50;
border-radius: 15px;
}
# Schnellaktionen
- type: horizontal-stack
cards:
- type: button
name: "Eco-Modus"
icon: "mdi:leaf"
tap_action:
action: call-service
service: script.energy_eco_mode
card_mod:
style: |
ha-card {
background: linear-gradient(45deg, #4caf50, #388e3c);
color: white;
border-radius: 15px;
}
- type: button
name: "PV-Überschuss nutzen"
icon: "mdi:solar-power"
tap_action:
action: call-service
service: script.use_pv_excess
card_mod:
style: |
ha-card {
background: linear-gradient(45deg, #ff9800, #f57c00);
color: white;
border-radius: 15px;
}
- type: button
name: "Nachtmodus"
icon: "mdi:power-sleep"
tap_action:
action: call-service
service: script.energy_night_mode
card_mod:
style: |
ha-card {
background: linear-gradient(45deg, #9c27b0, #7b1fa2);
color: white;
border-radius: 15px;
}