{
  "template": "<style>\n.energy-dashboard {\n  --bg: #15191d;\n  --card: #20272d;\n  --card-line: #3c474f;\n  --text: #ffffff;\n  --label: #b4c4d0;\n  --pv: #f5a623;\n  --house: #71cfff;\n  --grid-in: #ff7a6b;\n  --grid-out: #5fd0c5;\n  --batt-charge: #6fd17b;\n  --batt-discharge: #b48ef0;\n  --neutral: #9eb2c1;\n\n  width: 100%;\n  height: 100%;\n  margin: 0;\n  padding: 0;\n  background: var(--bg);\n  color: var(--text);\n  font-family: Arial, Helvetica, sans-serif;\n  overflow: hidden;          /* kein eigener Scrollbereich: das Dashboard scrollt (Kachel hoch genug ziehen) */\n  touch-action: pan-y;       /* senkrechtes Wischen sofort an den Browser geben, ohne Verzögerung */\n  box-sizing: border-box;\n}\n\n/* Optional (Einstellung scrollInside): Widget scrollt in sich selbst */\n.energy-dashboard.inner-scroll { overflow-y: auto; }\n\n.energy-title {\n  text-align: center;\n  font-size: 20px;\n  font-weight: 500;\n  letter-spacing: 0.8px;\n  padding: 4px 0 0 0;\n}\n\n/* Breite bestimmt die Größe: SVG nimmt immer 100 % der Breite */\n.energy-svg {\n  display: block;\n  width: 100%;\n  height: auto;\n}\n\n/* Zwei übereinanderliegende Ebenen (gleiche Größe): hinten Pfeile, vorn Karten/Texte */\n.stage { position: relative; width: 100%; container-type: inline-size; contain: paint; }\n.layer-front { position: relative; will-change: transform; transform: translateZ(0); }\n\n.energy-dashboard text { font-variant-numeric: tabular-nums; text-anchor: middle; }\n.energy-dashboard .end { text-anchor: end; }\n.energy-dashboard .start { text-anchor: start; }\n\n/* Karten (leicht transparent, damit die Flow-Pfeile durchscheinen) */\n.card { fill: var(--card); fill-opacity: 0.42; stroke: var(--card-line); stroke-width: 2; }\n\n/* Texte */\n.title { fill: var(--label); font-size: 16px; font-weight: 600; letter-spacing: 1.2px; }\n.label { fill: var(--label); font-size: 14px; font-weight: 500; letter-spacing: 1px; }\n.unit  { font-size: 0.5em; font-weight: 500; fill: var(--label); }\n\n.big   { font-size: 48px; font-weight: bold; }\n.mid   { font-size: 34px; font-weight: bold; }\n.small { font-size: 24px; font-weight: bold; }\n.yday  { opacity: 0.65; }\n.month-last { font-size: 20px; }\n/* Einheit neben den Monats-/Jahreszahlen (eigener Text, damit die Zahlen exakt rechtsbündig stehen) */\n.unit-col { fill: var(--label); font-size: 12px; font-weight: 500; }\n.unit-col-last { font-size: 10px; }\n\n/* Farben: eine Farbe pro Größe */\n.c-pv     { fill: var(--pv); }\n.c-house  { fill: var(--house); }\n.c-in     { fill: var(--grid-in); }\n.c-out    { fill: var(--grid-out); }\n.c-charge { fill: var(--batt-charge); }\n.c-disch  { fill: var(--batt-discharge); }\n.c-neutral{ fill: var(--neutral); }\n.c-white  { fill: var(--text); }\n.c-red    { fill: #e85b5b; }\n.c-yellow { fill: #f5c542; }\n\n/* Sonne */\n.sun-on  { stroke: var(--pv); fill: var(--pv); }\n.sun-off { stroke: #626c73;   fill: #626c73; }\n\n/* Akku */\n.soc-ring-bg { fill: none; stroke: #354047; stroke-width: 9; }\n.soc-ring { fill: none; stroke-width: 9; stroke-linecap: round;\n            transform: rotate(-90deg); transform-origin: 97px 410px; }\n.soc-min-tick { stroke: #ffffff; stroke-width: 2.5; stroke-linecap: round; opacity: 0.85; }\n.label-val { fill: var(--text); font-weight: bold; letter-spacing: 0; }\n.soc-btn { cursor: pointer; }\n.soc-btn .btn-bg  { fill: #2a343b; stroke: var(--card-line); stroke-width: 1.5; }\n.soc-btn .btn-hit { fill: transparent; }\n.soc-btn .btn-sign { fill: var(--text); font-size: 20px; font-weight: bold; }\n.soc-btn:active .btn-bg { fill: #46535c; }\n.nodata { opacity: 0.45; }\n\n/* Flow-Pfeile: Farbe pro Flussrichtung */\n.f-pv     { stroke: var(--batt-charge); }\n.f-charge { stroke: var(--batt-charge); }\n.f-disch  { stroke: var(--batt-discharge); }\n.f-in     { stroke: var(--grid-in); }\n.f-out    { stroke: var(--grid-out); }\n\n.arrow { fill: none; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }\n\n.divider { stroke: #3a454d; stroke-width: 2; }\n\n/* Füllstand-Hintergrund (wie bei Victron): die Kachel füllt sich von unten nach oben mit Ampel-Verlauf */\n.frame { stroke: none; fill-opacity: 0.32; }\n.frame-pv       { fill: url(#g-good-pv);    clip-path: url(#clip-pv); }\n.frame-akku     { fill: url(#g-good-akku);  clip-path: url(#clip-akku); }\n.frame-netz-in  { fill: url(#g-bad-netz);   clip-path: url(#clip-netz-in); }\n.frame-netz-out { fill: var(--grid-out);    clip-path: url(#clip-netz-out); }\n.bar-bg   { fill: #354047; }\n.bar-fill { fill: var(--batt-charge); }\n\n/* Energie-Symbole: einheitliche Größe, Strichstärke und Ausrichtung */\n.energy-icon {\n  fill: none;\n  stroke-width: 2.5;\n  stroke-linecap: round;\n  stroke-linejoin: round;\n}\n.energy-icon-house { stroke: var(--house); }\n.energy-icon-battery { stroke: var(--batt-charge); }\n.energy-icon-grid { stroke: var(--grid-in); }\n.energy-icon .icon-fill {\n  stroke: none;\n  fill: currentColor;\n}\n\n/* Glow auf Schrift, Sonne und SOC-Ring */\n.big, .mid       { filter: url(#glow-lg); }\n.small           { filter: url(#glow-sm); }\n.sun-on          { filter: url(#glow-lg); }\n.soc-ring        { filter: url(#glow-sm); }\n\n\n/* Flow-Pfeile als HTML-Elemente mit CSS-Animation (laufen unabhängig vom Haupt-Thread).\n   Maße in cqw: 1 SVG-Einheit (viewBox 400 breit) = 0,25 cqw der Breite von .stage */\n.arrows-html { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }\n.arrow-h { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0;\n            animation-timing-function: linear; animation-iteration-count: infinite;\n            will-change: transform, opacity; }\n.arrow-h svg { position: absolute; left: -2cqw; top: -2.25cqw; width: 4cqw; height: 4.5cqw; overflow: visible; }\n.fl-pv { animation-name: fl-pv; }\n.fl-ch { animation-name: fl-ch; }\n.fl-di { animation-name: fl-di; }\n.fl-ex { animation-name: fl-ex; }\n.fl-im { animation-name: fl-im; }\n@keyframes fl-pv {\n  0.00% { transform: translate(50.000cqw, 17.500cqw) rotate(90.0deg); opacity: 0.00; }\n  6.25% { transform: translate(50.000cqw, 20.050cqw) rotate(90.0deg); opacity: 0.42; }\n  12.50% { transform: translate(50.000cqw, 22.706cqw) rotate(90.0deg); opacity: 0.83; }\n  18.75% { transform: translate(50.000cqw, 25.363cqw) rotate(90.0deg); opacity: 1.00; }\n  25.00% { transform: translate(50.000cqw, 28.019cqw) rotate(90.0deg); opacity: 1.00; }\n  31.25% { transform: translate(50.000cqw, 30.675cqw) rotate(90.0deg); opacity: 1.00; }\n  37.50% { transform: translate(50.000cqw, 33.331cqw) rotate(90.0deg); opacity: 1.00; }\n  43.75% { transform: translate(50.000cqw, 35.987cqw) rotate(90.0deg); opacity: 1.00; }\n  50.00% { transform: translate(50.000cqw, 38.644cqw) rotate(90.0deg); opacity: 1.00; }\n  56.25% { transform: translate(50.000cqw, 41.300cqw) rotate(90.0deg); opacity: 1.00; }\n  62.50% { transform: translate(50.000cqw, 43.956cqw) rotate(90.0deg); opacity: 1.00; }\n  68.75% { transform: translate(50.000cqw, 46.612cqw) rotate(90.0deg); opacity: 1.00; }\n  75.00% { transform: translate(50.000cqw, 49.269cqw) rotate(90.0deg); opacity: 1.00; }\n  81.25% { transform: translate(50.000cqw, 51.925cqw) rotate(90.0deg); opacity: 1.00; }\n  87.50% { transform: translate(50.000cqw, 54.581cqw) rotate(90.0deg); opacity: 0.83; }\n  93.75% { transform: translate(50.000cqw, 57.237cqw) rotate(90.0deg); opacity: 0.42; }\n  100.00% { transform: translate(50.000cqw, 59.894cqw) rotate(90.0deg); opacity: 0.00; }\n}\n@keyframes fl-ch {\n  0.00% { transform: translate(50.000cqw, 60.000cqw) rotate(90.6deg); opacity: 0.00; }\n  6.25% { transform: translate(49.775cqw, 63.126cqw) rotate(98.5deg); opacity: 0.42; }\n  12.50% { transform: translate(49.017cqw, 66.291cqw) rotate(108.6deg); opacity: 0.83; }\n  18.75% { transform: translate(47.740cqw, 69.210cqw) rotate(118.6deg); opacity: 1.00; }\n  25.00% { transform: translate(45.904cqw, 72.009cqw) rotate(127.6deg); opacity: 1.00; }\n  31.25% { transform: translate(43.777cqw, 74.449cqw) rotate(134.1deg); opacity: 1.00; }\n  37.50% { transform: translate(41.489cqw, 76.632cqw) rotate(138.2deg); opacity: 1.00; }\n  43.75% { transform: translate(39.050cqw, 78.723cqw) rotate(140.2deg); opacity: 1.00; }\n  50.00% { transform: translate(36.546cqw, 80.792cqw) rotate(140.3deg); opacity: 1.00; }\n  56.25% { transform: translate(34.061cqw, 82.908cqw) rotate(138.5deg); opacity: 1.00; }\n  62.50% { transform: translate(31.681cqw, 85.143cqw) rotate(134.8deg); opacity: 1.00; }\n  68.75% { transform: translate(29.570cqw, 87.468cqw) rotate(129.4deg); opacity: 1.00; }\n  75.00% { transform: translate(27.642cqw, 90.137cqw) rotate(122.0deg); opacity: 1.00; }\n  81.25% { transform: translate(26.122cqw, 93.009cqw) rotate(113.6deg); opacity: 1.00; }\n  87.50% { transform: translate(25.079cqw, 95.971cqw) rotate(105.2deg); opacity: 0.83; }\n  93.75% { transform: translate(24.455cqw, 99.136cqw) rotate(97.2deg); opacity: 0.42; }\n  100.00% { transform: translate(24.250cqw, 102.332cqw) rotate(90.7deg); opacity: 0.00; }\n}\n@keyframes fl-di {\n  0.00% { transform: translate(24.250cqw, 102.500cqw) rotate(-89.5deg); opacity: 0.00; }\n  6.25% { transform: translate(24.437cqw, 99.288cqw) rotate(-83.2deg); opacity: 0.42; }\n  12.50% { transform: translate(25.042cqw, 96.107cqw) rotate(-75.1deg); opacity: 0.83; }\n  18.75% { transform: translate(26.069cqw, 93.131cqw) rotate(-66.7deg); opacity: 1.00; }\n  25.00% { transform: translate(27.574cqw, 90.246cqw) rotate(-58.3deg); opacity: 1.00; }\n  31.25% { transform: translate(29.491cqw, 87.565cqw) rotate(-50.9deg); opacity: 1.00; }\n  37.50% { transform: translate(31.593cqw, 85.232cqw) rotate(-45.4deg); opacity: 1.00; }\n  43.75% { transform: translate(33.967cqw, 82.992cqw) rotate(-41.6deg); opacity: 1.00; }\n  50.00% { transform: translate(36.449cqw, 80.872cqw) rotate(-39.7deg); opacity: 1.00; }\n  56.25% { transform: translate(38.954cqw, 78.802cqw) rotate(-39.7deg); opacity: 1.00; }\n  62.50% { transform: translate(41.397cqw, 76.714cqw) rotate(-41.7deg); opacity: 1.00; }\n  68.75% { transform: translate(43.693cqw, 74.535cqw) rotate(-45.7deg); opacity: 1.00; }\n  75.00% { transform: translate(45.831cqw, 72.103cqw) rotate(-52.1deg); opacity: 1.00; }\n  81.25% { transform: translate(47.682cqw, 69.316cqw) rotate(-61.1deg); opacity: 1.00; }\n  87.50% { transform: translate(48.977cqw, 66.409cqw) rotate(-71.0deg); opacity: 0.83; }\n  93.75% { transform: translate(49.754cqw, 63.260cqw) rotate(-81.1deg); opacity: 0.42; }\n  100.00% { transform: translate(50.000cqw, 60.150cqw) rotate(-89.3deg); opacity: 0.00; }\n}\n@keyframes fl-ex {\n  0.00% { transform: translate(50.000cqw, 60.000cqw) rotate(89.4deg); opacity: 0.00; }\n  6.25% { transform: translate(50.205cqw, 62.990cqw) rotate(81.9deg); opacity: 0.42; }\n  12.50% { transform: translate(50.904cqw, 66.048cqw) rotate(72.2deg); opacity: 0.83; }\n  18.75% { transform: translate(52.090cqw, 68.877cqw) rotate(62.4deg); opacity: 1.00; }\n  25.00% { transform: translate(53.738cqw, 71.497cqw) rotate(53.5deg); opacity: 1.00; }\n  31.25% { transform: translate(55.807cqw, 73.940cqw) rotate(46.3deg); opacity: 1.00; }\n  37.50% { transform: translate(57.967cqw, 76.012cqw) rotate(41.7deg); opacity: 1.00; }\n  43.75% { transform: translate(60.379cqw, 78.039cqw) rotate(38.8deg); opacity: 1.00; }\n  50.00% { transform: translate(62.778cqw, 79.925cqw) rotate(37.8deg); opacity: 1.00; }\n  56.25% { transform: translate(65.276cqw, 81.885cqw) rotate(38.7deg); opacity: 1.00; }\n  62.50% { transform: translate(67.693cqw, 83.908cqw) rotate(41.5deg); opacity: 1.00; }\n  68.75% { transform: translate(69.861cqw, 85.974cqw) rotate(46.1deg); opacity: 1.00; }\n  75.00% { transform: translate(71.942cqw, 88.408cqw) rotate(53.2deg); opacity: 1.00; }\n  81.25% { transform: translate(73.604cqw, 91.017cqw) rotate(62.0deg); opacity: 1.00; }\n  87.50% { transform: translate(74.807cqw, 93.833cqw) rotate(71.8deg); opacity: 0.83; }\n  93.75% { transform: translate(75.525cqw, 96.875cqw) rotate(81.5deg); opacity: 0.42; }\n  100.00% { transform: translate(75.750cqw, 99.850cqw) rotate(89.3deg); opacity: 0.00; }\n}\n@keyframes fl-im {\n  0.00% { transform: translate(75.750cqw, 100.000cqw) rotate(-90.6deg); opacity: 0.00; }\n  6.25% { transform: translate(75.545cqw, 97.010cqw) rotate(-98.1deg); opacity: 0.42; }\n  12.50% { transform: translate(74.846cqw, 93.952cqw) rotate(-107.8deg); opacity: 0.83; }\n  18.75% { transform: translate(73.660cqw, 91.123cqw) rotate(-117.6deg); opacity: 1.00; }\n  25.00% { transform: translate(72.012cqw, 88.503cqw) rotate(-126.5deg); opacity: 1.00; }\n  31.25% { transform: translate(69.943cqw, 86.060cqw) rotate(-133.7deg); opacity: 1.00; }\n  37.50% { transform: translate(67.783cqw, 83.988cqw) rotate(-138.3deg); opacity: 1.00; }\n  43.75% { transform: translate(65.371cqw, 81.961cqw) rotate(-141.2deg); opacity: 1.00; }\n  50.00% { transform: translate(62.875cqw, 80.000cqw) rotate(-142.2deg); opacity: 1.00; }\n  56.25% { transform: translate(60.474cqw, 78.115cqw) rotate(-141.3deg); opacity: 1.00; }\n  62.50% { transform: translate(58.057cqw, 76.092cqw) rotate(-138.5deg); opacity: 1.00; }\n  68.75% { transform: translate(55.889cqw, 74.026cqw) rotate(-133.9deg); opacity: 1.00; }\n  75.00% { transform: translate(53.808cqw, 71.592cqw) rotate(-126.8deg); opacity: 1.00; }\n  81.25% { transform: translate(52.146cqw, 68.983cqw) rotate(-118.0deg); opacity: 1.00; }\n  87.50% { transform: translate(50.943cqw, 66.167cqw) rotate(-108.2deg); opacity: 0.83; }\n  93.75% { transform: translate(50.225cqw, 63.125cqw) rotate(-98.5deg); opacity: 0.42; }\n  100.00% { transform: translate(50.000cqw, 60.150cqw) rotate(-90.7deg); opacity: 0.00; }\n}\n\n\n/* PV-Verlauf (openHAB-Chart-Bild) im Hintergrund der PV-Kachel, Darstellung wie bei Victron:\n   Filter #pv-area holt nur die rote Kurve aus dem Bild, füllt die Fläche darunter und färbt beides neu.\n   Farben hier anpassen: */\n.pv-chart      { filter: url(#pv-area); }\n.pv-area-fill  { flood-color: #7f93a3; flood-opacity: 0.20; }   /* neutrales Blaugrau, stört die farbigen Zahlen nicht */\n.pv-area-line  { flood-color: #a9bccb; flood-opacity: 0.60; }\n/* Netz-Verlauf (gleiches Prinzip wie PV) */\n.grid-chart      { filter: url(#grid-area); }\n.grid-area-fill  { flood-color: #7f93a3; flood-opacity: 0.20; }\n.grid-area-line  { flood-color: #a9bccb; flood-opacity: 0.60; }\n.grid-chart-clip-card { clip-path: url(#clip-gridchart-card); }\n/* Alternative Victron-Beige: Fläche #d8bd8a / 0.25, Linie #efd9ad / 0.60 */\n.pv-chart-clip-card { clip-path: url(#clip-pvchart-card); }\n.pv-chart-clip-area { clip-path: url(#clip-pvchart-area); }\n</style>\n\n\n<!-- Energy flow widget for HABPanel. All items come from the widget settings (config.<ID>), see the settings table.\n     Items with units are supported if the setting parseUnits is on: the unit is split off, W/kW, Wh/kWh/MWh are converted.\n     With parseUnits off, only plain numbers are read (faster). -->\n<div class=\"energy-dashboard\"\n     ng-class=\"{'inner-scroll': config.scrollInside === true || config.scrollInside == 'true'}\"\n     ng-init=\"spdSlow=6; spdMid=4; spdFast=2.5; spdLo=300; spdHi=1000; spdHy=75; arrowN=4; arrowIdx=[0,1,2,3]; socStep=(+config.socStep || 5); socMinAllowed=(+config.socMinAllowed || 5); socMaxAllowed=(+config.socMaxAllowed || 95); pvMaxW=(+config.pvMaxW || 1500); gridMaxW=(+config.gridMaxW || 3000); battCap=(+config.battCapacity || 7.5); hideM=(config.hideMonth === true || config.hideMonth == 'true'); hideY=(config.hideYear === true || config.hideYear == 'true'); hideC=(config.hideChart === true || config.hideChart == 'true'); hideGC=(config.hideGridChart === true || config.hideGridChart == 'true'); en=(config.language == 'en'); parseU=(config.parseUnits === true || config.parseUnits == 'true')\">\n\n  <div class=\"energy-title\">{{en ? 'Energy flows' : 'Aktuelle Energieflüsse'}}</div>\n\n  <div class=\"stage\">\n\n    <!-- Hintere Ebene: nur die Flow-Pfeile. Eigene Ebene, damit die Animation nicht\n         die Karten und Texte (Glow-Filter) bei jedem Bild neu zeichnen muss. -->\n    <div class=\"arrows-html\" aria-hidden=\"true\">\n    <!-- ===================== FLOW-PFEILE (hinter den Karten) =====================\n         Tempo nach Leistung: unter spdLo = langsam, bis spdHi = mittel, darüber = schnell\n         (Sekunden pro Durchlauf bzw. Watt; spdHy = Hysterese in W; Anzahl Pfeile: arrowN/arrowIdx; siehe ng-init am Widget-Anfang) -->\n\n    <!-- PV -> Haus -->\n    <div ng-if=\"(parseU ? ((+(itemValue(config.pvPower) + '').split(' ')[0] || 0) * ((itemValue(config.pvPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.pvPower) || 0)) > 0\">\n      <div ng-repeat=\"d in [lvlPv = ((parseU ? ((+(itemValue(config.pvPower) + '').split(' ')[0] || 0) * ((itemValue(config.pvPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.pvPower) || 0)) < spdLo - spdHy ? spdSlow : ((parseU ? ((+(itemValue(config.pvPower) + '').split(' ')[0] || 0) * ((itemValue(config.pvPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.pvPower) || 0)) < spdLo + spdHy ? ((lvlPv == spdSlow || lvlPv == spdMid) ? lvlPv : ((parseU ? ((+(itemValue(config.pvPower) + '').split(' ')[0] || 0) * ((itemValue(config.pvPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.pvPower) || 0)) < spdLo ? spdSlow : spdMid)) : ((parseU ? ((+(itemValue(config.pvPower) + '').split(' ')[0] || 0) * ((itemValue(config.pvPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.pvPower) || 0)) < spdHi - spdHy ? spdMid : ((parseU ? ((+(itemValue(config.pvPower) + '').split(' ')[0] || 0) * ((itemValue(config.pvPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.pvPower) || 0)) < spdHi + spdHy ? ((lvlPv == spdMid || lvlPv == spdFast) ? lvlPv : ((parseU ? ((+(itemValue(config.pvPower) + '').split(' ')[0] || 0) * ((itemValue(config.pvPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.pvPower) || 0)) < spdHi ? spdMid : spdFast)) : spdFast))))] track by $index\">\n        <div ng-repeat=\"k in arrowIdx\" class=\"arrow-h fl-pv\"\n             ng-style=\"{'animation-duration': d + 's', 'animation-delay': (-d * k / arrowN) + 's'}\">\n          <svg viewBox=\"-8 -9 16 18\"><path d=\"M-7 -8 L3 0 L-7 8\" class=\"arrow f-pv\"/></svg>\n        </div>\n      </div>\n    </div>\n\n    <!-- Haus -> Akku (laden) -->\n    <div ng-if=\"(parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0)) > 0\">\n      <div ng-repeat=\"d in [lvlCh = ((parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0)) < spdLo - spdHy ? spdSlow : ((parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0)) < spdLo + spdHy ? ((lvlCh == spdSlow || lvlCh == spdMid) ? lvlCh : ((parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0)) < spdLo ? spdSlow : spdMid)) : ((parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0)) < spdHi - spdHy ? spdMid : ((parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0)) < spdHi + spdHy ? ((lvlCh == spdMid || lvlCh == spdFast) ? lvlCh : ((parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0)) < spdHi ? spdMid : spdFast)) : spdFast))))] track by $index\">\n        <div ng-repeat=\"k in arrowIdx\" class=\"arrow-h fl-ch\"\n             ng-style=\"{'animation-duration': d + 's', 'animation-delay': (-d * k / arrowN) + 's'}\">\n          <svg viewBox=\"-8 -9 16 18\"><path d=\"M-7 -8 L3 0 L-7 8\" class=\"arrow f-charge\"/></svg>\n        </div>\n      </div>\n    </div>\n\n    <!-- Akku -> Haus (entladen) -->\n    <div ng-if=\"(parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0)) < 0\">\n      <div ng-repeat=\"d in [lvlDi = ((-(parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0))) < spdLo - spdHy ? spdSlow : ((-(parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0))) < spdLo + spdHy ? ((lvlDi == spdSlow || lvlDi == spdMid) ? lvlDi : ((-(parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0))) < spdLo ? spdSlow : spdMid)) : ((-(parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0))) < spdHi - spdHy ? spdMid : ((-(parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0))) < spdHi + spdHy ? ((lvlDi == spdMid || lvlDi == spdFast) ? lvlDi : ((-(parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0))) < spdHi ? spdMid : spdFast)) : spdFast))))] track by $index\">\n        <div ng-repeat=\"k in arrowIdx\" class=\"arrow-h fl-di\"\n             ng-style=\"{'animation-duration': d + 's', 'animation-delay': (-d * k / arrowN) + 's'}\">\n          <svg viewBox=\"-8 -9 16 18\"><path d=\"M-7 -8 L3 0 L-7 8\" class=\"arrow f-disch\"/></svg>\n        </div>\n      </div>\n    </div>\n\n    <!-- Haus -> Netz (Einspeisung) -->\n    <div ng-if=\"(parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) < 0\">\n      <div ng-repeat=\"d in [lvlEx = ((-(parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0))) < spdLo - spdHy ? spdSlow : ((-(parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0))) < spdLo + spdHy ? ((lvlEx == spdSlow || lvlEx == spdMid) ? lvlEx : ((-(parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0))) < spdLo ? spdSlow : spdMid)) : ((-(parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0))) < spdHi - spdHy ? spdMid : ((-(parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0))) < spdHi + spdHy ? ((lvlEx == spdMid || lvlEx == spdFast) ? lvlEx : ((-(parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0))) < spdHi ? spdMid : spdFast)) : spdFast))))] track by $index\">\n        <div ng-repeat=\"k in arrowIdx\" class=\"arrow-h fl-ex\"\n             ng-style=\"{'animation-duration': d + 's', 'animation-delay': (-d * k / arrowN) + 's'}\">\n          <svg viewBox=\"-8 -9 16 18\"><path d=\"M-7 -8 L3 0 L-7 8\" class=\"arrow f-out\"/></svg>\n        </div>\n      </div>\n    </div>\n\n    <!-- Netz -> Haus (Bezug) -->\n    <div ng-if=\"(parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) > 0\">\n      <div ng-repeat=\"d in [lvlIm = ((parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) < spdLo - spdHy ? spdSlow : ((parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) < spdLo + spdHy ? ((lvlIm == spdSlow || lvlIm == spdMid) ? lvlIm : ((parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) < spdLo ? spdSlow : spdMid)) : ((parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) < spdHi - spdHy ? spdMid : ((parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) < spdHi + spdHy ? ((lvlIm == spdMid || lvlIm == spdFast) ? lvlIm : ((parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) < spdHi ? spdMid : spdFast)) : spdFast))))] track by $index\">\n        <div ng-repeat=\"k in arrowIdx\" class=\"arrow-h fl-im\"\n             ng-style=\"{'animation-duration': d + 's', 'animation-delay': (-d * k / arrowN) + 's'}\">\n          <svg viewBox=\"-8 -9 16 18\"><path d=\"M-7 -8 L3 0 L-7 8\" class=\"arrow f-in\"/></svg>\n        </div>\n      </div>\n    </div>\n\n  </div>\n\n    <!-- Vordere Ebene: Karten, Rahmen, Texte -->\n    <svg class=\"energy-svg layer-front\" viewBox=\"0 0 400 1130\"\n         ng-attr-view_box=\"0 0 400 {{588 + (hideM ? 0 : 256) + (hideY ? 0 : 286)}}\" preserveAspectRatio=\"xMidYMin meet\">\n\n    <defs>\n      <!-- Glow: unscharfe Kopie der Schrift (gleiche Farbe) hinter der scharfen Schrift -->\n      <filter id=\"glow-lg\" x=\"-25%\" y=\"-60%\" width=\"150%\" height=\"220%\">\n        <feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"1.6\" result=\"g\"/>\n        <feComponentTransfer in=\"g\" result=\"b\"><feFuncA type=\"linear\" slope=\"0.55\"/></feComponentTransfer>\n        <feMerge><feMergeNode in=\"b\"/><feMergeNode in=\"SourceGraphic\"/></feMerge>\n      </filter>\n      <filter id=\"glow-sm\" x=\"-25%\" y=\"-60%\" width=\"150%\" height=\"220%\">\n        <feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"1.1\" result=\"g\"/>\n        <feComponentTransfer in=\"g\" result=\"b\"><feFuncA type=\"linear\" slope=\"0.55\"/></feComponentTransfer>\n        <feMerge><feMergeNode in=\"b\"/><feMergeNode in=\"SourceGraphic\"/></feMerge>\n      </filter>\n\n      <!-- Ampel-Verläufe für die Füllung (unten -> oben) -->\n      <!-- PV und Akku: viel = gut (rot -> gelb -> grün) -->\n      <linearGradient id=\"g-good-pv\" gradientUnits=\"userSpaceOnUse\" x1=\"0\" y1=\"144\" x2=\"0\" y2=\"6\">\n        <stop offset=\"0\" stop-color=\"#e85b5b\"/><stop offset=\"0.5\" stop-color=\"#f5c542\"/><stop offset=\"1\" stop-color=\"#6fd17b\"/>\n      </linearGradient>\n      <linearGradient id=\"g-good-akku\" gradientUnits=\"userSpaceOnUse\" x1=\"0\" y1=\"578\" x2=\"0\" y2=\"326\">\n        <stop offset=\"0\" stop-color=\"#e85b5b\"/><stop offset=\"0.5\" stop-color=\"#f5c542\"/><stop offset=\"1\" stop-color=\"#6fd17b\"/>\n      </linearGradient>\n      <!-- Netzbezug: viel = schlecht (grün -> gelb -> rot) -->\n      <linearGradient id=\"g-bad-netz\" gradientUnits=\"userSpaceOnUse\" x1=\"0\" y1=\"578\" x2=\"0\" y2=\"326\">\n        <stop offset=\"0\" stop-color=\"#6fd17b\"/><stop offset=\"0.5\" stop-color=\"#f5c542\"/><stop offset=\"1\" stop-color=\"#e85b5b\"/>\n      </linearGradient>\n\n      <!-- PV-Verlauf: rote Kurve aus dem Chart-Bild herauslösen (Alpha = Rotanteil), Fläche nach unten auffüllen, neu einfärben -->\n      <filter id=\"pv-area\" filterUnits=\"userSpaceOnUse\" x=\"0\" y=\"46\" width=\"400\" height=\"100\" color-interpolation-filters=\"sRGB\">\n        <feColorMatrix in=\"SourceGraphic\" type=\"matrix\"\n                       values=\"0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  1 -1 0 0 0\" result=\"line\"/>\n        <!-- Linie verdünnen (nur die Linie, nicht die Fläche): radius 0.3 bis 0.6, größer = dünner -->\n        <feMorphology in=\"line\" operator=\"erode\" radius=\"0.2\" result=\"thin\"/>\n        <!-- Fläche: Kurve schrittweise nach unten verdoppeln (1+2+4+...+64 = 127 Einheiten) -->\n        <feComponentTransfer in=\"line\" result=\"lineA\"><feFuncA type=\"linear\" slope=\"4\"/></feComponentTransfer>\n        <feOffset in=\"lineA\" dy=\"1\" result=\"o1\"/> <feMerge result=\"e1\"><feMergeNode in=\"lineA\"/><feMergeNode in=\"o1\"/></feMerge>\n        <feOffset in=\"e1\" dy=\"2\" result=\"o2\"/>   <feMerge result=\"e2\"><feMergeNode in=\"e1\"/><feMergeNode in=\"o2\"/></feMerge>\n        <feOffset in=\"e2\" dy=\"4\" result=\"o3\"/>   <feMerge result=\"e3\"><feMergeNode in=\"e2\"/><feMergeNode in=\"o3\"/></feMerge>\n        <feOffset in=\"e3\" dy=\"8\" result=\"o4\"/>   <feMerge result=\"e4\"><feMergeNode in=\"e3\"/><feMergeNode in=\"o4\"/></feMerge>\n        <feOffset in=\"e4\" dy=\"16\" result=\"o5\"/>  <feMerge result=\"e5\"><feMergeNode in=\"e4\"/><feMergeNode in=\"o5\"/></feMerge>\n        <feOffset in=\"e5\" dy=\"32\" result=\"o6\"/>  <feMerge result=\"e6\"><feMergeNode in=\"e5\"/><feMergeNode in=\"o6\"/></feMerge>\n        <feOffset in=\"e6\" dy=\"64\" result=\"o7\"/>  <feMerge result=\"area\"><feMergeNode in=\"e6\"/><feMergeNode in=\"o7\"/></feMerge>\n        <feFlood class=\"pv-area-fill\" result=\"cf\"/>\n        <feComposite in=\"cf\" in2=\"area\" operator=\"in\" result=\"fill\"/>\n        <feFlood class=\"pv-area-line\" result=\"cl\"/>\n        <feComposite in=\"cl\" in2=\"thin\" operator=\"in\" result=\"stroke\"/>\n        <feMerge><feMergeNode in=\"fill\"/><feMergeNode in=\"stroke\"/></feMerge>\n      </filter>\n      <!-- Netz-Verlauf: gleicher Filter, eigener Bereich und eigene Farben -->\n      <filter id=\"grid-area\" filterUnits=\"userSpaceOnUse\" x=\"206\" y=\"462\" width=\"194\" height=\"118\" color-interpolation-filters=\"sRGB\">\n        <feColorMatrix in=\"SourceGraphic\" type=\"matrix\"\n                       values=\"0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  1 -1 0 0 0\" result=\"line\"/>\n        <!-- Linie verdünnen (nur die Linie, nicht die Fläche): radius 0.3 bis 0.6, größer = dünner -->\n        <feMorphology in=\"line\" operator=\"erode\" radius=\"0.2\" result=\"thin\"/>\n        <!-- Fläche: Kurve schrittweise nach unten verdoppeln (1+2+4+...+64 = 127 Einheiten) -->\n        <feComponentTransfer in=\"line\" result=\"lineA\"><feFuncA type=\"linear\" slope=\"4\"/></feComponentTransfer>\n        <feOffset in=\"lineA\" dy=\"1\" result=\"o1\"/> <feMerge result=\"e1\"><feMergeNode in=\"lineA\"/><feMergeNode in=\"o1\"/></feMerge>\n        <feOffset in=\"e1\" dy=\"2\" result=\"o2\"/>   <feMerge result=\"e2\"><feMergeNode in=\"e1\"/><feMergeNode in=\"o2\"/></feMerge>\n        <feOffset in=\"e2\" dy=\"4\" result=\"o3\"/>   <feMerge result=\"e3\"><feMergeNode in=\"e2\"/><feMergeNode in=\"o3\"/></feMerge>\n        <feOffset in=\"e3\" dy=\"8\" result=\"o4\"/>   <feMerge result=\"e4\"><feMergeNode in=\"e3\"/><feMergeNode in=\"o4\"/></feMerge>\n        <feOffset in=\"e4\" dy=\"16\" result=\"o5\"/>  <feMerge result=\"e5\"><feMergeNode in=\"e4\"/><feMergeNode in=\"o5\"/></feMerge>\n        <feOffset in=\"e5\" dy=\"32\" result=\"o6\"/>  <feMerge result=\"e6\"><feMergeNode in=\"e5\"/><feMergeNode in=\"o6\"/></feMerge>\n        <feOffset in=\"e6\" dy=\"64\" result=\"o7\"/>  <feMerge result=\"area\"><feMergeNode in=\"e6\"/><feMergeNode in=\"o7\"/></feMerge>\n        <feFlood class=\"grid-area-fill\" result=\"cf\"/>\n        <feComposite in=\"cf\" in2=\"area\" operator=\"in\" result=\"fill\"/>\n        <feFlood class=\"grid-area-line\" result=\"cl\"/>\n        <feComposite in=\"cl\" in2=\"thin\" operator=\"in\" result=\"stroke\"/>\n        <feMerge><feMergeNode in=\"fill\"/><feMergeNode in=\"stroke\"/></feMerge>\n      </filter>\n    </defs>\n\n    <!-- ===================== PV ===================== -->\n    <rect x=\"4\" y=\"6\" width=\"392\" height=\"138\" rx=\"16\" class=\"card\"/>\n    <!-- Füllstand-Hintergrund (clip-pv) -->\n    <g ng-repeat=\"L in [(parseU ? ((+(itemValue(config.pvPower) + '').split(' ')[0] || 0) * ((itemValue(config.pvPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.pvPower) || 0)) > pvMaxW ? 1 : ((parseU ? ((+(itemValue(config.pvPower) + '').split(' ')[0] || 0) * ((itemValue(config.pvPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.pvPower) || 0)) > 0 ? (parseU ? ((+(itemValue(config.pvPower) + '').split(' ')[0] || 0) * ((itemValue(config.pvPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.pvPower) || 0)) / pvMaxW : 0)] track by $index\">\n      <clipPath id=\"clip-pv\"><rect x=\"0\" width=\"400\" ng-attr-y=\"{{144 - 138 * L}}\" ng-attr-height=\"{{138 * L + 3}}\"/></clipPath>\n      <rect x=\"4\" y=\"6\" width=\"392\" height=\"138\" rx=\"16\" class=\"frame frame-pv\" ng-if=\"L > 0\"/>\n    </g>\n\n\n    <!-- PV-Verlauf der letzten 24 h als Bild vom openHAB-Chart-Dienst (rrd4j).\n         Das Bild ist größer als die Kachel und verschoben, damit Achsen und Beschriftung abgeschnitten sind.\n         t=... lädt das Bild neu, sobald sich der Tagesertrag ändert. -->\n    <clipPath id=\"clip-pvchart-card\"><rect x=\"4\" y=\"6\" width=\"392\" height=\"138\" rx=\"16\"/></clipPath>\n    <clipPath id=\"clip-pvchart-area\"><rect x=\"0\" y=\"52\" width=\"400\" height=\"100\"/></clipPath>\n    <g class=\"pv-chart-clip-card\" ng-if=\"!hideC\">\n      <g class=\"pv-chart-clip-area\">\n        <image class=\"pv-chart\" x=\"-28.0\" y=\"47.8\" width=\"439.4\" height=\"106.9\" preserveAspectRatio=\"none\"\n               ng-attr-href=\"/chart?items={{config.pvPower}}&period={{config.chartPeriod}}&service=rrd4j&w=800&h=240&legend=false&t={{itemValue(config.pvYieldToday)}}\"/>\n      </g>\n    </g>\n\n    <g stroke-width=\"3\" stroke-linecap=\"round\"\n       ng-class=\"{'sun-on': (parseU ? ((+(itemValue(config.pvPower) + '').split(' ')[0] || 0) * ((itemValue(config.pvPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.pvPower) || 0)) > 0,\n                  'sun-off': (parseU ? ((+(itemValue(config.pvPower) + '').split(' ')[0] || 0) * ((itemValue(config.pvPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.pvPower) || 0)) <= 0}\">\n      <circle cx=\"39\" cy=\"56\" r=\"13\"/>\n      <line x1=\"39\" y1=\"34\" x2=\"39\" y2=\"40\"/>\n      <line x1=\"39\" y1=\"72\" x2=\"39\" y2=\"78\"/>\n      <line x1=\"17\" y1=\"56\" x2=\"23\" y2=\"56\"/>\n      <line x1=\"55\" y1=\"56\" x2=\"61\" y2=\"56\"/>\n      <line x1=\"24\" y1=\"41\" x2=\"28\" y2=\"45\"/>\n      <line x1=\"50\" y1=\"67\" x2=\"54\" y2=\"71\"/>\n      <line x1=\"54\" y1=\"41\" x2=\"50\" y2=\"45\"/>\n      <line x1=\"28\" y1=\"67\" x2=\"24\" y2=\"71\"/>\n    </g>\n\n    <text x=\"200\" y=\"32\" class=\"title\">{{en ? 'Photovoltaics' : 'Photovoltaik'}}</text>\n\n    <text x=\"200\" y=\"80\" class=\"big\"\n          ng-class=\"(parseU ? ((+(itemValue(config.pvPower) + '').split(' ')[0] || 0) * ((itemValue(config.pvPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.pvPower) || 0)) > 0 ? 'c-charge' : 'c-neutral'\">\n      {{(parseU ? ((+(itemValue(config.pvPower) + '').split(' ')[0] || 0) * ((itemValue(config.pvPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.pvPower) || 0)) | number:0}}<tspan class=\"unit\" dx=\"6\">W</tspan>\n    </text>\n\n    <text x=\"105\" y=\"106\" class=\"label\">{{en ? 'Today' : 'Heute'}}</text>\n    <!-- pvYieldToday kommt in Wh: unter 1000 Wh als Wh, ab 1000 Wh als kWh -->\n    <text x=\"105\" y=\"132\" class=\"small c-charge\"\n          ng-if=\"(parseU ? ((+(itemValue(config.pvYieldToday) + '').split(' ')[0] || 0) * ((itemValue(config.pvYieldToday) + '').split(' ')[1] == 'kWh' ? 1000 : 1)) : (+itemValue(config.pvYieldToday) || 0)) < 1000\">\n      {{(parseU ? ((+(itemValue(config.pvYieldToday) + '').split(' ')[0] || 0) * ((itemValue(config.pvYieldToday) + '').split(' ')[1] == 'kWh' ? 1000 : 1)) : (+itemValue(config.pvYieldToday) || 0)) | number:0}}<tspan class=\"unit\" dx=\"4\">Wh</tspan>\n    </text>\n    <text x=\"105\" y=\"132\" class=\"small c-charge\"\n          ng-if=\"(parseU ? ((+(itemValue(config.pvYieldToday) + '').split(' ')[0] || 0) * ((itemValue(config.pvYieldToday) + '').split(' ')[1] == 'kWh' ? 1000 : 1)) : (+itemValue(config.pvYieldToday) || 0)) >= 1000\">\n      {{((parseU ? ((+(itemValue(config.pvYieldToday) + '').split(' ')[0] || 0) * ((itemValue(config.pvYieldToday) + '').split(' ')[1] == 'kWh' ? 1000 : 1)) : (+itemValue(config.pvYieldToday) || 0)) / 1000) | number:2}}<tspan class=\"unit\" dx=\"4\">kWh</tspan>\n    </text>\n\n    <text x=\"295\" y=\"106\" class=\"label\">{{en ? 'Yesterday' : 'Gestern'}}</text>\n    <!-- pvYieldYesterday kommt in kWh: unter 1 kWh als Wh, sonst kWh -->\n    <text x=\"295\" y=\"132\" class=\"small c-pv\"\n          ng-if=\"(parseU ? ((+(itemValue(config.pvYieldYesterday) + '').split(' ')[0] || 0) * ((itemValue(config.pvYieldYesterday) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.pvYieldYesterday) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.pvYieldYesterday) || 0)) < 1\">\n      {{((parseU ? ((+(itemValue(config.pvYieldYesterday) + '').split(' ')[0] || 0) * ((itemValue(config.pvYieldYesterday) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.pvYieldYesterday) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.pvYieldYesterday) || 0)) * 1000) | number:0}}<tspan class=\"unit\" dx=\"4\">Wh</tspan>\n    </text>\n    <text x=\"295\" y=\"132\" class=\"small c-pv\"\n          ng-if=\"(parseU ? ((+(itemValue(config.pvYieldYesterday) + '').split(' ')[0] || 0) * ((itemValue(config.pvYieldYesterday) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.pvYieldYesterday) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.pvYieldYesterday) || 0)) >= 1\">\n      {{(parseU ? ((+(itemValue(config.pvYieldYesterday) + '').split(' ')[0] || 0) * ((itemValue(config.pvYieldYesterday) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.pvYieldYesterday) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.pvYieldYesterday) || 0)) | number:2}}<tspan class=\"unit\" dx=\"4\">kWh</tspan>\n    </text>\n\n\n    <!-- ===================== HAUS (Hub) ===================== -->\n    <rect x=\"4\" y=\"164\" width=\"392\" height=\"142\" rx=\"16\" class=\"card\"/>\n\n    <!-- Haus-Symbol: kompakt und auf die Symbolgröße von Akku/Netz abgestimmt -->\n    <g class=\"energy-icon energy-icon-house\" aria-hidden=\"true\">\n      <path d=\"M20 193 L35 180 L50 193 V208 H20 Z\"/>\n      <path d=\"M17 193 L35 177 L53 193\"/>\n      <path d=\"M30 208 V198 H40 V208\"/>\n    </g>\n\n    <text x=\"200\" y=\"190\" class=\"title\">{{en ? 'Consumption' : 'Gesamtverbrauch'}}</text>\n\n    <text x=\"200\" y=\"242\" class=\"big c-house\">\n      {{((parseU ? ((+(itemValue(config.pvPower) + '').split(' ')[0] || 0) * ((itemValue(config.pvPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.pvPower) || 0)) +\n         (parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) -\n         (parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0))) | number:0}}<tspan class=\"unit\" dx=\"6\">W</tspan>\n    </text>\n\n    <text x=\"105\" y=\"268\" class=\"label\">{{en ? 'Today' : 'Heute'}}</text>\n    <text x=\"105\" y=\"294\" class=\"small c-house\">\n      {{(parseU ? ((+(itemValue(config.loadToday) + '').split(' ')[0] || 0) * ((itemValue(config.loadToday) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.loadToday) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.loadToday) || 0)) | number:2}}<tspan class=\"unit\" dx=\"4\">kWh</tspan>\n    </text>\n\n    <text x=\"295\" y=\"268\" class=\"label\">{{en ? 'Yesterday' : 'Gestern'}}</text>\n    <text x=\"295\" y=\"294\" class=\"small c-house yday\">\n      {{(parseU ? ((+(itemValue(config.loadYesterday) + '').split(' ')[0] || 0) * ((itemValue(config.loadYesterday) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.loadYesterday) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.loadYesterday) || 0)) | number:2}}<tspan class=\"unit\" dx=\"4\">kWh</tspan>\n    </text>\n\n\n    <!-- ===================== AKKU ===================== -->\n    <rect x=\"4\" y=\"326\" width=\"186\" height=\"252\" rx=\"16\" class=\"card\"/>\n    <!-- Füllstand-Hintergrund (clip-akku) -->\n    <g ng-repeat=\"L in [(parseU ? (+(itemValue(config.battSoc) + '').split(' ')[0] || 0) : (+itemValue(config.battSoc) || 0)) > 100 ? 1 : ((parseU ? (+(itemValue(config.battSoc) + '').split(' ')[0] || 0) : (+itemValue(config.battSoc) || 0)) > 0 ? (parseU ? (+(itemValue(config.battSoc) + '').split(' ')[0] || 0) : (+itemValue(config.battSoc) || 0)) / 100 : 0)] track by $index\">\n      <clipPath id=\"clip-akku\"><rect x=\"0\" width=\"400\" ng-attr-y=\"{{578 - 252 * L}}\" ng-attr-height=\"{{252 * L + 3}}\"/></clipPath>\n      <rect x=\"4\" y=\"326\" width=\"186\" height=\"252\" rx=\"16\" class=\"frame frame-akku\" ng-if=\"L > 0\"/>\n    </g>\n\n\n    <g ng-class=\"{'nodata': itemValue(config.battSoc) == 'NULL' || itemValue(config.battSoc) == 'UNDEF'}\">\n\n      <!-- Akku-Symbol: gleiche optische Größe wie Haus und Netz -->\n      <g class=\"energy-icon energy-icon-battery\" aria-hidden=\"true\">\n        <rect x=\"25\" y=\"339\" width=\"20\" height=\"29\" rx=\"3\"/>\n        <rect x=\"31\" y=\"335\" width=\"8\" height=\"5\" rx=\"1.5\"/>\n        <rect x=\"29\" y=\"354\" width=\"12\" height=\"10\" rx=\"1\" fill=\"var(--batt-charge)\" stroke=\"none\"/>\n      </g>\n\n      <text x=\"97\" y=\"352\" class=\"title\">{{en ? 'BATTERY' : 'AKKU'}}</text>\n\n      <circle cx=\"97\" cy=\"410\" r=\"45\" class=\"soc-ring-bg\"/>\n      <circle cx=\"97\" cy=\"410\" r=\"45\" class=\"soc-ring\"\n              ng-attr-stroke=\"{{(parseU ? (+(itemValue(config.battSoc) + '').split(' ')[0] || 0) : (+itemValue(config.battSoc) || 0)) < ((parseU ? (+(itemValue(config.minSocLimit) + '').split(' ')[0] || 0) : (+itemValue(config.minSocLimit) || 0)) > 0 ? (parseU ? (+(itemValue(config.minSocLimit) + '').split(' ')[0] || 0) : (+itemValue(config.minSocLimit) || 0)) + 5 : 20) ? '#e85b5b' :\n                               ((parseU ? (+(itemValue(config.battSoc) + '').split(' ')[0] || 0) : (+itemValue(config.battSoc) || 0)) < 50 ? '#f5c542' : '#6fd17b')}}\"\n              ng-attr-stroke-dasharray=\"{{282.74 * ((parseU ? (+(itemValue(config.battSoc) + '').split(' ')[0] || 0) : (+itemValue(config.battSoc) || 0)) / 100)}} 282.74\"/>\n\n      <!-- Min-SoC: Strich am Ring (Winkel = Prozent × 3,6° ab 12 Uhr, im Uhrzeigersinn) -->\n      <line x1=\"97\" y1=\"358\" x2=\"97\" y2=\"371\" class=\"soc-min-tick\"\n            ng-if=\"(parseU ? (+(itemValue(config.minSocLimit) + '').split(' ')[0] || 0) : (+itemValue(config.minSocLimit) || 0)) > 0\"\n            ng-attr-transform=\"rotate({{(parseU ? (+(itemValue(config.minSocLimit) + '').split(' ')[0] || 0) : (+itemValue(config.minSocLimit) || 0)) * 3.6}} 97 410)\"/>\n\n      <text x=\"97\" y=\"420\" class=\"small c-white\">{{(parseU ? (+(itemValue(config.battSoc) + '').split(' ')[0] || 0) : (+itemValue(config.battSoc) || 0)) | number:0}}%</text>\n\n      <!-- Min-SoC anzeigen und per +/- ändern (Schritt/Grenzen: socStep, socMinAllowed, socMaxAllowed am Widget-Anfang) -->\n      <text x=\"97\" y=\"476\" class=\"label\"\n            ng-if=\"(parseU ? (+(itemValue(config.minSocLimit) + '').split(' ')[0] || 0) : (+itemValue(config.minSocLimit) || 0)) > 0\">Min. SoC <tspan class=\"label-val\">{{(parseU ? (+(itemValue(config.minSocLimit) + '').split(' ')[0] || 0) : (+itemValue(config.minSocLimit) || 0)) | number:0}}%</tspan></text>\n      <text x=\"97\" y=\"476\" class=\"label\"\n            ng-if=\"(parseU ? (+(itemValue(config.minSocLimit) + '').split(' ')[0] || 0) : (+itemValue(config.minSocLimit) || 0)) <= 0\">Min. SoC <tspan class=\"label-val\">–</tspan></text>\n\n      <g class=\"soc-btn\"\n         ng-click=\"sendCmd(config.minSocLimit, ((parseU ? (+(itemValue(config.minSocLimit) + '').split(' ')[0] || 0) : (+itemValue(config.minSocLimit) || 0)) - socStep < socMinAllowed ? socMinAllowed : (parseU ? (+(itemValue(config.minSocLimit) + '').split(' ')[0] || 0) : (+itemValue(config.minSocLimit) || 0)) - socStep) + ((itemValue(config.minSocLimit) + '').split(' ')[1] ? ' ' + (itemValue(config.minSocLimit) + '').split(' ')[1] : ''))\">\n        <circle cx=\"24\" cy=\"471\" r=\"19\" class=\"btn-hit\"/>\n        <circle cx=\"24\" cy=\"471\" r=\"12\" class=\"btn-bg\"/>\n        <text x=\"24\" y=\"478\" class=\"btn-sign\">−</text>\n      </g>\n\n      <g class=\"soc-btn\"\n         ng-click=\"sendCmd(config.minSocLimit, ((parseU ? (+(itemValue(config.minSocLimit) + '').split(' ')[0] || 0) : (+itemValue(config.minSocLimit) || 0)) + socStep > socMaxAllowed ? socMaxAllowed : (parseU ? (+(itemValue(config.minSocLimit) + '').split(' ')[0] || 0) : (+itemValue(config.minSocLimit) || 0)) + socStep) + ((itemValue(config.minSocLimit) + '').split(' ')[1] ? ' ' + (itemValue(config.minSocLimit) + '').split(' ')[1] : ''))\">\n        <circle cx=\"170\" cy=\"471\" r=\"19\" class=\"btn-hit\"/>\n        <circle cx=\"170\" cy=\"471\" r=\"12\" class=\"btn-bg\"/>\n        <text x=\"170\" y=\"478\" class=\"btn-sign\">+</text>\n      </g>\n\n      <!-- Restkapazität (Akku-Kapazität battCap in kWh): Ampel wie der Ring: rot bis Min-SoC + 5 % (ohne Min-Item: 20 %), gelb bis 50 % der Kapazität, sonst grün -->\n      <text x=\"97\" y=\"504\" class=\"small\"\n            ng-class=\"{'c-red':    (parseU ? ((+(itemValue(config.battEnergy) + '').split(' ')[0] || 0) * ((itemValue(config.battEnergy) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.battEnergy) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.battEnergy) || 0)) < (((parseU ? (+(itemValue(config.minSocLimit) + '').split(' ')[0] || 0) : (+itemValue(config.minSocLimit) || 0)) > 0 ? (parseU ? (+(itemValue(config.minSocLimit) + '').split(' ')[0] || 0) : (+itemValue(config.minSocLimit) || 0)) + 5 : 20) * (battCap / 100)),\n                       'c-yellow': (parseU ? ((+(itemValue(config.battEnergy) + '').split(' ')[0] || 0) * ((itemValue(config.battEnergy) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.battEnergy) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.battEnergy) || 0)) >= (((parseU ? (+(itemValue(config.minSocLimit) + '').split(' ')[0] || 0) : (+itemValue(config.minSocLimit) || 0)) > 0 ? (parseU ? (+(itemValue(config.minSocLimit) + '').split(' ')[0] || 0) : (+itemValue(config.minSocLimit) || 0)) + 5 : 20) * (battCap / 100)) && (parseU ? ((+(itemValue(config.battEnergy) + '').split(' ')[0] || 0) * ((itemValue(config.battEnergy) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.battEnergy) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.battEnergy) || 0)) < (battCap / 2),\n                       'c-charge': (parseU ? ((+(itemValue(config.battEnergy) + '').split(' ')[0] || 0) * ((itemValue(config.battEnergy) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.battEnergy) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.battEnergy) || 0)) >= (((parseU ? (+(itemValue(config.minSocLimit) + '').split(' ')[0] || 0) : (+itemValue(config.minSocLimit) || 0)) > 0 ? (parseU ? (+(itemValue(config.minSocLimit) + '').split(' ')[0] || 0) : (+itemValue(config.minSocLimit) || 0)) + 5 : 20) * (battCap / 100)) && (parseU ? ((+(itemValue(config.battEnergy) + '').split(' ')[0] || 0) * ((itemValue(config.battEnergy) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.battEnergy) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.battEnergy) || 0)) >= (battCap / 2)}\">\n        {{(parseU ? ((+(itemValue(config.battEnergy) + '').split(' ')[0] || 0) * ((itemValue(config.battEnergy) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.battEnergy) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.battEnergy) || 0)) | number:2}}<tspan class=\"unit\" dx=\"4\">kWh</tspan>\n      </text>\n\n      <!-- Leistung -->\n      <text x=\"97\" y=\"538\" class=\"mid\"\n            ng-class=\"{'c-neutral': (parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0)) == 0,\n                       'c-charge':  (parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0)) > 0,\n                       'c-disch':   (parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0)) < 0}\">\n        {{(parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0)) | number:0}}<tspan class=\"unit\" dx=\"4\">W</tspan>\n      </text>\n\n      <!-- Status -->\n      <text x=\"97\" y=\"562\" class=\"label c-neutral\"\n            ng-if=\"itemValue(config.battPower) == 'NULL' || itemValue(config.battPower) == 'UNDEF'\">{{en ? 'NO DATA' : 'KEINE DATEN'}}</text>\n      <text x=\"97\" y=\"562\" class=\"label c-charge\"\n            ng-if=\"(parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0)) > 0\">{{en ? 'Charging' : 'Laden'}}</text>\n      <text x=\"97\" y=\"562\" class=\"label c-disch\"\n            ng-if=\"(parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0)) < 0\">{{en ? 'Discharging' : 'Entladen'}}</text>\n      <text x=\"97\" y=\"562\" class=\"label c-neutral\"\n            ng-if=\"(parseU ? ((+(itemValue(config.battPower) + '').split(' ')[0] || 0) * ((itemValue(config.battPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.battPower) || 0)) == 0 &&\n                   itemValue(config.battPower) != 'NULL' && itemValue(config.battPower) != 'UNDEF'\">{{en ? 'Idle' : 'Idle'}}</text>\n    </g>\n\n\n    <!-- ===================== NETZ ===================== -->\n    <rect x=\"210\" y=\"326\" width=\"186\" height=\"252\" rx=\"16\" class=\"card\"/>\n    <!-- Füllstand-Hintergrund (clip-netz-in) -->\n    <g ng-repeat=\"L in [(parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) > gridMaxW ? 1 : ((parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) > 0 ? (parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) / gridMaxW : 0)] track by $index\">\n      <clipPath id=\"clip-netz-in\"><rect x=\"0\" width=\"400\" ng-attr-y=\"{{578 - 252 * L}}\" ng-attr-height=\"{{252 * L + 3}}\"/></clipPath>\n      <rect x=\"210\" y=\"326\" width=\"186\" height=\"252\" rx=\"16\" class=\"frame frame-netz-in\" ng-if=\"L > 0\"/>\n    </g>\n\n    <!-- Füllstand-Hintergrund (clip-netz-out) -->\n    <g ng-repeat=\"L in [-(parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) > pvMaxW ? 1 : ((parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) < 0 ? -(parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) / pvMaxW : 0)] track by $index\">\n      <clipPath id=\"clip-netz-out\"><rect x=\"0\" width=\"400\" ng-attr-y=\"{{578 - 252 * L}}\" ng-attr-height=\"{{252 * L + 3}}\"/></clipPath>\n      <rect x=\"210\" y=\"326\" width=\"186\" height=\"252\" rx=\"16\" class=\"frame frame-netz-out\" ng-if=\"L > 0\"/>\n    </g>\n\n\n    <!-- Netz-Verlauf der letzten 24 h als Bild vom openHAB-Chart-Dienst (rrd4j), wie bei der PV-Kachel.\n         Positive Werte = Bezug, negative = Einspeisung. t=... lädt das Bild neu, wenn sich Tageswerte ändern. -->\n    <clipPath id=\"clip-gridchart-card\"><rect x=\"210\" y=\"326\" width=\"186\" height=\"252\" rx=\"16\"/></clipPath>\n    <g class=\"grid-chart-clip-card\" ng-if=\"!hideGC\">\n      <image class=\"grid-chart\" x=\"193.6\" y=\"465.4\" width=\"210.8\" height=\"125.1\" preserveAspectRatio=\"none\"\n             ng-attr-href=\"/chart?items={{config.gridPower}}&period={{config.gridChartPeriod || config.chartPeriod}}&service=rrd4j&w=800&h=240&legend=false&t={{itemValue(config.gridImportToday)}}-{{itemValue(config.pvYieldToday)}}\"/>\n    </g>\n\n    <!-- Netz-Symbol: kompakter Netz-/Mastkörper, optisch auf Akku abgestimmt -->\n    <g class=\"energy-icon energy-icon-grid\" aria-hidden=\"true\">\n      <path d=\"M238 337 L228 368 H248 Z\"/>\n      <path d=\"M232 356 H244 M230 348 H246 M238 337 V332 M233 334 H243\"/>\n      <path d=\"M232 356 L228 368 M244 356 L248 368\"/>\n    </g>\n\n    <text x=\"303\" y=\"352\" class=\"title\">{{en ? 'GRID' : 'NETZ'}}</text>\n\n    <text x=\"303\" y=\"398\" class=\"mid\"\n          ng-class=\"{'c-in':  (parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) > 0,\n                     'c-out': (parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) < 0,\n                     'c-white': (parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) == 0}\">\n      {{(parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) | number:0}}<tspan class=\"unit\" dx=\"4\">W</tspan>\n    </text>\n\n    <text x=\"303\" y=\"422\" class=\"label\"\n          ng-if=\"(parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) > 0\">{{en ? 'Import' : 'Bezug'}}</text>\n    <text x=\"303\" y=\"422\" class=\"label\"\n          ng-if=\"(parseU ? ((+(itemValue(config.gridPower) + '').split(' ')[0] || 0) * ((itemValue(config.gridPower) + '').split(' ')[1] == 'kW' ? 1000 : 1)) : (+itemValue(config.gridPower) || 0)) < 0\">{{en ? 'Export' : 'Einspeisung'}}</text>\n\n    <text x=\"303\" y=\"460\" class=\"label\">{{en ? 'Today' : 'Heute'}}</text>\n    <text x=\"303\" y=\"486\" class=\"small c-in\">\n      {{(parseU ? ((+(itemValue(config.gridImportToday) + '').split(' ')[0] || 0) * ((itemValue(config.gridImportToday) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.gridImportToday) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.gridImportToday) || 0)) | number:2}}<tspan class=\"unit\" dx=\"4\">kWh</tspan>\n    </text>\n\n    <text x=\"303\" y=\"514\" class=\"label\">{{en ? 'Yesterday' : 'Gestern'}}</text>\n    <text x=\"303\" y=\"540\" class=\"small c-in yday\">\n      {{(parseU ? ((+(itemValue(config.gridImportYesterday) + '').split(' ')[0] || 0) * ((itemValue(config.gridImportYesterday) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.gridImportYesterday) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.gridImportYesterday) || 0)) | number:2}}<tspan class=\"unit\" dx=\"4\">kWh</tspan>\n    </text>\n\n\n    <!-- Monat: per Einstellung hideMonth ausblendbar -->\n    <g ng-if=\"!hideM\">\n    <!-- ===================== MONAT ===================== -->\n    <rect x=\"4\" y=\"598\" width=\"392\" height=\"236\" rx=\"16\" class=\"card\"/>\n\n    <text x=\"20\" y=\"626\" class=\"title start\">{{en ? 'Month' : 'Monat'}}</text>\n    <text x=\"215\" y=\"626\" class=\"label end\">{{en ? 'Current' : 'Aktuell'}}</text>\n    <text x=\"363\" y=\"626\" class=\"label end\">{{en ? 'Last' : 'Letzter'}}</text>\n\n    <line x1=\"20\" y1=\"636\" x2=\"380\" y2=\"636\" class=\"divider\"/>\n\n    <!-- Gesamt -->\n    <text x=\"20\" y=\"670\" class=\"label start\">{{en ? 'Total' : 'Gesamt'}}</text>\n    <text x=\"215\" y=\"670\" class=\"small c-house end\">{{(parseU ? ((+(itemValue(config.loadMonth) + '').split(' ')[0] || 0) * ((itemValue(config.loadMonth) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.loadMonth) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.loadMonth) || 0)) | number:2}}</text><text x=\"218\" y=\"670\" class=\"unit-col start\">kWh</text>\n    <text x=\"363\" y=\"670\" class=\"small c-house end yday month-last\">{{(parseU ? ((+(itemValue(config.loadMonthLast) + '').split(' ')[0] || 0) * ((itemValue(config.loadMonthLast) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.loadMonthLast) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.loadMonthLast) || 0)) | number:2}}</text><text x=\"366\" y=\"670\" class=\"unit-col unit-col-last start yday\">kWh</text>\n\n    <!-- PV -->\n    <text x=\"20\" y=\"710\" class=\"label start\">{{en ? 'PV yield' : 'PV Ertrag'}}</text>\n    <text x=\"215\" y=\"710\" class=\"small c-charge end\">{{(parseU ? ((+(itemValue(config.pvYieldMonth) + '').split(' ')[0] || 0) * ((itemValue(config.pvYieldMonth) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.pvYieldMonth) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.pvYieldMonth) || 0)) | number:2}}</text><text x=\"218\" y=\"710\" class=\"unit-col start\">kWh</text>\n    <text x=\"363\" y=\"710\" class=\"small c-charge end yday month-last\">{{(parseU ? ((+(itemValue(config.pvYieldMonthLast) + '').split(' ')[0] || 0) * ((itemValue(config.pvYieldMonthLast) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.pvYieldMonthLast) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.pvYieldMonthLast) || 0)) | number:2}}</text><text x=\"366\" y=\"710\" class=\"unit-col unit-col-last start yday\">kWh</text>\n\n    <!-- Netz -->\n    <text x=\"20\" y=\"750\" class=\"label start\">{{en ? 'Grid import' : 'Netzbezug'}}</text>\n    <text x=\"215\" y=\"750\" class=\"small c-in end\">{{(parseU ? ((+(itemValue(config.gridImportMonth) + '').split(' ')[0] || 0) * ((itemValue(config.gridImportMonth) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.gridImportMonth) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.gridImportMonth) || 0)) | number:2}}</text><text x=\"218\" y=\"750\" class=\"unit-col start\">kWh</text>\n    <text x=\"363\" y=\"750\" class=\"small c-in end yday month-last\">{{(parseU ? ((+(itemValue(config.gridImportMonthLast) + '').split(' ')[0] || 0) * ((itemValue(config.gridImportMonthLast) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.gridImportMonthLast) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.gridImportMonthLast) || 0)) | number:2}}</text><text x=\"366\" y=\"750\" class=\"unit-col unit-col-last start yday\">kWh</text>\n\n    <!-- PV-Anteil am Gesamtverbrauch im Monat (Einstellung pvShareMonth, in %) mit Balken -->\n    <line x1=\"20\" y1=\"768\" x2=\"380\" y2=\"768\" class=\"divider\"/>\n\n    <text x=\"20\" y=\"798\" class=\"label start\">{{en ? 'PV share of consumption' : 'PV-Anteil am Verbrauch'}}</text>\n    <text x=\"386\" y=\"798\" class=\"small c-charge end\">{{(parseU ? (+(itemValue(config.pvShareMonth) + '').split(' ')[0] || 0) : (+itemValue(config.pvShareMonth) || 0)) | number:2}}<tspan class=\"unit\" dx=\"3\">%</tspan></text>\n\n    <rect x=\"20\" y=\"810\" width=\"360\" height=\"8\" rx=\"4\" class=\"bar-bg\"/>\n    <rect x=\"20\" y=\"810\" height=\"8\" rx=\"4\" class=\"bar-fill\"\n          ng-attr-width=\"{{360 * ((parseU ? (+(itemValue(config.pvShareMonth) + '').split(' ')[0] || 0) : (+itemValue(config.pvShareMonth) || 0)) > 100 ? 100 : (parseU ? (+(itemValue(config.pvShareMonth) + '').split(' ')[0] || 0) : (+itemValue(config.pvShareMonth) || 0))) / 100}}\"/>\n    </g>\n\n    <!-- Jahr: per Einstellung hideYear ausblendbar; rückt nach oben, wenn Monat fehlt -->\n    <g ng-if=\"!hideY\" ng-attr-transform=\"translate(0, {{hideM ? -256 : 0}})\">\n    <!-- ===================== JAHR ===================== -->\n    <rect x=\"4\" y=\"854\" width=\"392\" height=\"266\" rx=\"16\" class=\"card\"/>\n\n    <text x=\"20\" y=\"882\" class=\"title start\">{{en ? 'Year' : 'Jahr'}}</text>\n    <text x=\"215\" y=\"882\" class=\"label end\">{{en ? 'Current' : 'Aktuell'}}</text>\n    <text x=\"363\" y=\"882\" class=\"label end\">{{en ? 'Last' : 'Letztes'}}</text>\n\n    <line x1=\"20\" y1=\"892\" x2=\"380\" y2=\"892\" class=\"divider\"/>\n\n    <text x=\"20\" y=\"922\" class=\"label start\">{{en ? 'Total' : 'Gesamt'}}</text>\n    <text x=\"215\" y=\"922\" class=\"small c-house end\">{{(parseU ? ((+(itemValue(config.loadYear) + '').split(' ')[0] || 0) * ((itemValue(config.loadYear) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.loadYear) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.loadYear) || 0)) | number:0}}</text><text x=\"218\" y=\"922\" class=\"unit-col start\">kWh</text>\n    <text x=\"363\" y=\"922\" class=\"small c-house end yday month-last\">{{(parseU ? ((+(itemValue(config.loadYearLast) + '').split(' ')[0] || 0) * ((itemValue(config.loadYearLast) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.loadYearLast) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.loadYearLast) || 0)) | number:0}}</text><text x=\"366\" y=\"922\" class=\"unit-col unit-col-last start yday\">kWh</text>\n    <text x=\"20\" y=\"960\" class=\"label start\">{{en ? 'PV yield' : 'PV Ertrag'}}</text>\n    <text x=\"215\" y=\"960\" class=\"small c-charge end\">{{(parseU ? ((+(itemValue(config.pvYieldYear) + '').split(' ')[0] || 0) * ((itemValue(config.pvYieldYear) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.pvYieldYear) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.pvYieldYear) || 0)) | number:0}}</text><text x=\"218\" y=\"960\" class=\"unit-col start\">kWh</text>\n    <text x=\"363\" y=\"960\" class=\"small c-charge end yday month-last\">{{(parseU ? ((+(itemValue(config.pvYieldYearLast) + '').split(' ')[0] || 0) * ((itemValue(config.pvYieldYearLast) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.pvYieldYearLast) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.pvYieldYearLast) || 0)) | number:0}}</text><text x=\"366\" y=\"960\" class=\"unit-col unit-col-last start yday\">kWh</text>\n    <text x=\"20\" y=\"998\" class=\"label start\">{{en ? 'Grid import' : 'Netzbezug'}}</text>\n    <text x=\"215\" y=\"998\" class=\"small c-in end\">{{(parseU ? ((+(itemValue(config.gridImportYear) + '').split(' ')[0] || 0) * ((itemValue(config.gridImportYear) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.gridImportYear) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.gridImportYear) || 0)) | number:0}}</text><text x=\"218\" y=\"998\" class=\"unit-col start\">kWh</text>\n    <text x=\"363\" y=\"998\" class=\"small c-in end yday month-last\">{{(parseU ? ((+(itemValue(config.gridImportYearLast) + '').split(' ')[0] || 0) * ((itemValue(config.gridImportYearLast) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.gridImportYearLast) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.gridImportYearLast) || 0)) | number:0}}</text><text x=\"366\" y=\"998\" class=\"unit-col unit-col-last start yday\">kWh</text>\n    <text x=\"20\" y=\"1036\" class=\"label start\">{{en ? 'Export' : 'Einspeisung'}}</text>\n    <text x=\"215\" y=\"1036\" class=\"small c-out end\">{{(parseU ? ((+(itemValue(config.gridExportYear) + '').split(' ')[0] || 0) * ((itemValue(config.gridExportYear) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.gridExportYear) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.gridExportYear) || 0)) | number:0}}</text><text x=\"218\" y=\"1036\" class=\"unit-col start\">kWh</text>\n    <text x=\"363\" y=\"1036\" class=\"small c-out end yday month-last\">{{(parseU ? ((+(itemValue(config.gridExportYearLast) + '').split(' ')[0] || 0) * ((itemValue(config.gridExportYearLast) + '').split(' ')[1] == 'Wh' ? 0.001 : ((itemValue(config.gridExportYearLast) + '').split(' ')[1] == 'MWh' ? 1000 : 1))) : (+itemValue(config.gridExportYearLast) || 0)) | number:0}}</text><text x=\"366\" y=\"1036\" class=\"unit-col unit-col-last start yday\">kWh</text>\n\n    <!-- PV-Anteil am Gesamtverbrauch im Jahr (Einstellung pvShareYear, in %) mit Balken -->\n    <line x1=\"20\" y1=\"1054\" x2=\"380\" y2=\"1054\" class=\"divider\"/>\n\n    <text x=\"20\" y=\"1084\" class=\"label start\">{{en ? 'PV share of consumption' : 'PV-Anteil am Verbrauch'}}</text>\n    <text x=\"386\" y=\"1084\" class=\"small c-charge end\">{{(parseU ? (+(itemValue(config.pvShareYear) + '').split(' ')[0] || 0) : (+itemValue(config.pvShareYear) || 0)) | number:2}}<tspan class=\"unit\" dx=\"3\">%</tspan></text>\n\n    <rect x=\"20\" y=\"1096\" width=\"360\" height=\"8\" rx=\"4\" class=\"bar-bg\"/>\n    <rect x=\"20\" y=\"1096\" height=\"8\" rx=\"4\" class=\"bar-fill\"\n          ng-attr-width=\"{{360 * ((parseU ? (+(itemValue(config.pvShareYear) + '').split(' ')[0] || 0) : (+itemValue(config.pvShareYear) || 0)) > 100 ? 100 : (parseU ? (+(itemValue(config.pvShareYear) + '').split(' ')[0] || 0) : (+itemValue(config.pvShareYear) || 0))) / 100}}\"/>\n    </g>\n\n    </svg>\n\n  </div>\n\n</div>\n",
  "name": "Energy flow widget v3.5",
  "author": "Peter Aschinger",
  "description": "Energy flow widget for smartphones (PV, battery, grid, house) with charts, fill levels and configurable items",
  "settings": [
    {
      "type": "item",
      "id": "pvPower",
      "label": "PV power",
      "description": "Current PV power in W"
    },
    {
      "type": "item",
      "id": "pvYieldToday",
      "label": "PV yield today",
      "description": "in Wh"
    },
    {
      "type": "item",
      "id": "pvYieldYesterday",
      "label": "PV yield yesterday",
      "description": "in kWh"
    },
    {
      "type": "item",
      "id": "pvYieldMonth",
      "description": "in kWh",
      "label": "PV yield this month"
    },
    {
      "type": "item",
      "id": "pvYieldMonthLast",
      "description": "in kWh",
      "label": "PV yield last month"
    },
    {
      "type": "item",
      "id": "pvYieldYear",
      "description": "in kWh",
      "label": "PV yield this year"
    },
    {
      "type": "item",
      "id": "pvYieldYearLast",
      "description": "in kWh",
      "label": "PV yield last year"
    },
    {
      "type": "item",
      "id": "pvShareMonth",
      "description": "in %",
      "label": "PV share of consumption, month"
    },
    {
      "type": "item",
      "id": "pvShareYear",
      "label": "PV share of consumption, year",
      "description": "in %"
    },
    {
      "type": "item",
      "id": "gridPower",
      "label": "Grid power",
      "description": "W, positive = import, negative = export"
    },
    {
      "type": "item",
      "id": "gridImportToday",
      "label": "Grid import today",
      "description": "in kWh"
    },
    {
      "type": "item",
      "id": "gridImportYesterday",
      "label": "Grid import yesterday",
      "description": "in kWh"
    },
    {
      "type": "item",
      "id": "gridImportMonth",
      "label": "Grid import this month",
      "description": "in kWh"
    },
    {
      "type": "item",
      "id": "gridImportMonthLast",
      "label": "Grid import last month",
      "description": "in kWh"
    },
    {
      "type": "item",
      "id": "gridImportYear",
      "label": "Grid import this year",
      "description": "in kWh"
    },
    {
      "type": "item",
      "id": "gridImportYearLast",
      "label": "Grid import last year",
      "description": "in kWh"
    },
    {
      "type": "item",
      "id": "gridExportYear",
      "label": "Grid export this year",
      "description": "in kWh"
    },
    {
      "type": "item",
      "id": "gridExportYearLast",
      "label": "Grid export last year",
      "description": "in kWh"
    },
    {
      "type": "item",
      "id": "loadToday",
      "label": "Consumption today",
      "description": "in kWh"
    },
    {
      "type": "item",
      "id": "loadYesterday",
      "label": "Consumption yesterday",
      "description": "in kWh"
    },
    {
      "type": "item",
      "id": "loadMonth",
      "description": "in kWh",
      "label": "Consumption this month"
    },
    {
      "type": "item",
      "id": "loadMonthLast",
      "label": "Consumption last month",
      "description": "in kWh"
    },
    {
      "type": "item",
      "id": "loadYear",
      "label": "Consumption this year",
      "description": "in kWh"
    },
    {
      "type": "item",
      "id": "loadYearLast",
      "label": "Consumption last year",
      "description": "in kWh"
    },
    {
      "type": "item",
      "id": "battPower",
      "label": "Battery power",
      "description": "W, positive = charging, negative = discharging"
    },
    {
      "type": "item",
      "id": "battSoc",
      "label": "Battery SoC",
      "description": "in %"
    },
    {
      "type": "item",
      "id": "battEnergy",
      "label": "Battery remaining energy",
      "description": "in kWh"
    },
    {
      "type": "item",
      "id": "minSocLimit",
      "label": "Minimum SoC",
      "description": "in %, written by the +/- buttons"
    },
    {
      "type": "number",
      "id": "pvMaxW",
      "label": "PV power for full tile (W)",
      "default": 1500,
      "description": "Inverter peak power"
    },
    {
      "type": "number",
      "id": "gridMaxW",
      "label": "Grid import for full tile (W)",
      "default": 3000,
      "description": "At this power the grid tile is completely filled"
    },
    {
      "type": "number",
      "id": "battCapacity",
      "label": "Battery capacity (kWh)",
      "default": 7.5,
      "description": "Usable capacity, used for the traffic light of the remaining energy"
    },
    {
      "type": "number",
      "id": "socStep",
      "label": "Min SoC step (%)",
      "default": 5,
      "description": "Step size of the +/- buttons"
    },
    {
      "type": "number",
      "id": "socMinAllowed",
      "label": "Lowest allowed min SoC (%)",
      "default": 5,
      "description": "Lower limit of the +/- buttons"
    },
    {
      "type": "number",
      "id": "socMaxAllowed",
      "label": "Highest allowed min SoC (%)",
      "default": 95,
      "description": "Upper limit of the +/- buttons"
    },
    {
      "type": "checkbox",
      "id": "hideMonth",
      "label": "Hide month tile",
      "description": "The year tile moves up"
    },
    {
      "type": "checkbox",
      "id": "hideYear",
      "label": "Hide year tile",
      "description": ""
    },
    {
      "type": "checkbox",
      "id": "hideChart",
      "label": "Hide PV chart",
      "description": ""
    },
    {
      "type": "string",
      "id": "chartPeriod",
      "label": "PV chart period",
      "description": "openHAB chart period: h, 4h, 8h, 12h, D (24 h), 3D, W",
      "default": "D"
    },
    {
      "type": "checkbox",
      "id": "hideGridChart",
      "label": "Hide grid chart",
      "description": ""
    },
    {
      "type": "string",
      "id": "gridChartPeriod",
      "label": "Grid chart period",
      "default": "D",
      "description": "Same values; empty = same as PV chart"
    },
    {
      "type": "string",
      "id": "language",
      "label": "Label language",
      "default": "en",
      "description": "de = German, en = English"
    },
    {
      "type": "checkbox",
      "id": "scrollInside",
      "label": "Scroll inside the widget",
      "description": "Only needed if the tile is smaller than the widget. Otherwise leave off, then the dashboard scrolls without delay"
    },
    {
      "type": "checkbox",
      "id": "parseUnits",
      "label": "Read items with units",
      "description": "Only switch on if your items report units (e.g. \"257 W\", openHAB 3 and newer). Off = faster",
      "default": true
    }
  ]
}