YAML: Omnibattery Batterij kaart
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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
| type: grid column_span: 4 cards: - type: heading heading: Batterij heading_style: title icon: mdi:home-battery tap_action: action: more-info entity: sensor.omnibattery_integration_status card_mod: style: | .title::after { content: " {{ state_translated('sensor.omnibattery_integration_status') }}"; font-weight: 400; opacity: 0.8; } - type: horizontal-stack cards: - type: custom:mushroom-template-card primary: > {{ states('sensor.omnibattery_system_soc') | float(0) | round(0) | int }}% · {{ states('sensor.omnibattery_system_stored_energy') | float(0) | round(2) }} kWh secondary: > {% set soc = states('sensor.omnibattery_system_soc') | float(0) %} {% set vermogen = states('sensor.omnibattery_system_battery_cell_power') | float(0) %} {% set energie = states('sensor.omnibattery_system_stored_energy') | float(0) %} {% set max_capaciteit = 15.36 %} {% set reserve = 1.85 %} {% if vermogen < 0 %} {% set bruikbaar = [energie - reserve, 0] | max %} {% set uren = bruikbaar / (vermogen | abs / 1000) %} {% set status = "Leeg in " %} {% elif vermogen > 0 %} {% set nog_te_laden = [max_capaciteit - energie, 0] | max %} {% set uren = nog_te_laden / (vermogen / 1000) %} {% set status = "Vol in " %} {% else %} {% set uren = 0 %} {% set status = "Stand-by" %} {% endif %} {% if soc <= 12 %} Leeg {% elif status == "Stand-by" %} Volledig opgeladen of stand-by {% elif uren <= 0 %} 0 min {% elif uren < 1 %} {{ status ~ (uren * 60) | round(0) }} min {% else %} {% set h = uren | int %} {% set m = ((uren - h) * 60) | round(0) %} {{ status ~ h }}u {{ m }}m {% endif %} icon: > {% set vermogen = states('sensor.omnibattery_system_battery_cell_power') | float(0) %} {% set energie = states('sensor.omnibattery_system_stored_energy') | float(0) %} {% set pct = (energie / 15.36 * 100) | int %} {% if vermogen > 0 %} {% if pct < 10 %} mdi:battery-charging-10 {% elif pct < 20 %} mdi:battery-charging-20 {% elif pct < 30 %} mdi:battery-charging-30 {% elif pct < 40 %} mdi:battery-charging-40 {% elif pct < 50 %} mdi:battery-charging-50 {% elif pct < 60 %} mdi:battery-charging-60 {% elif pct < 70 %} mdi:battery-charging-70 {% elif pct < 80 %} mdi:battery-charging-80 {% elif pct < 90 %} mdi:battery-charging-90 {% else %} mdi:battery-charging {% endif %} {% else %} {% if pct < 10 %} mdi:battery-10 {% elif pct < 20 %} mdi:battery-20 {% elif pct < 30 %} mdi:battery-30 {% elif pct < 40 %} mdi:battery-40 {% elif pct < 50 %} mdi:battery-50 {% elif pct < 60 %} mdi:battery-60 {% elif pct < 70 %} mdi:battery-70 {% elif pct < 80 %} mdi:battery-80 {% elif pct < 90 %} mdi:battery-90 {% else %} mdi:battery {% endif %} {% endif %} multiline_secondary: false color: > {% set soc = states('sensor.omnibattery_system_soc') | float(0) %} {% set vermogen = states('sensor.omnibattery_system_battery_cell_power') | float(0) %} {% if soc <= 12 %} red {% elif vermogen > 0 %} green {% elif vermogen < 0 %} orange {% else %} blue {% endif %} grid_options: columns: full features_position: bottom entity: sensor.omnibattery_system_soc card_mod: style: | ha-card { --card-primary-font-size: 28px; --card-primary-font-weight: 700; --card-secondary-font-size: 14px; border-color: transparent; {% set soc = [[states('sensor.omnibattery_system_soc') | float(0), 0] | max, 100] | min %} {% set p = states('sensor.omnibattery_system_battery_cell_power') | float(0) %} {% set c = '244,67,54' if soc <= 12 else ('76,175,80' if p > 0 else ('255,152,0' if p < 0 else '33,150,243')) %} background: linear-gradient(90deg, rgba({{ c }},0.30) {{ soc }}%, rgba({{ c }},0.06) {{ soc }}%); } - type: custom:mushroom-template-card primary: >- {%- set e1 = 'sensor.omnibattery_consumption_profile_capture' -%} {%- set e2 = 'sensor.omnibattery_expected_home_consumption_profile' -%} {%- set a = states(e1) | float(0) -%} {%- set b = states(e2) | float(0) -%} {%- if state_attr(e1, 'unit_of_measurement') == 'Wh' -%}{%- set a = a / 1000 -%}{%- endif -%} {%- if state_attr(e2, 'unit_of_measurement') == 'Wh' -%}{%- set b = b / 1000 -%}{%- endif -%} {{ '%.1f' | format(a) | replace('.', ',') }} / {{ '%.1f' | format(b) | replace('.', ',') }} kWh secondary: Verbruikt / verwacht icon: mdi:home-lightning-bolt entity: sensor.omnibattery_expected_home_consumption_profile multiline_secondary: false color: amber tap_action: action: more-info entity: sensor.omnibattery_consumption_profile_capture hold_action: action: more-info entity: sensor.omnibattery_expected_home_consumption_profile double_tap_action: action: none card_mod: style: | ha-card { --card-primary-font-size: 28px; --card-primary-font-weight: 700; --card-secondary-font-size: 14px; border-color: transparent; } - type: custom:mushroom-template-card entity: binary_sensor.omnibattery_predictive_charging_active icon: mdi:transmission-tower-import icon_color: >- {{ 'green' if is_state('sensor.omnibattery_integration_status', 'grid_charging') else 'blue' }} primary: >- {%- set now_s = now().strftime('%Y-%m-%dT%H:%M:%S') -%} {%- set today = now().strftime('%Y-%m-%d') -%} {%- set slots = state_attr('binary_sensor.omnibattery_predictive_charging_active', 'selected_hours') or [] -%} {%- set ns = namespace(r=[], d=[], pd='') -%} {%- for x in slots | selectattr('end', 'gt', now_s) | sort(attribute='start') -%} {%- set dag = 0 if x.start[:10] == today else 1 -%} {%- set u = x.start[11:13] | int -%} {%- set deel = 0 if u < 12 else (1 if u < 18 else 2) -%} {%- set b = dag * 3 + deel -%} {%- if ns.r | count > 0 and (ns.r[-1][2] == x.start or ns.r[-1][0] == b) -%} {%- set ns.r = ns.r[:-1] + [(ns.r[-1][0], ns.r[-1][1], x.end)] -%} {%- else -%} {%- set ns.r = ns.r + [(b, x.start, x.end)] -%} {%- endif -%} {%- endfor -%} {%- set show = ns.r[:2] -%} {%- if ns.r | count > 2 -%} {%- set show = [ns.r[0], (ns.r[1][0], ns.r[1][1], ns.r[-1][2])] -%} {%- endif -%} {%- for a in show -%} {%- set voor = 'Morgen ' if (a[1][:10] != today and a[1][:10] != ns.pd) else '' -%} {%- set na = 'morgen ' if (a[2][:10] != a[1][:10] and a[2][11:16] != '00:00') else '' -%} {%- set ns.d = ns.d + [voor ~ a[1][11:16] ~ ' t/m ' ~ na ~ a[2][11:16]] -%} {%- set ns.pd = a[1][:10] -%} {%- endfor -%} {{ ns.d | join(' · ') if ns.d | count > 0 else 'Tekort, maar prijstechnisch niet interessant' }} secondary: >- {%- set now_s = now().strftime('%Y-%m-%dT%H:%M:%S') -%} {%- set p = state_attr('binary_sensor.omnibattery_predictive_charging_active', 'average_price') | float(0) -%} {%- set k = state_attr('binary_sensor.omnibattery_predictive_charging_active', 'estimated_cost') | float(0) -%} {%- set t = state_attr('binary_sensor.omnibattery_predictive_charging_active', 'slot_energy_targets_kwh') or {} -%} {%- set ns = namespace(kwh=0) -%} {%- for key, v in t.items() -%} {%- if key.split('/')[1] > now_s -%} {%- set ns.kwh = ns.kwh + (v | float(0)) -%} {%- endif -%} {%- endfor -%} {%- if ns.kwh == 0 -%} {%- set ns.kwh = state_attr('binary_sensor.omnibattery_predictive_charging_active', 'planned_grid_charge_kwh') | float(0) -%} {%- endif -%} {{ '%.1f' | format(ns.kwh) | replace('.', ',') }} kWh · gem. €{{ '%.2f' | format(p) | replace('.', ',') }}/kWh · ca. €{{ '%.2f' | format(k) | replace('.', ',') }} multiline_secondary: false tap_action: action: more-info visibility: - condition: numeric_state entity: binary_sensor.omnibattery_predictive_charging_active attribute: planned_grid_charge_kwh above: 0 - condition: template value_template: > {% set slots = state_attr('binary_sensor.omnibattery_predictive_charging_active', 'selected_hours') or [] %} {% set now_s = now().strftime('%Y-%m-%dT%H:%M:%S') %} {{ slots | selectattr('end', 'gt', now_s) | list | count > 0 }} card_mod: style: | ha-card { --card-primary-font-size: 20px; --card-primary-font-weight: 700; --card-secondary-font-size: 13px; border-color: transparent; {% if is_state('sensor.omnibattery_integration_status', 'grid_charging') %} background: rgba(76,175,80,0.18); {% else %} background: rgba(33,150,243,0.12); {% endif %} } grid_options: columns: 12 rows: 1 - type: custom:mushroom-template-card entity: sensor.omnibattery_high_price_discharge_status icon: mdi:transmission-tower-export icon_color: >- {{ 'grey' if is_state('sensor.omnibattery_high_price_discharge_status', 'waiting') else 'orange' }} primary: >- {%- set today = now().strftime('%Y-%m-%d') -%} {%- set al = state_attr('sensor.omnibattery_high_price_discharge_status', 'allocations') or [] -%} {%- set ns = namespace(r=[], d=[]) -%} {%- for x in al | sort(attribute='start') if as_datetime(x.end) > now() -%} {%- if ns.r | count > 0 and ns.r[-1][1] == as_datetime(x.start) -%} {%- set ns.r = ns.r[:-1] + [(ns.r[-1][0], as_datetime(x.end))] -%} {%- else -%} {%- set ns.r = ns.r + [(as_datetime(x.start), as_datetime(x.end))] -%} {%- endif -%} {%- endfor -%} {%- set show = ns.r[:2] -%} {%- if ns.r | count > 2 -%} {%- set show = [ns.r[0], (ns.r[1][0], ns.r[-1][1])] -%} {%- endif -%} {%- for a in show -%} {%- set s = a[0] | as_local -%} {%- set e = a[1] | as_local -%} {%- set voor = 'Morgen ' if s.strftime('%Y-%m-%d') != today else '' -%} {%- set na = 'morgen ' if (e.strftime('%Y-%m-%d') != s.strftime('%Y-%m-%d') and e.strftime('%H:%M') != '00:00') else '' -%} {%- set ns.d = ns.d + [voor ~ s.strftime('%H:%M') ~ ' t/m ' ~ na ~ e.strftime('%H:%M')] -%} {%- endfor -%} {{ ns.d | join(' · ') if ns.d | count > 0 else 'Geen verkoop gepland' }} secondary: >- {%- set al = state_attr('sensor.omnibattery_high_price_discharge_status', 'allocations') or [] -%} {%- set ns = namespace(kwh=0, eur=0) -%} {%- for x in al if as_datetime(x.end) > now() -%} {%- set ns.kwh = ns.kwh + (x.energy_kwh | float(0)) -%} {%- set ns.eur = ns.eur + (x.energy_kwh | float(0)) * (x.export_price | float(0)) -%} {%- endfor -%} {%- set gem = (ns.eur / ns.kwh) if ns.kwh > 0 else 0 -%} {{ 'Verkoop gepland' if is_state('sensor.omnibattery_high_price_discharge_status', 'waiting') else 'Verkoopt nu' }} · {{ '%.1f' | format(ns.kwh) | replace('.', ',') }} kWh · gem. €{{ '%.2f' | format(gem) | replace('.', ',') }}/kWh multiline_secondary: false tap_action: action: more-info visibility: - condition: state entity: sensor.omnibattery_high_price_discharge_status attribute: enabled state: 'true' - condition: state entity: sensor.omnibattery_high_price_discharge_status attribute: plan_status state: planned - condition: numeric_state entity: sensor.omnibattery_high_price_discharge_status attribute: total_allocated_kwh above: 0 card_mod: style: | ha-card { --card-primary-font-size: 20px; --card-primary-font-weight: 700; --card-secondary-font-size: 13px; border-color: transparent; {% if is_state('sensor.omnibattery_high_price_discharge_status', 'waiting') %} background: rgba(128,128,128,0.10); {% else %} background: linear-gradient(90deg, rgba(255,152,0,0.30) 100%, rgba(255,152,0,0.06) 100%); {% endif %} } grid_options: columns: 12 rows: 1 - type: custom:mushroom-template-card entity: binary_sensor.omnibattery_discharge_reserve_status icon: mdi:battery-lock icon_color: purple primary: >- {%- set now_s = now().strftime('%Y-%m-%dT%H:%M:%S') -%} {%- set today = now().strftime('%Y-%m-%d') -%} {%- set slots = state_attr('binary_sensor.omnibattery_discharge_reserve_status', 'reserved_slots') or [] -%} {%- set ns = namespace(r=[], d=[]) -%} {%- for x in slots | selectattr('end', 'gt', now_s) | sort(attribute='start') -%} {%- set dag = 0 if x.start[:10] == today else 1 -%} {%- set deel = 0 if x.start[11:13] | int < 12 else 1 -%} {%- set b = dag * 2 + deel -%} {%- if ns.r | count > 0 and (ns.r[-1][2] == x.start or ns.r[-1][0] == b) -%} {%- set ns.r = ns.r[:-1] + [(ns.r[-1][0], ns.r[-1][1], x.end)] -%} {%- else -%} {%- set ns.r = ns.r + [(b, x.start, x.end)] -%} {%- endif -%} {%- endfor -%} {%- for a in ns.r[:2] -%} {%- set voor = 'Morgen ' if a[1][:10] != today else '' -%} {%- set na = 'morgen ' if (a[2][:10] != a[1][:10] and a[2][11:16] != '00:00') else '' -%} {%- set ns.d = ns.d + [voor ~ a[1][11:16] ~ ' t/m ' ~ na ~ a[2][11:16]] -%} {%- endfor -%} {{ ns.d | join(' · ') if ns.d | count > 0 else 'Reserve actief' }} secondary: >- {%- set soc = state_attr('binary_sensor.omnibattery_discharge_reserve_status', 'reserve_soc_pct') | float(0) -%} {%- set kwh = state_attr('binary_sensor.omnibattery_discharge_reserve_status', 'reserve_kwh') | float(0) -%} Bewaard voor duurdere uren · {{ '%.0f' | format(soc) }}% · {{ '%.1f' | format(kwh) | replace('.', ',') }} kWh multiline_secondary: false tap_action: action: more-info visibility: - condition: state entity: binary_sensor.omnibattery_discharge_reserve_status state: 'on' card_mod: style: | ha-card { --card-primary-font-size: 20px; --card-primary-font-weight: 700; --card-secondary-font-size: 13px; border-color: transparent; background: rgba(156,39,176,0.12); } grid_options: columns: 12 rows: 1 - type: grid columns: 3 square: false cards: - type: custom:mushroom-entity-card entity: sensor.omnibattery_home_consumption name: Verbruik woning icon_type: none layout: vertical primary_info: state secondary_info: name card_mod: style: | ha-card { border-color: transparent; background: rgba(128,128,128,0.08); --spacing: 8px; --card-primary-font-size: 16px; --card-primary-font-weight: 700; --card-secondary-font-size: 11px; } - type: custom:mushroom-entity-card entity: sensor.energy_grid_electricity_meter_energieverbruik_electricity_meter_energieproductie_net_power name: Grid icon_type: none layout: vertical primary_info: state secondary_info: name card_mod: style: | ha-card { border-color: transparent; background: rgba(128,128,128,0.08); --spacing: 8px; --card-primary-font-size: 16px; --card-primary-font-weight: 700; --card-secondary-font-size: 11px; } - type: custom:mushroom-entity-card entity: sensor.solcast_pv_forecast_forecast_remaining_today name: Zon resterend icon_type: none layout: vertical primary_info: state secondary_info: name card_mod: style: | ha-card { border-color: transparent; background: rgba(128,128,128,0.08); --spacing: 8px; --card-primary-font-size: 16px; --card-primary-font-weight: 700; --card-secondary-font-size: 11px; } - type: grid columns: 2 square: false cards: - type: custom:mushroom-entity-card entity: switch.omnibattery_excluded_device_enabled_0 name: Auto uitsluiten icon: mdi:ev-station icon_color: blue tap_action: action: more-info card_mod: style: | ha-card { border-color: transparent; {% if is_state('switch.omnibattery_excluded_device_enabled_0', 'on') %} background: rgba(33,150,243,0.18); {% else %} background: rgba(128,128,128,0.08); {% endif %} } - type: custom:mushroom-entity-card entity: switch.omnibattery_solar_surplus_0 name: Slim autoladen zon icon: mdi:ev-station icon_color: amber tap_action: action: more-info card_mod: style: | ha-card { border-color: transparent; {% if is_state('switch.omnibattery_solar_surplus_0', 'on') %} background: rgba(255,193,7,0.18); {% else %} background: rgba(128,128,128,0.08); {% endif %} } |
:strip_exif()/f/image/ZbXe11FWrFpsi8y0b5Q6PULe.png?f=user_large)
/f/image/0fN4An5YOgc2N0pX0s0UMTCA.png?f=fotoalbum_large)
/f/image/pzEnLT0rhAaQ9ANlMbTI9J37.png?f=fotoalbum_large)
:strip_exif()/f/image/toIwCxJMaDTIP1qQAr1dG8g7.jpg?f=fotoalbum_large)
/f/image/9i4i7e1JBxaxqqKKvu2CPBze.png?f=fotoalbum_large)
:strip_exif()/f/image/ZcM4MQcu55M50zwrP4zsN5aF.jpg?f=fotoalbum_large)
/f/image/zMkNYuMCJETFQ1k7lUMwtUZK.png?f=fotoalbum_large)
/f/image/lchkliIsaRI9ryrMVMy3FgBb.png?f=fotoalbum_large)