Code kopieren & zu Dashboards
1# Energie-Monitor Dashboard Card
2# Überwacht Stromverbrauch, Erzeugung und Kosten
3type: vertical-stack
4cards:
5 # Header mit Gesamtverbrauch
6 - type: horizontal-stack
7 cards:
8 - type: statistic
9 entity: sensor.energy_consumption_total
10 name: "Gesamtverbrauch"
11 stat_type: state
12 unit: "kWh"
13 card_mod:
14 style: |
15 ha-card {
16 background: linear-gradient(135deg, #ff9800, #f57c00);
17 color: white;
18 border-radius: 15px;
19 text-align: center;
20 }
21
22 - type: statistic
23 entity: sensor.energy_production_total
24 name: "PV-Erzeugung"
25 stat_type: state
26 unit: "kWh"
27 card_mod:
28 style: |
29 ha-card {
30 background: linear-gradient(135deg, #4caf50, #388e3c);
31 color: white;
32 border-radius: 15px;
33 text-align: center;
34 }
35
36 - type: statistic
37 entity: sensor.energy_costs_today
38 name: "Kosten heute"
39 stat_type: state
40 unit: "€"
41 card_mod:
42 style: |
43 ha-card {
44 background: linear-gradient(135deg, #2196f3, #1976d2);
45 color: white;
46 border-radius: 15px;
47 text-align: center;
48 }
49
50 # Aktuelle Leistung
51 - type: horizontal-stack
52 cards:
53 - type: gauge
54 entity: sensor.power_consumption_current
55 name: "Aktueller Verbrauch"
56 min: 0
57 max: 5000
58 unit: "W"
59 severity:
60 green: 0
61 yellow: 2000
62 red: 4000
63 card_mod:
64 style: |
65 ha-card {
66 border-radius: 15px;
67 }
68
69 - type: gauge
70 entity: sensor.power_production_current
71 name: "Aktuelle PV-Leistung"
72 min: 0
73 max: 8000
74 unit: "W"
75 severity:
76 red: 0
77 yellow: 2000
78 green: 4000
79 card_mod:
80 style: |
81 ha-card {
82 border-radius: 15px;
83 }
84
85 # Energie-Fluss Visualisierung
86 - type: picture-elements
87 image: /local/images/energy-flow-bg.png
88 elements:
89 # Netz
90 - type: state-label
91 entity: sensor.grid_power
92 prefix: "Netz: "
93 suffix: " W"
94 style:
95 top: 15%
96 left: 15%
97 color: white
98 background-color: rgba(0,0,0,0.5)
99 border-radius: 10px
100 padding: 5px
101
102 # PV-Anlage
103 - type: state-label
104 entity: sensor.solar_power
105 prefix: "Solar: "
106 suffix: " W"
107 style:
108 top: 15%
109 right: 15%
110 color: white
111 background-color: rgba(0,0,0,0.5)
112 border-radius: 10px
113 padding: 5px
114
115 # Hausverbrauch
116 - type: state-label
117 entity: sensor.house_consumption
118 prefix: "Haus: "
119 suffix: " W"
120 style:
121 bottom: 15%
122 left: 50%
123 color: white
124 background-color: rgba(0,0,0,0.5)
125 border-radius: 10px
126 padding: 5px
127
128 # Batterie (falls vorhanden)
129 - type: conditional
130 conditions:
131 - entity: sensor.battery_power
132 state_not: "unavailable"
133 elements:
134 - type: state-label
135 entity: sensor.battery_power
136 prefix: "Batterie: "
137 suffix: " W"
138 style:
139 top: 50%
140 right: 15%
141 color: white
142 background-color: rgba(0,0,0,0.5)
143 border-radius: 10px
144 padding: 5px
145
146 # Detaillierte Verbrauchsdaten
147 - type: horizontal-stack
148 cards:
149 # Verbrauch nach Gerätegruppen
150 - type: entities
151 title: "🔌 Verbrauch nach Bereichen"
152 entities:
153 - entity: sensor.kitchen_power
154 name: "Küche"
155 icon: "mdi:chef-hat"
156 - entity: sensor.living_room_power
157 name: "Wohnzimmer"
158 icon: "mdi:sofa"
159 - entity: sensor.bedroom_power
160 name: "Schlafzimmer"
161 icon: "mdi:bed"
162 - entity: sensor.office_power
163 name: "Büro"
164 icon: "mdi:desk"
165 - entity: sensor.heating_power
166 name: "Heizung"
167 icon: "mdi:radiator"
168 card_mod:
169 style: |
170 ha-card {
171 border-radius: 15px;
172 }
173
174 # Strompreise und Tarife
175 - type: entities
176 title: "💰 Strompreise"
177 entities:
178 - entity: sensor.electricity_price_current
179 name: "Aktueller Preis"
180 icon: "mdi:currency-eur"
181 - entity: sensor.electricity_price_next_hour
182 name: "Nächste Stunde"
183 icon: "mdi:clock-outline"
184 - entity: binary_sensor.cheap_electricity_hours
185 name: "Günstige Stunden"
186 icon: "mdi:flash"
187 - entity: sensor.feed_in_tariff
188 name: "Einspeisevergütung"
189 icon: "mdi:solar-power"
190 card_mod:
191 style: |
192 ha-card {
193 border-radius: 15px;
194 }
195
196 # Energiebilanz Chart
197 - type: history-graph
198 title: "Energieverlauf (24h)"
199 hours_to_show: 24
200 refresh_interval: 300
201 entities:
202 - entity: sensor.power_consumption_current
203 name: "Verbrauch"
204 - entity: sensor.power_production_current
205 name: "PV-Erzeugung"
206 - entity: sensor.grid_power
207 name: "Netzbezug"
208 card_mod:
209 style: |
210 ha-card {
211 border-radius: 15px;
212 }
213
214 # Optimierungsempfehlungen
215 - type: conditional
216 conditions:
217 - entity: binary_sensor.energy_optimization_available
218 state: "on"
219 card:
220 type: markdown
221 content: |
222 ## 💡 Optimierungsempfehlungen
223
224 {% if is_state('binary_sensor.high_pv_production', 'on') %}
225 ☀️ **Hohe PV-Erzeugung**: Jetzt energieintensive Geräte einschalten (Waschmaschine, Spülmaschine)
226 {% endif %}
227
228 {% if is_state('binary_sensor.cheap_electricity_hours', 'on') %}
229 💰 **Günstige Strompreise**: Optimaler Zeitpunkt für Elektroauto laden oder Warmwasser
230 {% endif %}
231
232 {% if states('sensor.grid_power') | float > 3000 %}
233 ⚡ **Hoher Netzbezug**: Nicht-essentielle Geräte ausschalten
234 {% endif %}
235
236 {% if states('sensor.battery_soc') | float < 20 %}
237 🔋 **Batterie niedrig**: Batterie wird geladen, Überschuss verfügbar
238 {% endif %}
239 card_mod:
240 style: |
241 ha-card {
242 background: rgba(76, 175, 80, 0.1);
243 border: 2px solid #4caf50;
244 border-radius: 15px;
245 }
246
247 # Schnellaktionen
248 - type: horizontal-stack
249 cards:
250 - type: button
251 name: "Eco-Modus"
252 icon: "mdi:leaf"
253 tap_action:
254 action: call-service
255 service: script.energy_eco_mode
256 card_mod:
257 style: |
258 ha-card {
259 background: linear-gradient(45deg, #4caf50, #388e3c);
260 color: white;
261 border-radius: 15px;
262 }
263
264 - type: button
265 name: "PV-Überschuss nutzen"
266 icon: "mdi:solar-power"
267 tap_action:
268 action: call-service
269 service: script.use_pv_excess
270 card_mod:
271 style: |
272 ha-card {
273 background: linear-gradient(45deg, #ff9800, #f57c00);
274 color: white;
275 border-radius: 15px;
276 }
277
278 - type: button
279 name: "Nachtmodus"
280 icon: "mdi:power-sleep"
281 tap_action:
282 action: call-service
283 service: script.energy_night_mode
284 card_mod:
285 style: |
286 ha-card {
287 background: linear-gradient(45deg, #9c27b0, #7b1fa2);
288 color: white;
289 border-radius: 15px;
290 }