type: custom:stack-in-card card_mod: style: | ha-card { border: 2px solid #0097E0; border-radius: 16px; background: var(--ha-card-background, var(--card-background-color, #FFFFFF)); box-shadow: 0 8px 24px rgba(0, 151, 224, 0.18); overflow: visible; } cards: # --- HEADER: the same for every Daikin Cycle ML card (#427) --- - type: custom:button-card variables: &dcm lang_override: '' # '' = auto (HA language, then integration language) | en | nl | fr theme_override: auto # auto (follows the HA dark mode) | light | dark show_help: true # false = hide the explanation notes show_name: false show_icon: false triggers_update: all styles: card: - background: none - box-shadow: none - border: none - border-radius: 14px 14px 0 0 - padding: 0 grid: - grid-template-areas: '"content"' - grid-template-columns: 1fr custom_fields: content: - width: 100% custom_fields: content: | [[[ /* DCM-COMMON-BEGIN (#427) shared by every Daikin Cycle ML card: language, theme, header. Do not edit in a card: edit tools/card_common.js and run tools/sync_card_common.py */ var DCM = (function () { var V = (typeof variables !== 'undefined' && variables) ? variables : {}; var H = (typeof hass !== 'undefined' && hass) ? hass : {}; var S = (typeof states !== 'undefined' && states) ? states : {}; var find = function (tk, sfx) { var ids = Object.keys(S), i, j, k, E = H.entities || {}; for (i = 0; i < ids.length; i++) { if (ids[i].indexOf('sensor.') !== 0) continue; for (j = 0; j < sfx.length; j++) { if (ids[i].slice(-sfx[j].length - 1) === '_' + sfx[j]) return ids[i]; } } for (k in E) { if (E[k] && E[k].platform === 'daikin_cycle_ml' && E[k].translation_key === tk && S[k]) return k; } return null; }; var A = function (id) { return (id && S[id] && S[id].attributes) ? S[id].attributes : {}; }; var csA = A(find('cycle_state', ['cycle_state', 'cyclus_status', 'etat_du_cycle'])); var spA = A(find('hp_specs', ['hp_specs', 'wp_specs', 'caracteristiques_de_la_pac'])); /* language: lang_override, then the HA language, then the integration language, then English */ var LS = ['en', 'nl', 'fr']; var ov = String(V.lang_override || '').toLowerCase(); var ha = String(H.language || '').toLowerCase().slice(0, 2); var cl = String(csA.configured_language || '').toLowerCase(); var lang = LS.indexOf(ov) >= 0 ? ov : (LS.indexOf(ha) >= 0 ? ha : (LS.indexOf(cl) >= 0 ? cl : 'en')); /* theme: auto follows the HA dark mode; light / dark force it */ var th = String(V.theme_override || 'auto').toLowerCase(); var dark = th === 'dark' ? true : (th === 'light' ? false : !!(H.themes && H.themes.darkMode)); var P = dark ? { bg: '#1B1F24', bg2: '#232A33', bg3: '#1E3448', hd1: '#1E3448', hd2: '#15283A', text: '#E6F0FA', text2: '#90CAF9', muted: '#B0BEC5', border: 'rgba(79,195,247,0.35)', accent: '#4FC3F7', good: '#66BB6A', warn: '#FFA726', bad: '#EF5350' } : { bg: '#FFFFFF', bg2: '#F5FAFD', bg3: '#E3F2FD', hd1: '#E3F2FD', hd2: '#BBDEFB', text: '#0D47A1', text2: '#1565C0', muted: '#546E7A', border: 'rgba(0,151,224,0.25)', accent: '#0097E0', good: '#2E7D32', warn: '#E65100', bad: '#C62828' }; /* light colours of the cards -> dark mode (light backgrounds dark, dark text light) */ var MAP = { '#FFFFFF': P.bg, '#F5FAFD': P.bg2, '#F5FAFE': P.bg2, '#E6F4FB': P.bg2, '#E8F2FB': P.bg2, '#EAF2F8': P.bg2, '#E3F2FD': P.bg3, '#D6ECF7': P.bg3, '#DCEBFA': P.bg3, '#BBDEFB': '#1F4A6B', '#D6EAF8': P.bg3, '#E1F5FE': P.bg3, '#AED6F1': '#1F4A6B', '#FFF3E0': '#3A2A12', '#FFF8EC': '#3A2A12', '#FDEAD0': '#3A2A12', '#FFEBEE': '#3A1D1D', '#FDECEA': '#3A1D1D', '#FBD0C8': '#3A1D1D', '#E8F5E9': '#1C3324', '#EAFAF1': '#1C3324', '#D5F5E3': '#1C3324', '#F3E5F5': '#2E2236', '#0D47A1': P.text, '#003366': P.text, '#001B3D': P.text, '#003A70': P.text, '#00539F': '#BBDEFB', '#005A9C': '#BBDEFB', '#1565C0': P.text2, '#1976D2': '#64B5F6', '#546E7A': P.muted, '#5D6D7E': P.muted, '#7F8C8D': '#9EADB5', '#95A5A6': '#9EADB5', '#37474F': '#CFD8DC', '#444444': '#CFD8DC', '#000000': '#ECEFF1', '#94A3B8': '#78909C', '#6A1B9A': '#CE93D8', '#2E7D32': '#4CAF50', '#1E8449': '#81C784', '#C62828': '#E53935', '#E65100': '#FB8C00', '#7D4F00': '#FFCC80', '#8B1A1A': '#EF9A9A', '#7A0008': '#EF9A9A' }; var paint = function (html) { if (!dark || typeof html !== 'string') return html; return html .replace(/(background(?:-color)?\s*:\s*)(#fff\b|white\b)/gi, '$1' + P.bg) .replace(/(<(?:rect|circle|ellipse|path)\b[^>]*?\sfill=")(white|#fff|#ffffff)(")/gi, '$1' + P.bg2 + '$3') .replace(/rgba\(\s*255\s*,\s*255\s*,\s*255\s*,\s*([0-9.]+)\s*\)/g, function (m, a) { return 'rgba(255,255,255,' + Math.min(0.08, parseFloat(a) * 0.1).toFixed(3) + ')'; }) .replace(/#[0-9a-fA-F]{6}\b/g, function (m) { return MAP[m.toUpperCase()] || m; }); }; var T3 = function (o) { return (o && typeof o === 'object') ? (o[lang] || o.en || '') : String(o || ''); }; var model = spA.model ? String(spA.model).toUpperCase() : ''; var meta = [spA.family, spA.kw ? spA.kw + ' kW' : '', spA.refrigerant].filter(function (x) { return x && String(x) !== 'None'; }).join(' · '); /* one header for every card: icon, title + model, subtitle + family / kW / refrigerant */ var header = function (icon, title, sub) { return '
' + '
' + icon + '
' + '
' + '
' + T3(title) + (model ? ' · ' + model : '') + '
' + '
' + T3(sub) + (meta ? ' · ' + meta : '') + '
' + '
'; }; return { lang: lang, dark: dark, P: P, paint: paint, header: header, T3: T3, V: V, model: model, showHelp: V.show_help !== false && V.show_hints !== false }; })(); /* DCM-COMMON-END */ return DCM.header("📈", {en: "Heating curve", nl: "Stooklijn", fr: "Loi d'eau"}, {en: "LWT vs outdoor · heatmap · modes · balance", nl: "LWT vs buiten · heatmap · modi · balans", fr: "Départ / extérieur · carte COP · modes · bilan"}); ]]] - type: custom:button-card variables: *dcm show_name: false show_icon: false styles: grid: - grid-template-areas: '"content"' - grid-template-columns: 1fr card: - background: none - box-shadow: none - border: none - padding: 8px 8px 4px 8px custom_fields: content: - width: 100% - pointer-events: auto # #427: taps on the points (the card itself has no actions) custom_fields: content: | [[[ /* DCM-COMMON-BEGIN (#427) shared by every Daikin Cycle ML card: language, theme, header. Do not edit in a card: edit tools/card_common.js and run tools/sync_card_common.py */ var DCM = (function () { var V = (typeof variables !== 'undefined' && variables) ? variables : {}; var H = (typeof hass !== 'undefined' && hass) ? hass : {}; var S = (typeof states !== 'undefined' && states) ? states : {}; var find = function (tk, sfx) { var ids = Object.keys(S), i, j, k, E = H.entities || {}; for (i = 0; i < ids.length; i++) { if (ids[i].indexOf('sensor.') !== 0) continue; for (j = 0; j < sfx.length; j++) { if (ids[i].slice(-sfx[j].length - 1) === '_' + sfx[j]) return ids[i]; } } for (k in E) { if (E[k] && E[k].platform === 'daikin_cycle_ml' && E[k].translation_key === tk && S[k]) return k; } return null; }; var A = function (id) { return (id && S[id] && S[id].attributes) ? S[id].attributes : {}; }; var csA = A(find('cycle_state', ['cycle_state', 'cyclus_status', 'etat_du_cycle'])); var spA = A(find('hp_specs', ['hp_specs', 'wp_specs', 'caracteristiques_de_la_pac'])); /* language: lang_override, then the HA language, then the integration language, then English */ var LS = ['en', 'nl', 'fr']; var ov = String(V.lang_override || '').toLowerCase(); var ha = String(H.language || '').toLowerCase().slice(0, 2); var cl = String(csA.configured_language || '').toLowerCase(); var lang = LS.indexOf(ov) >= 0 ? ov : (LS.indexOf(ha) >= 0 ? ha : (LS.indexOf(cl) >= 0 ? cl : 'en')); /* theme: auto follows the HA dark mode; light / dark force it */ var th = String(V.theme_override || 'auto').toLowerCase(); var dark = th === 'dark' ? true : (th === 'light' ? false : !!(H.themes && H.themes.darkMode)); var P = dark ? { bg: '#1B1F24', bg2: '#232A33', bg3: '#1E3448', hd1: '#1E3448', hd2: '#15283A', text: '#E6F0FA', text2: '#90CAF9', muted: '#B0BEC5', border: 'rgba(79,195,247,0.35)', accent: '#4FC3F7', good: '#66BB6A', warn: '#FFA726', bad: '#EF5350' } : { bg: '#FFFFFF', bg2: '#F5FAFD', bg3: '#E3F2FD', hd1: '#E3F2FD', hd2: '#BBDEFB', text: '#0D47A1', text2: '#1565C0', muted: '#546E7A', border: 'rgba(0,151,224,0.25)', accent: '#0097E0', good: '#2E7D32', warn: '#E65100', bad: '#C62828' }; /* light colours of the cards -> dark mode (light backgrounds dark, dark text light) */ var MAP = { '#FFFFFF': P.bg, '#F5FAFD': P.bg2, '#F5FAFE': P.bg2, '#E6F4FB': P.bg2, '#E8F2FB': P.bg2, '#EAF2F8': P.bg2, '#E3F2FD': P.bg3, '#D6ECF7': P.bg3, '#DCEBFA': P.bg3, '#BBDEFB': '#1F4A6B', '#D6EAF8': P.bg3, '#E1F5FE': P.bg3, '#AED6F1': '#1F4A6B', '#FFF3E0': '#3A2A12', '#FFF8EC': '#3A2A12', '#FDEAD0': '#3A2A12', '#FFEBEE': '#3A1D1D', '#FDECEA': '#3A1D1D', '#FBD0C8': '#3A1D1D', '#E8F5E9': '#1C3324', '#EAFAF1': '#1C3324', '#D5F5E3': '#1C3324', '#F3E5F5': '#2E2236', '#0D47A1': P.text, '#003366': P.text, '#001B3D': P.text, '#003A70': P.text, '#00539F': '#BBDEFB', '#005A9C': '#BBDEFB', '#1565C0': P.text2, '#1976D2': '#64B5F6', '#546E7A': P.muted, '#5D6D7E': P.muted, '#7F8C8D': '#9EADB5', '#95A5A6': '#9EADB5', '#37474F': '#CFD8DC', '#444444': '#CFD8DC', '#000000': '#ECEFF1', '#94A3B8': '#78909C', '#6A1B9A': '#CE93D8', '#2E7D32': '#4CAF50', '#1E8449': '#81C784', '#C62828': '#E53935', '#E65100': '#FB8C00', '#7D4F00': '#FFCC80', '#8B1A1A': '#EF9A9A', '#7A0008': '#EF9A9A' }; var paint = function (html) { if (!dark || typeof html !== 'string') return html; return html .replace(/(background(?:-color)?\s*:\s*)(#fff\b|white\b)/gi, '$1' + P.bg) .replace(/(<(?:rect|circle|ellipse|path)\b[^>]*?\sfill=")(white|#fff|#ffffff)(")/gi, '$1' + P.bg2 + '$3') .replace(/rgba\(\s*255\s*,\s*255\s*,\s*255\s*,\s*([0-9.]+)\s*\)/g, function (m, a) { return 'rgba(255,255,255,' + Math.min(0.08, parseFloat(a) * 0.1).toFixed(3) + ')'; }) .replace(/#[0-9a-fA-F]{6}\b/g, function (m) { return MAP[m.toUpperCase()] || m; }); }; var T3 = function (o) { return (o && typeof o === 'object') ? (o[lang] || o.en || '') : String(o || ''); }; var model = spA.model ? String(spA.model).toUpperCase() : ''; var meta = [spA.family, spA.kw ? spA.kw + ' kW' : '', spA.refrigerant].filter(function (x) { return x && String(x) !== 'None'; }).join(' · '); /* one header for every card: icon, title + model, subtitle + family / kW / refrigerant */ var header = function (icon, title, sub) { return '
' + '
' + icon + '
' + '
' + '
' + T3(title) + (model ? ' · ' + model : '') + '
' + '
' + T3(sub) + (meta ? ' · ' + meta : '') + '
' + '
'; }; return { lang: lang, dark: dark, P: P, paint: paint, header: header, T3: T3, V: V, model: model, showHelp: V.show_help !== false && V.show_hints !== false }; })(); /* DCM-COMMON-END */ return DCM.paint((function () { var _DEC = (function(){ try { var _lc = (typeof hass !== 'undefined' && hass && hass.locale) ? hass.locale : {}; var _nf = _lc.number_format; if (_nf === 'comma_decimal' || _nf === 'none') return '.'; if (_nf === 'decimal_comma' || _nf === 'space_comma') return ','; var _l = String(_lc.language || (typeof hass !== 'undefined' && hass && hass.language) || 'en'); return (1.5).toLocaleString(_l).indexOf(',') >= 0 ? ',' : '.'; } catch (e) { return '.'; } })(); /* #427: decimal separator from the HA number format */ /* #347 entity resolver (EN id -> [translation_key, nl, fr]) */ var _dcmA = {"binary_sensor.daikin_cycle_ml_buh_active":["buh_active","daikin_cycle_ml_buh_actief","daikin_cycle_ml_appoint_en_marche"],"binary_sensor.daikin_cycle_ml_compressor_running":["compressor_running","daikin_cycle_ml_compressor_actief","daikin_cycle_ml_compresseur_en_marche"],"binary_sensor.daikin_cycle_ml_defrost_active":["defrost_active","daikin_cycle_ml_defrost_actief","daikin_cycle_ml_degivrage_en_cours"],"sensor.daikin_cycle_ml_cop_curve_recent":["cop_curve_recent","daikin_cycle_ml_cop_curve_recent","daikin_cycle_ml_courbe_de_cop_recente"],"sensor.daikin_cycle_ml_cop_mean_day":["cop_mean_day","daikin_cycle_ml_cop_gemiddelde_dag","daikin_cycle_ml_cop_moyen_du_jour"],"sensor.daikin_cycle_ml_cop_mean_week":["cop_mean_week","daikin_cycle_ml_cop_gemiddelde_week","daikin_cycle_ml_cop_moyen_de_la_semaine"],"sensor.daikin_cycle_ml_cop_today":["cop_today","daikin_cycle_ml_cop_vandaag","daikin_cycle_ml_cop_chauffage_du_jour"],"sensor.daikin_cycle_ml_current_cycle":["current_cycle","daikin_cycle_ml_huidige_cyclus","daikin_cycle_ml_cycle_en_cours"],"sensor.daikin_cycle_ml_cycle_state":["cycle_state","daikin_cycle_ml_cyclus_status","daikin_cycle_ml_etat_du_cycle"],"sensor.daikin_cycle_ml_heating_curve_advice":["heating_curve_advice","daikin_cycle_ml_stooklijn_advies","daikin_cycle_ml_conseil_de_loi_d_eau"],"sensor.daikin_cycle_ml_hp_specs":["hp_specs","daikin_cycle_ml_wp_specs","daikin_cycle_ml_caracteristiques_de_la_pac"],"sensor.daikin_cycle_ml_last_cycle":["last_cycle","daikin_cycle_ml_laatste_cyclus","daikin_cycle_ml_dernier_cycle"],"sensor.daikin_cycle_ml_thermal_power_live":["thermal_power_live","daikin_cycle_ml_thermisch_vermogen_live","daikin_cycle_ml_puissance_thermique_instantanee"]}; var _dcmC = {}; var _dcmR = function(id){ if (_dcmC[id]) return _dcmC[id]; var r = id, a = _dcmA[id], st = (typeof states !== 'undefined' && states) ? states : {}; if (!st[id] && a) { var dom = id.split('.')[0], i, k, ents = (typeof hass !== 'undefined' && hass && hass.entities) ? hass.entities : null; if (ents) { for (k in ents) { var e = ents[k]; if (e && e.platform === 'daikin_cycle_ml' && e.translation_key === a[0] && k.indexOf(dom + '.') === 0 && st[k]) { r = k; break; } } } if (r === id) { for (i = 1; i < a.length; i++) { if (st[dom + '.' + a[i]]) { r = dom + '.' + a[i]; break; } } } } _dcmC[id] = r; return r; }; /* ============ helpers ============ */ var st = function(s,d){ if(d===undefined)d=0; var x=states[s]; if(!x||!x.state)return d; if(x.state==='unknown'||x.state==='unavailable'||x.state==='')return d; var v=parseFloat(x.state); return isNaN(v)?d:v; }; var stv = function(s){ var x=states[s]; if(!x||!x.state)return null; if(x.state==='unknown'||x.state==='unavailable'||x.state==='')return null; var v=parseFloat(x.state); return isNaN(v)?null:v; }; var hasV = function(v){ return v!==null && v!==undefined && v!=='' && String(v)!=='None'; }; var v1 = function(v){ if(!hasV(v)||isNaN(parseFloat(v)))return '—'; return Number(v).toFixed(1).replace('.', _DEC); }; var v2 = function(v){ if(!hasV(v)||isNaN(parseFloat(v)))return '—'; return Number(v).toFixed(2).replace('.', _DEC); }; var tr = function(s,m){ if(!hasV(s)) return '—'; var t=String(s); return t.length>m ? t.slice(0,m-1)+'…' : t; }; var attr = function(id,n,d){ try{ var a=states[id] && states[id].attributes; if(!a)return d; var v=a[n]; if(v===undefined||v===null||String(v)==='None')return d; return v; } catch(e){ return d; } }; var aN = function(id,n,d){ var v=attr(id,n,null); if(v===null)return d; var x=parseFloat(v); return isNaN(x)?d:x; }; var aB = function(id,n,d){ var v=attr(id,n,d); if(typeof v==='boolean')return v; var s=String(v).toLowerCase(); if(s==='true'||s==='on'||s==='1')return true; if(s==='false'||s==='off'||s==='0')return false; return d; }; /* R202: bucket_for_outdoor() emit keys: -10-, -10--8...18-20, 20+, unknown -10- pattern MUST be tested BEFORE range and integer patterns. */ var parseBucket = function(k){ if(!k) return null; var s=String(k).trim(); var m = s.match(/^(-?\d+)-$/); if(m) return { lo: -999, hi: parseFloat(m[1]), c: parseFloat(m[1])-1, key: k }; m = s.match(/^(-?\d+)\s*\+$/); if(m) return { lo: parseFloat(m[1]), hi: parseFloat(m[1])+4, c: parseFloat(m[1])+2, key: k }; m = s.match(/^(-?\d+)\s*-\s*(-?\d+)$/); if(m) return { lo: parseFloat(m[1]), hi: parseFloat(m[2]), c: (parseFloat(m[1])+parseFloat(m[2]))/2, key: k }; m = s.match(/^(-?\d+)$/); if(m) return { lo: parseFloat(m[1]), hi: parseFloat(m[1])+2, c: parseFloat(m[1])+1, key: k }; return null; }; var parseTs = function(v){ if(!hasV(v)) return null; if(typeof v === 'number') return v; var s = String(v); var d = new Date(s); if(!isNaN(d.getTime())) return d.getTime()/1000; var n = parseFloat(s); if(!isNaN(n) && n > 1e8) return n; return null; }; var nowHourFn = function(){ var d = new Date(); return d.getHours() + d.getMinutes()/60; }; /* ============ i18n ============ */ var STR = { nl: { defrost:'❄ DEFROST', heatingOff:'VERWARMING OFF', buhAssist:'⚠ BUH HULP', maxLwt:'MAX LWT', minLwt:'MIN LWT', xAxis:'BUITENTEMPERATUUR (°C)', yAxis:'LWT AANVOER (°C)', specRangeLwt:'LWT', specOutdoor:'buiten', specNomCop:'nominale COP', specDefrost:'defrost <', specBuh:'BUH >', specHeatOff:'verwarming OFF >', specRegression:'📈 Regressie', specInsufficient:'onvoldoende buckets', specSamples:'samples', specBuckets:'buckets', specInBucket:'in bucket', specTrend:'📊 historisch', specTrendUp:'24u vs 7d', specState:'status', specCfg:'🔍 auto-detectie', adv:{ keep:'behouden', lower_lwt:'LWT omlaag', raise_lwt:'LWT omhoog', no_data:'geen data', unknown:'onbekend' }, modeHeating:'VERWARMING', modeDhw:'DHW', modeCooling:'KOELING', modeCycles:'cycli', modeAvg:'gem', modeLast:'laatste', carnotTitle:'CARNOT REND.', carnotActual:'act', carnotMax:'max', balanceTitle:'WARMTEBALANS', balanceDemand:'vraag', balanceSupply:'levering', defrostTitle:'DEFROST IMPACT', defrostEvts:'events', defrostLost:'min', tileLwtNow:'LWT NU', tileLwtOpt:'LWT OPT', tileSavings:'BESPARING', tileTrend:'COP TREND' }, en: { defrost:'❄ DEFROST', heatingOff:'HEATING OFF', buhAssist:'⚠ BUH ASSIST', maxLwt:'MAX LWT', minLwt:'MIN LWT', xAxis:'OUTDOOR TEMPERATURE (°C)', yAxis:'SUPPLY LWT (°C)', specRangeLwt:'LWT', specOutdoor:'outdoor', specNomCop:'nominal COP', specDefrost:'defrost <', specBuh:'BUH >', specHeatOff:'heating OFF >', specRegression:'📈 Regression', specInsufficient:'insufficient buckets', specSamples:'samples', specBuckets:'buckets', specInBucket:'in bucket', specTrend:'📊 historical', specTrendUp:'24h vs 7d', specState:'state', specCfg:'🔍 auto-discovery', adv:{ keep:'keep', lower_lwt:'lower LWT', raise_lwt:'raise LWT', no_data:'no data', unknown:'unknown' }, modeHeating:'HEATING', modeDhw:'DHW', modeCooling:'COOLING', modeCycles:'cycles', modeAvg:'avg', modeLast:'last', carnotTitle:'CARNOT EFF.', carnotActual:'act', carnotMax:'max', balanceTitle:'HEAT BALANCE', balanceDemand:'demand', balanceSupply:'supply', defrostTitle:'DEFROST IMPACT', defrostEvts:'events', defrostLost:'min', tileLwtNow:'LWT NOW', tileLwtOpt:'LWT OPT', tileSavings:'SAVINGS', tileTrend:'COP TREND' } }; /* FR-I18N (azsono03) */ var FRM={" cycles in IDEAL zone":" cycles dans la zone IDÉALE"," cycles in PENDULUM zone":" cycles dans la zone TROP COURTE"," cycles over ":" cycles sur ","24h vs 7d":"24 h / 7 j","30d":"30 j","365d":"365 j","Last 7d":"7 derniers jours","SHORT 20-60m":"COURT 20-60 min","GOOD 60-180m":"BON 60-180 min","LONG >180m":"LONG >180 min","40-70 mid":"40-70 moyen","<40 low":"<40 faible","ACTION REQUIRED":"ACTION REQUISE","ATTENTION":"ATTENTION","AVG DURATION":"DURÉE MOY.","Average quality ":"Qualité moyenne ","Average quality low (":"Qualité moyenne faible (","Avg duration":"Durée moy.","Avg off":"Arrêt moy.","Avg quality":"Qualité moy.","Avg ratio":"Taux moy.","Avg/day":"Moy./jour","BUH":"Appoint","BUH >":"Appoint >","Band":"Plage","Best day":"Meilleur jour","Boiler COP":"COP chaudière","Bucket":"Tranche","CARNOT EFF.":"RENDEMENT CARNOT","COMPRESSOR":"COMPRESSEUR","COOLING":"RAFRAÎCHISSEMENT","COP":"COP","COP TODAY":"COP DU JOUR","COP TREND":"TENDANCE COP","COP above datasheet reference":"COP au-dessus de la fiche technique","CYCLES PER DAY":"CYCLES PAR JOUR","CYCLES/DAY":"CYCLES/JOUR","Comfort":"Confort","Compressor off":"Compresseur arrêté","Contribution":"Part","Cool":"Froid","Cooling":"Rafraîchissement","Cycles":"Cycles","Cycles per day":"Cycles par jour","DEFROST":"DÉGIVRAGE","DEFROST IMPACT":"EFFET DES DÉGIVRAGES","DHW":"ECS","DURATION/DAY":"DURÉE/JOUR","Days":"Jours","Defrost":"Dégivrage","Duration":"Durée","Duration per day":"Durée par jour","Duty":"Taux de marche","ELEC":"ÉLEC","ELECTRICAL":"ÉLECTRIQUE","EMITTER":"RADIATEURS","ENERGY TODAY":"ÉNERGIE DU JOUR","Elapsed":"Écoulé","Energy":"Énergie","Event counts per day":"Événements par jour","Event ratio per day":"Taux d'événements par jour","Good days":"Bons jours","Good ratio":"Taux de bons cycles","HEAT BALANCE":"BILAN DE CHALEUR","HEAT PUMP":"PAC","HEATING":"CHAUFFAGE","HEATING OFF":"CHAUFFAGE COUPÉ","HP → EMITTER":"PAC → RADIATEURS","Heat":"Chauffage","Heating":"Chauffage","IDLE":"À L'ARRÊT","IN":"ENTRÉE","INFO":"INFO","Insufficient data":"Pas assez de données","LWT":"Départ","LWT NOW":"DÉPART ACTUEL","LWT OPT":"DÉPART OPTIMAL","Last defrost":"Dernier dégivrage","Last: ":"Dernier : ","Live cycle · COP · quality · alerts":"Cycle en direct · COP · qualité · alertes","Longest":"Le plus long","Longest day":"Jour le plus long","Low days":"Jours faibles","MAX LWT":"DÉPART MAX","MIN LWT":"DÉPART MIN","MODES":"MODES","Max day":"Jour max","Mid days":"Jours moyens","Mode":"Mode","Month":"Mois","No COP data":"Pas de COP","No data":"Pas de données","OUT":"SORTIE","OUTDOOR TEMPERATURE (°C)":"TEMPÉRATURE EXTÉRIEURE (°C)","Outdoor":"Extérieur","PENDULUM <20m":"TROP COURT <20 min","Phase":"Phase","Power":"Puissance","QUALITY":"QUALITÉ","Quality":"Qualité","Quality dropping (":"Qualité en baisse (","Quality per day":"Qualité par jour","Quality rising (+":"Qualité en hausse (+","RPS":"tr/s","RUNNING":"EN MARCHE","Range":"Plage","Reliability":"Fiabilité","Runs":"Cycles","Runtime":"Durée de marche","SAVINGS":"ÉCONOMIE","SPF SEASON":"SPF SAISON","STANDBY":"EN ATTENTE","SUPPLY LWT (°C)":"DÉPART D'EAU (°C)","Samples":"Échantillons","Savings":"Économie","Share":"Part","Short runs":"Cycles courts","Since midnight":"Depuis minuit","Source":"Source","Span":"Période","Starts":"Démarrages","Starts today":"Démarrages du jour","State":"État","Step":"Pas","Sum":"Somme","System performing normally":"Le système fonctionne normalement","THERM":"CHALEUR","THERMAL":"CHALEUR","THERMAL SPLIT":"RÉPARTITION DE LA CHALEUR","Today":"Aujourd'hui","Total":"Total","Total BUH":"Appoint total","Total defrost":"Dégivrage total","Total runtime":"Marche totale","Trends":"Tendances","VS DATASHEET":"VS FICHE TECHNIQUE","WEEK TREND":"TENDANCE SEMAINE","Week":"Semaine","Worst day":"Pire jour","Y-axis max":"Échelle max","Year":"Année","act":"act.","active":"active","ago":"plus tôt","avg":"moy.","buckets":"tranches","cycles":"cycles","datasheet":"fiche technique","day":"jour","defrost <":"dégivrage <","demand":"demande","duration":"durée","events":"événements","heating OFF >":"chauffage coupé >","high":"élevé","in bucket":"dans la tranche","insufficient buckets":"pas assez de tranches","last":"dernier","low":"faible","max":"max","min":"min","month":"mois","more":"de plus","nominal":"normal","nominal COP":"COP nominal","of cycles":"des cycles","outdoor":"extérieur","per day":"par jour","samples":"échantillons","state":"état","supply":"départ","today":"aujourd'hui","total":"total","week":"semaine","Ø duration":"Ø durée","Ø/cycle":"Ø/cycle","← 💧 RETURN":"← 💧 RETOUR","≥70 good":"≥70 bon","⏮️ Last cycle":"⏮️ Dernier cycle","⏱️ DURATION":"⏱️ DURÉE","♻️ Hydraulic circuit":"♻️ Circuit hydraulique","⚠ BUH ASSIST":"⚠ APPOINT","⚡ BUH":"⚡ Appoint","⚡ EVENTS":"⚡ ÉVÉNEMENTS","✅ System OK — no active warnings":"✅ Système OK — aucune alerte active","❄ DEFROST":"❄ DÉGIVRAGE","❄ Defrost":"❄ Dégivrage","⭐ QUALITY":"⭐ QUALITÉ","🎯 COP":"🎯 COP","🎯 COP Efficiency":"🎯 Efficacité COP","🎯 Cycles vs Duration":"🎯 Cycles / durée","🎯 SCATTER":"🎯 NUAGE","💡 COP = efficiency · ~ref = approximate datasheet comparison (A7/W35) · duration/cycle trends per day":"💡 COP = efficacité · ~réf = comparaison approximative avec la fiche (A7/W35) · tendances durée/cycles par jour","💡 Cycle = continuous compressor run · <15m = inefficient cycling · >48h = safety limit":"💡 Cycle = marche continue du compresseur · <15 min = cycles trop courts · >48 h = limite de sécurité","💡 Duration = total compressor runtime per day · split per mode · ⚠ = clipped":"💡 Durée = marche totale du compresseur par jour · par mode · ⚠ = tronqué","💡 Higher COP = better · Q = quality 0-100 · Alerts on top = action":"💡 COP élevé = mieux · Q = qualité 0-100 · Alertes en haut = à traiter","💡 Ratio = events per cycle × 100 · green = nominal (15%) · red = elevated (35%)":"💡 Taux = événements par cycle × 100 · vert = normal (15 %) · rouge = élevé (35 %)","💡 Tap a bar for details — buckets by avg cycle duration per mode":"💡 Toucher une barre pour le détail — tranches par durée moyenne de cycle et par mode","💡 Tap a dot for details — X: cycles/day · Y: avg duration · color: quality":"💡 Toucher un point pour le détail — X : cycles/jour · Y : durée moy. · couleur : qualité","💡 Tap a dot or stat for day details":"💡 Toucher un point ou une valeur pour le détail du jour","💡 Tap an item for details":"💡 Toucher un élément pour le détail","📅 Today":"📅 Aujourd'hui","📈 Heating curve advice":"📈 Conseil de loi d'eau","📈 Regression":"📈 Régression","📊 Cycle duration distribution":"📊 Répartition des durées de cycle","📊 DISTRIBUTION":"📊 RÉPARTITION","📊 OVERVIEW":"📊 VUE D'ENSEMBLE","📊 historical":"📊 historique","🔄 CYCLES":"🔄 CYCLES","🔍 auto-discovery":"🔍 détection auto","🔥 SUPPLY →":"🔥 DÉPART →"," below datasheet":" sous la fiche technique"," well above target":" bien au-dessus de l'objectif","% week":" % / semaine","BUH active":"Appoint en marche","COP dropping ":"COP en baisse ","COP heating ":"COP chauffage ","COP low":"COP bas","DHW cycling":"Cycles d'eau chaude","High cycle rate":"Fréquence de cycles élevée","Missing attributes":"Valeurs manquantes","Pendulum/day":"Cycles trop fréquents/jour","Pendulum/hour":"Cycles trop fréquents/heure","Previous: BUH":"Précédent : appoint","Previous: defrost":"Précédent : dégivrage","SPF ":"SPF ","Setpoint oscillation":"Consigne instable","Short off-time":"Arrêt court","Short run":"Marche courte","Source stale":"Source muette","Too many cycles (target ":"Trop de cycles (objectif ","Update available":"Mise à jour disponible","is_stale flag":"Source en retard"}; var FR=function(x){ return (LANG==='fr' && typeof x==='string' && Object.prototype.hasOwnProperty.call(FRM,x)) ? FRM[x] : x; }; var FRO=function(o){ if(typeof o==='string') return Object.prototype.hasOwnProperty.call(FRM,o)?FRM[o]:o; if(o&&typeof o==='object'){ var r=Array.isArray(o)?[]:{}; for(var k in o){ r[k]=FRO(o[k]); } return r; } return o; }; STR.fr = FRO(STR.en); STR.fr.adv = { keep:'garder', lower_lwt:'baisser le départ', raise_lwt:'monter le départ', no_data:'pas de données', unknown:'inconnu' }; var t = function(k){ return (STR[LANG] && STR[LANG][k]) || (STR.en && STR.en[k]) || k; }; /* ============ AUTO-DISCOVERY ============ */ var S_STATE = _dcmR('sensor.daikin_cycle_ml_cycle_state'); var cfgLang = String(attr(S_STATE,'configured_language','en')).toLowerCase(); var LANG = DCM.lang; /* #427: shared language rule */ var cfgModel = String(attr(S_STATE,'configured_model','')).toLowerCase(); var cfgSource = attr(S_STATE,'configured_source_sensor',null); var cfgPower = attr(S_STATE,'configured_power_sensor',null); var cfgCop = attr(S_STATE,'configured_cop_sensor',null); var cfgInd = attr(S_STATE,'configured_indoor_sensor',null); /* ============ data ============ */ var S_STOOK = _dcmR('sensor.daikin_cycle_ml_heating_curve_advice'); var S_CURVE = _dcmR('sensor.daikin_cycle_ml_cop_curve_recent'); var S_LAST = _dcmR('sensor.daikin_cycle_ml_last_cycle'); var S_CUR = _dcmR('sensor.daikin_cycle_ml_current_cycle'); var S_THERM = _dcmR('sensor.daikin_cycle_ml_thermal_power_live'); var S_COPTODAY = _dcmR('sensor.daikin_cycle_ml_cop_today'); var stookBuckets = attr(S_STOOK,'buckets',{}); /* R200: state is not an attribute — read from states[id].state */ var stookState = (states[S_STOOK] && states[S_STOOK].state) ? String(states[S_STOOK].state) : 'unknown'; var stookLwtNow = aN(S_STOOK,'huidige_lwt',null); var stookLwtOpt = aN(S_STOOK,'optimale_lwt',null); /* R203: samples = n of CURRENT bucket only — never used as totalSamples */ var stookBucketSamples = aN(S_STOOK,'samples',0); var stookBucketKey = String(attr(S_STOOK,'bucket','')) || ''; var curvePts = attr(S_CURVE,'points',[]); if (!Array.isArray(curvePts)) curvePts = []; var byMode = { heating: [], dhw: [], cooling: [] }; for (var ci=0; ci 0) { trendPct = ((copDay - copWeek) / copWeek) * 100; trendDir = Math.abs(trendPct) < 2 ? 'flat' : (trendPct > 0 ? 'up' : 'down'); } /* R201: current_cycle has no outdoor_temp — use last_cycle directly */ var liveOut = aN(S_LAST,'outdoor_temp',null); var liveKw = stv(S_THERM); var lastDur = aN(S_LAST,'duration_min',null); var lastBuhFlag = aB(S_LAST,'buh_used',false); var lastDefrFlag = aB(S_LAST,'defrost_used',false); var lastStartTs = parseTs(attr(S_LAST,'start_ts',null)); var compOn = false, buhOn = false, defrOn = false; try { var bcomp = states[_dcmR('binary_sensor.daikin_cycle_ml_compressor_running')]; compOn = bcomp && String(bcomp.state).toLowerCase()==='on'; var bbuh = states[_dcmR('binary_sensor.daikin_cycle_ml_buh_active')]; buhOn = bbuh && String(bbuh.state).toLowerCase()==='on'; var bdef = states[_dcmR('binary_sensor.daikin_cycle_ml_defrost_active')]; defrOn = bdef && String(bdef.state).toLowerCase()==='on'; } catch(e){} /* ============ MODEL LOOKUP ============ */ var HP_SPECS = { 'epra04': { kw: 4, lwtMin: 25, lwtMax: 55, nomCop: 4.6, family: 'Monoblock', ref: 'R32' }, 'epra06': { kw: 6, lwtMin: 25, lwtMax: 55, nomCop: 4.5, family: 'Monoblock', ref: 'R32' }, 'epra08': { kw: 8, lwtMin: 25, lwtMax: 55, nomCop: 4.4, family: 'Monoblock', ref: 'R32' }, 'epra11': { kw: 11, lwtMin: 25, lwtMax: 60, nomCop: 4.3, family: 'Monoblock', ref: 'R32' }, 'epra12': { kw: 12, lwtMin: 25, lwtMax: 60, nomCop: 4.2, family: 'Monoblock', ref: 'R32' }, 'epra14': { kw: 14, lwtMin: 25, lwtMax: 65, nomCop: 4.1, family: 'Monoblock', ref: 'R32' }, 'epra16': { kw: 16, lwtMin: 25, lwtMax: 65, nomCop: 4.0, family: 'Monoblock', ref: 'R32' }, 'erla04': { kw: 4, lwtMin: 25, lwtMax: 55, nomCop: 4.8, family: 'Split', ref: 'R32' }, 'erla06': { kw: 6, lwtMin: 25, lwtMax: 55, nomCop: 4.7, family: 'Split', ref: 'R32' }, 'erla08': { kw: 8, lwtMin: 25, lwtMax: 55, nomCop: 4.5, family: 'Split', ref: 'R32' }, 'erla11': { kw: 11, lwtMin: 25, lwtMax: 60, nomCop: 4.4, family: 'Split', ref: 'R32' }, 'erla12': { kw: 12, lwtMin: 25, lwtMax: 60, nomCop: 4.3, family: 'Split', ref: 'R32' }, 'erla14': { kw: 14, lwtMin: 25, lwtMax: 65, nomCop: 4.2, family: 'Split', ref: 'R32' }, 'erla16': { kw: 16, lwtMin: 25, lwtMax: 65, nomCop: 4.1, family: 'Split', ref: 'R32' } }; var S_SPECS = _dcmR('sensor.daikin_cycle_ml_hp_specs'); var hpIsConfigured = aB(S_SPECS, 'configured', false); var hp; if (hpIsConfigured) { hp = { kw: aN(S_SPECS, 'kw', 12), lwtMin: aN(S_SPECS, 'lwt_min', 25), lwtMax: aN(S_SPECS, 'lwt_max', 60), nomCop: aN(S_SPECS, 'nom_cop', 4.2), family: String(attr(S_SPECS, 'family', 'Generic')), ref: String(attr(S_SPECS, 'refrigerant', 'R32')), outMin: aN(S_SPECS, 'outdoor_min_c', -25), outMax: aN(S_SPECS, 'outdoor_max_c', 35), defrostBelow: aN(S_SPECS, 'defrost_below_c', 5), buhAbove: aN(S_SPECS, 'buh_above_c', 55), offAbove: aN(S_SPECS, 'off_above_c', 20) }; } else { var hpKey = cfgModel.substring(0,6); hp = HP_SPECS[hpKey] || { kw: 12, lwtMin: 25, lwtMax: 60, nomCop: 4.2, family: 'Generic', ref: 'R32' }; hp.outMin = -25; hp.outMax = 35; hp.defrostBelow = 5; hp.buhAbove = hp.lwtMax - 5; hp.offAbove = 20; } /* ============ Buckets → regressie ============ */ var pts = []; Object.keys(stookBuckets || {}).forEach(function(k){ var p = parseBucket(k); if(!p) return; var b = stookBuckets[k] || {}; var lwt = parseFloat(b.lwt); var cop = parseFloat(b.cop); var n = parseInt(b.n,10); if(isNaN(lwt)) return; pts.push({ x: p.c, y: lwt, cop: isNaN(cop)?0:cop, n: isNaN(n)?0:n, key: k }); }); pts.sort(function(a,b){ return a.x - b.x; }); /* R203: totalSamples = sum of ALL bucket samples; never overwritten */ var totalSamples = pts.reduce(function(a,p){ return a + p.n; }, 0); var slope = null, inter = null; if (pts.length >= 2) { var N=pts.length, Sx=0, Sy=0, Sxy=0, Sxx=0; for (var i=0; i= 2) { for (var ai=0; ai 0) runAvgPts.push({ x: pts[ai].x, y: sum/wsum }); } } /* ============ DIAGNOSTICS CALC ============ */ var carnotCOP = null, effPct = null; if (stookLwtNow !== null && liveOut !== null) { var tHot = stookLwtNow + 5 + 273.15; var tCold = liveOut - 8 + 273.15; var dTk = tHot - tCold; if (dTk > 0) { carnotCOP = tHot / dTk; if (actualCOP !== null && carnotCOP > 0) { effPct = Math.max(0, Math.min(100, (actualCOP / carnotCOP) * 100)); } } } var inFlow = aN(S_THERM, 'input_flow_lmin', null); var inDT = aN(S_THERM, 'input_dt_k', null); var inPw = aN(S_THERM, 'input_power_w', null); var inCop = aN(S_THERM, 'input_cop', null); var balDemand = null, balSupply = null, balNet = null; if (inFlow !== null && inDT !== null && inFlow > 0 && inDT > 0) { balDemand = (inFlow * inDT * 4.18) / 60; } if (inPw !== null && inCop !== null && inCop > 0) { balSupply = (inPw * inCop) / 1000; } if (balDemand !== null && balSupply !== null) { balNet = balSupply - balDemand; } var defEvtCount = 0, defMinLost = 0, defPct = null; if (lastDefrFlag) { defEvtCount++; defMinLost += 5; } if (defrOn) { defEvtCount++; defMinLost += 3; } if (defMinLost > 0 && lastDur !== null && lastDur > 0) { defPct = (defMinLost / lastDur) * 100; } /* ============ DYNAMIC MODE LAYOUT ============ */ var allModes = [ { key:'heating', col:'#E60012', label:t('modeHeating'), pts: byMode.heating }, { key:'dhw', col:'#F5A623', label:t('modeDhw'), pts: byMode.dhw }, { key:'cooling', col:'#3498DB', label:t('modeCooling'), pts: byMode.cooling } ]; var activeModes = allModes.filter(function(m){ return m.pts.length > 0; }); var nActive = activeModes.length; var showModeSection = nActive > 0; /* ============ AUTO ZOOM ============ */ var Xmin = -20, Xmax = 22; if (pts.length >= 2) { var bxMin = Math.min.apply(null, pts.map(function(p){return p.x;})); var bxMax = Math.max.apply(null, pts.map(function(p){return p.x;})); Xmin = Math.max(-22, Math.min(-15, Math.floor((bxMin - 4)/5)*5)); Xmax = Math.min(35, Math.max(15, Math.ceil((bxMax + 4)/5)*5)); } else if (liveOut !== null) { Xmin = Math.max(-22, Math.floor((liveOut - 10)/5)*5); Xmax = Math.min(35, Math.ceil((liveOut + 10)/5)*5); } var Ymin = Math.floor((hp.lwtMin - 5) / 5) * 5; var Ymax = Math.ceil((hp.lwtMax + 5) / 5) * 5; if (liveOut !== null && stookLwtNow !== null) { Ymin = Math.min(Ymin, Math.floor((stookLwtNow - 5) / 5) * 5); Ymax = Math.max(Ymax, Math.ceil((stookLwtNow + 5) / 5) * 5); } /* ============ SVG LAYOUT ============ */ var W = 620; var X0 = 92, Y0 = 30, Wp = 500, Hp = 320; /* #431: less empty space above the plot */ var X1 = X0 + Wp, Y1 = Y0 + Hp; var axLabY = Y1 + 42; var stripY = axLabY + 14; var stripH = 36; var diagY = stripY + stripH + 10; var diagH = 62; var mbY = diagY + diagH + 10; var mbH = 68; var spY; if (showModeSection) spY = mbY + mbH + 16; else spY = diagY + diagH + 16; var specH = 118; var H = spY + specH + 16; var xS = function(t){ return X0 + ((Math.max(Xmin,Math.min(Xmax,t))-Xmin)/(Xmax-Xmin))*Wp; }; var yS = function(t){ return Y1 - ((Math.max(Ymin,Math.min(Ymax,t))-Ymin)/(Ymax-Ymin))*Hp; }; var tX = function(h){ return X0 + (Math.max(0,Math.min(24,h))/24)*Wp; }; var DK_BLUE = '#0097E0'; var DK_BLUE_DK = '#003366'; var DK_BLUE_MD = '#00539F'; var DK_RED = '#E60012'; var famCol = hp.family === 'Split' ? '#E67E22' : DK_RED; var famColDk = hp.family === 'Split' ? '#7d4f00' : '#7a0008'; var txtHalo = 'paint-order="stroke fill" stroke="white" stroke-width="2.5" stroke-opacity="0.85" stroke-linejoin="round"'; var heatColor = function(cop) { var t2 = Math.max(0, Math.min(1, (cop - 1.5) / 3.5)); var r,g,b; if (t2 < 0.5) { var u=t2/0.5; r=Math.round(230+15*u); g=Math.round(0+166*u); b=Math.round(18+17*u); } else { var u2=(t2-0.5)/0.5; r=Math.round(245-169*u2); g=Math.round(166+9*u2); b=Math.round(35+45*u2); } return 'rgb('+r+','+g+','+b+')'; }; /* ============ SVG ============ */ var s = ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; /* HEATMAP */ var cols = 25, rows = 13; var cw = Wp / cols, chh = Hp / rows; s += ''; for (var rr=0; rr'; } } s += ''; /* ZONES */ if (Xmax > hp.offAbove){ var offX0 = xS(hp.offAbove), offX1 = xS(Xmax); s += ''; if (offX1-offX0 > 50) s += ''+t('heatingOff')+''; } if (Xmax > 12 && Xmin < hp.offAbove){ var wX0 = xS(Math.max(Xmin,12)), wX1 = xS(Math.min(Xmax,hp.offAbove)); if (wX1 > wX0) s += ''; } if (Xmin < hp.defrostBelow){ var dX0 = xS(Xmin), dX1 = xS(Math.min(Xmax, hp.defrostBelow)); s += ''; s += ''; if (dX1-dX0 > 70) s += ''+t('defrost')+''; } /* GRID */ var xStep = (Xmax-Xmin) > 30 ? 5 : 2; for (var vx=Xmin; vx<=Xmax; vx+=xStep) s+=''; for (var vy=Ymin; vy<=Ymax; vy+=5) s+=''; /* ============ LIMITS ============ */ var lwtMaxY = yS(hp.lwtMax); s += ''; var maxLbl = t('maxLwt')+' '+hp.lwtMax+'°'; var maxW = Math.max(96, maxLbl.length*6); s += ''; s += ''+maxLbl+''; var lwtMinY = yS(hp.lwtMin); s += ''; var minLbl = t('minLwt')+' '+hp.lwtMin+'°'; var minW = Math.max(96, minLbl.length*6); s += ''; s += ''+minLbl+''; if (hp.buhAbove < Ymax){ var bY = yS(hp.buhAbove); s += ''; var buhLbl = t('buhAssist')+' '+hp.buhAbove+'°C'; var buhW = Math.max(140, buhLbl.length*6); s += ''; s += ''+buhLbl+''; } /* AXES */ s += ''; s += ''; for (var xt=Xmin; xt<=Xmax; xt+=xStep){ s += ''; s += ''+xt+'°'; } for (var yt=Ymin; yt<=Ymax; yt+=5){ s += ''; s += ''+yt+'°'; } s += ''+t('xAxis')+''; s += ''+t('yAxis')+''; /* REGRESSION CURVE */ if (slope !== null) { var pathCurve = ''; for (var tv=Xmin; tv<=Xmax; tv+=0.5){ var lwtVal = inter + slope*tv; if (lwtVal < hp.lwtMin) lwtVal = hp.lwtMin; if (lwtVal > hp.lwtMax) lwtVal = hp.lwtMax; pathCurve += (pathCurve === '' ? 'M' : ' L') + xS(tv) + ',' + yS(lwtVal); } s += ''; s += ''; s += ''; } /* RUNNING AVERAGE OVERLAY */ if (runAvgPts.length >= 2) { var raPath = ''; for (var rai=0; rai'; } /* BUCKETS */ var hcL3 = function(nl, en, fr){ return LANG==='nl' ? nl : (LANG==='fr' ? fr : en); }; var pops = ''; for (var bi=0; bi= 4 ? '#4CAF50' : p.cop >= 2.5 ? '#F5A623' : DK_RED; var delay = (bi * 0.12).toFixed(2); /* #427: points only (no halo bubbles); tap a point for its pop-up */ s += ''; s += ''; s += '' + ''+p.key+'°C · COP '+v2(p.cop)+' · LWT '+v1(p.y)+'° · n '+p.n+''; s += ''; var isCur = (p.key === stookBucketKey); var row = function(k, v, c){ return '
'+k+''+v+'
'; }; pops += ''; } /* LIVE DOT */ if (liveOut !== null && stookLwtNow !== null) { var lx = xS(liveOut), ly = yS(stookLwtNow); /* #427: the live point blinks */ s += '' + ''; var callW = 100, callH = 42; var obstacles = []; for (var oi=0; oi X1 - 6) { clamped += (cx2 + callW) - (X1 - 6); cx2 = X1 - callW - 6; } if (cx2 < X0 + 6) { clamped += (X0 + 6) - cx2; cx2 = X0 + 6; } if (cy2 + callH > Y1 - 6) { clamped += (cy2 + callH) - (Y1 - 6); cy2 = Y1 - callH - 6; } if (cy2 < Y0 + 6) { clamped += (Y0 + 6) - cy2; cy2 = Y0 + 6; } var rect = { x1: cx2, y1: cy2, x2: cx2 + callW, y2: cy2 + callH }; var score = 0; for (var oi2 = 0; oi2 < obstacles.length; oi2++){ score += overlapArea(rect, obstacles[oi2]) * 3; } var midX2 = cx2 + callW/2, midY2 = cy2 + callH/2; var dist2 = Math.sqrt((midX2-lx)*(midX2-lx) + (midY2-ly)*(midY2-ly)); score += dist2 * 0.3; score += clamped * 100; if (ci2 < 4) score -= 150; if (score < bestScore) { bestScore = score; best = { x: cx2, y: cy2 }; } } var callX = best.x, callY = best.y; var cMidX = callX + callW/2; var cMidY = callY + callH/2; var dist = Math.sqrt((cMidX-lx)*(cMidX-lx) + (cMidY-ly)*(cMidY-ly)); if (dist > 50) { s += ''; } s += ''; s += ''; s += ''+v1(liveOut)+'° OUT'; s += ''+v1(stookLwtNow)+'° LWT'; if (liveKw !== null && liveKw > 0) s += ''+v2(liveKw)+' kW'; s += ''; } /* BUH/DEFROST TIMELINE STRIP */ var buhLaneY = stripY + 4; var defLaneY = stripY + 18; var rulerY = stripY + 34; var nowH = nowHourFn(); s += ''; s += ''; s += '⚡BUH'; s += '❄️DEF'; for (var tH=0; tH<=24; tH+=6){ s += ''; s += ''+tH+'h'; } if (lastStartTs !== null){ var evH = new Date(lastStartTs * 1000).getHours() + new Date(lastStartTs * 1000).getMinutes()/60; if (lastBuhFlag){ s += ''; } if (lastDefrFlag){ s += ''; } } s += ''; if (buhOn){ s += ''; } if (defrOn){ s += ''; } /* DIAGNOSTICS PANEL */ var carnotCol = '#7D3C98'; var balCol = '#16A085'; var defCol = '#2E86C1'; var diagColW = Wp / 3; var c1x = X0; s += ''; s += ''+t('carnotTitle')+''; if (effPct !== null && carnotCOP !== null) { s += ''+Math.round(effPct)+'%'; var barW = diagColW - 24, barX = c1x + 12, barY = diagY + 40, barH = 5; s += ''; s += ''; s += ''+t('carnotActual')+' '+(actualCOP===null?'—':v2(actualCOP))+' · '+t('carnotMax')+' '+carnotCOP.toFixed(1)+''; } else { s += '—'; } var c2x = X0 + diagColW; s += ''; s += ''+t('balanceTitle')+''; if (balNet !== null) { var balSign = balNet >= 0 ? '+' : ''; var balColor = Math.abs(balNet) < 0.3 ? '#4CAF50' : (Math.abs(balNet) < 1 ? '#F5A623' : DK_RED); s += ''+balSign+v2(balNet)+' kW'; s += ''+t('balanceDemand')+' '+(balDemand===null?'—':v2(balDemand))+' kW'; s += ''+t('balanceSupply')+' '+(balSupply===null?'—':v2(balSupply))+' kW'; } else { s += '—'; } var c3x = X0 + 2*diagColW; s += ''; s += ''+t('defrostTitle')+''; if (defPct !== null && defEvtCount > 0) { s += ''+v1(defPct)+'%'; var dbarW = diagColW - 24; s += ''; s += ''; s += ''+defEvtCount+' '+t('defrostEvts')+' · ~'+defMinLost+' '+t('defrostLost')+''; } else { s += '—'; } /* MODE BREAKDOWN */ if (showModeSection) { var colW = Wp / nActive; for (var mi=0; mi 0 ? mPts.reduce(function(a,p){return a+p.v;},0)/cnt : null; var last = cnt > 0 ? mPts[cnt-1].v : null; s += ''; s += ''+mm.label+''; s += ''+cnt+' '+t('modeCycles')+''; if (cnt >= 2) { var spX0 = mx + 10, spX1 = mx + colW - 10; var spY0 = mbY + 20, spY1 = mbY + 48; var vMin = Math.min.apply(null, mPts.map(function(p){return p.v;})); var vMax = Math.max.apply(null, mPts.map(function(p){return p.v;})); if (vMax - vMin < 0.5) { vMin -= 0.25; vMax += 0.25; } var tMin = mPts[0].t, tMax = mPts[cnt-1].t; if (tMax - tMin < 1) tMax = tMin + 1; var spx = function(ts){ return spX0 + ((ts-tMin)/(tMax-tMin))*(spX1-spX0); }; var spy = function(v){ return spY1 - ((v-vMin)/(vMax-vMin))*(spY1-spY0); }; var spPath = ''; for (var pi=0; pi'; for (var pj=0; pj'; } } else { var onlyV = mPts[0].v; s += ''+v2(onlyV)+''; } s += ''+t('modeAvg')+' '+(avg===null?'—':v2(avg))+' · '+t('modeLast')+' '+(last===null?'—':v2(last))+''; } } /* SPECS BOX */ s += ''; s += '⚙ '+String(attr(S_STATE,'configured_model','—')).toUpperCase()+' · '+hp.family.toUpperCase()+' · '+hp.kw+' kW · '+hp.ref+''; s += ''+t('specRangeLwt')+' '+hp.lwtMin+'–'+hp.lwtMax+'°C · '+t('specOutdoor')+' '+hp.outMin+'…+'+hp.outMax+'°C · '+t('specNomCop')+' '+hp.nomCop.toFixed(1)+''; s += ''+t('specDefrost')+' +'+hp.defrostBelow+'°C · '+t('specBuh')+' '+hp.buhAbove+'°C · '+t('specHeatOff')+' +'+hp.offAbove+'°C'; var regTxt = slope !== null ? 'LWT = '+inter.toFixed(1)+' '+(slope<0?'− ':'+ ')+Math.abs(slope).toFixed(2)+' × '+(LANG==='nl'?'T_buiten':(LANG==='fr'?'T_ext':'T_out')) : t('specInsufficient'); /* R203: totalSamples = ALL buckets; show current-bucket sample count separately */ var samplesLine = t('specSamples')+': '+totalSamples; if (stookBucketSamples > 0 && stookBucketKey) { samplesLine += ' ('+stookBucketSamples+' '+t('specInBucket')+' '+stookBucketKey+'°C)'; } s += ''+t('specRegression')+': '+regTxt+' · '+samplesLine+' · '+t('specBuckets')+': '+pts.length+''; var trendTxt = '—'; var trendCol = '#7f8c8d'; if (trendPct !== null) { var arrow = trendDir === 'up' ? '▲' : (trendDir === 'down' ? '▼' : '▬'); trendCol = trendDir === 'up' ? '#4CAF50' : (trendDir === 'down' ? DK_RED : '#7f8c8d'); trendTxt = arrow + ' ' + (trendPct>0?'+':'') + trendPct.toFixed(1) + '% ('+t('specTrendUp')+')'; } s += ''+t('specTrend')+': '+trendTxt+''; s += ''+t('specState')+': '+((t('adv')||{})[stookState.replace(/_\d+c$/, '')] || stookState)+''; var cfgLine = t('specCfg')+': '+tr(cfgSource,22)+' · '+tr(cfgPower,22)+' · '+tr(cfgCop,22)+' · '+tr(cfgInd,22); s += ''+cfgLine+''; s += ''; /* #427: point pop-ups. pointerup, not click: button-card calls preventDefault on touchend, so a touch never produces a click */ var _hcCard = this; setTimeout(function(){ try { var root = _hcCard && _hcCard.shadowRoot; if (!root) return; var box = root.querySelector('.hc-root'); if (!box) return; var hideAll = function(){ box.querySelectorAll('.hc-pop').forEach(function(x){ x.style.display = 'none'; }); window.__hcOpen = null; if (box.__hcTimer) { clearTimeout(box.__hcTimer); box.__hcTimer = null; } }; var show = function(pid, ms){ var hit = box.querySelector('.hc-hit[data-hc-pid="'+pid+'"]'); var pop = box.querySelector('.hc-pop[data-hc-pop="'+pid+'"]'); if (!hit || !pop) return; hideAll(); pop.style.visibility = 'hidden'; pop.style.display = 'block'; var br = box.getBoundingClientRect(), hr = hit.getBoundingClientRect(); var pw = pop.offsetWidth || 170, ph = pop.offsetHeight || 90; var cx = hr.left - br.left + hr.width / 2, cy = hr.top - br.top; var left = Math.max(6, Math.min(cx - pw / 2, br.width - pw - 6)); var top = cy - ph - 8; if (top < 6) top = cy + hr.height + 8; pop.style.left = left + 'px'; pop.style.top = top + 'px'; pop.style.visibility = 'visible'; var left_ms = ms || 6000; window.__hcOpen = { pid: pid, until: Date.now() + left_ms }; box.__hcTimer = setTimeout(hideAll, left_ms); }; if (!box.__hcBound) { box.__hcBound = true; var down = null; box.addEventListener('pointerdown', function(ev){ down = { x: ev.clientX, y: ev.clientY, id: ev.pointerId }; }); box.addEventListener('pointerup', function(ev){ if (!down || down.id !== ev.pointerId) return; var moved = Math.abs(ev.clientX - down.x) + Math.abs(ev.clientY - down.y); down = null; if (moved > 12) return; var t0 = ev.target && ev.target.closest ? ev.target : null; if (!t0) return; if (t0.closest('.hc-pop')) { hideAll(); return; } var hit = t0.closest('.hc-hit'); if (hit) show(hit.getAttribute('data-hc-pid')); else hideAll(); }); } /* a pop-up that was open before this re-render stays open */ var o = window.__hcOpen; if (o && o.until > Date.now()) show(o.pid, Math.max(500, o.until - Date.now())); } catch (e) {} }, 0); return '
' + s + pops + '
'; }).call(this)); ]]] - type: custom:button-card variables: *dcm show_name: false show_icon: false styles: grid: - grid-template-areas: '"content"' - grid-template-columns: 1fr card: - background: none - box-shadow: none - border: none - padding: 10px 12px 12px 12px custom_fields: content: | [[[ /* DCM-COMMON-BEGIN (#427) shared by every Daikin Cycle ML card: language, theme, header. Do not edit in a card: edit tools/card_common.js and run tools/sync_card_common.py */ var DCM = (function () { var V = (typeof variables !== 'undefined' && variables) ? variables : {}; var H = (typeof hass !== 'undefined' && hass) ? hass : {}; var S = (typeof states !== 'undefined' && states) ? states : {}; var find = function (tk, sfx) { var ids = Object.keys(S), i, j, k, E = H.entities || {}; for (i = 0; i < ids.length; i++) { if (ids[i].indexOf('sensor.') !== 0) continue; for (j = 0; j < sfx.length; j++) { if (ids[i].slice(-sfx[j].length - 1) === '_' + sfx[j]) return ids[i]; } } for (k in E) { if (E[k] && E[k].platform === 'daikin_cycle_ml' && E[k].translation_key === tk && S[k]) return k; } return null; }; var A = function (id) { return (id && S[id] && S[id].attributes) ? S[id].attributes : {}; }; var csA = A(find('cycle_state', ['cycle_state', 'cyclus_status', 'etat_du_cycle'])); var spA = A(find('hp_specs', ['hp_specs', 'wp_specs', 'caracteristiques_de_la_pac'])); /* language: lang_override, then the HA language, then the integration language, then English */ var LS = ['en', 'nl', 'fr']; var ov = String(V.lang_override || '').toLowerCase(); var ha = String(H.language || '').toLowerCase().slice(0, 2); var cl = String(csA.configured_language || '').toLowerCase(); var lang = LS.indexOf(ov) >= 0 ? ov : (LS.indexOf(ha) >= 0 ? ha : (LS.indexOf(cl) >= 0 ? cl : 'en')); /* theme: auto follows the HA dark mode; light / dark force it */ var th = String(V.theme_override || 'auto').toLowerCase(); var dark = th === 'dark' ? true : (th === 'light' ? false : !!(H.themes && H.themes.darkMode)); var P = dark ? { bg: '#1B1F24', bg2: '#232A33', bg3: '#1E3448', hd1: '#1E3448', hd2: '#15283A', text: '#E6F0FA', text2: '#90CAF9', muted: '#B0BEC5', border: 'rgba(79,195,247,0.35)', accent: '#4FC3F7', good: '#66BB6A', warn: '#FFA726', bad: '#EF5350' } : { bg: '#FFFFFF', bg2: '#F5FAFD', bg3: '#E3F2FD', hd1: '#E3F2FD', hd2: '#BBDEFB', text: '#0D47A1', text2: '#1565C0', muted: '#546E7A', border: 'rgba(0,151,224,0.25)', accent: '#0097E0', good: '#2E7D32', warn: '#E65100', bad: '#C62828' }; /* light colours of the cards -> dark mode (light backgrounds dark, dark text light) */ var MAP = { '#FFFFFF': P.bg, '#F5FAFD': P.bg2, '#F5FAFE': P.bg2, '#E6F4FB': P.bg2, '#E8F2FB': P.bg2, '#EAF2F8': P.bg2, '#E3F2FD': P.bg3, '#D6ECF7': P.bg3, '#DCEBFA': P.bg3, '#BBDEFB': '#1F4A6B', '#D6EAF8': P.bg3, '#E1F5FE': P.bg3, '#AED6F1': '#1F4A6B', '#FFF3E0': '#3A2A12', '#FFF8EC': '#3A2A12', '#FDEAD0': '#3A2A12', '#FFEBEE': '#3A1D1D', '#FDECEA': '#3A1D1D', '#FBD0C8': '#3A1D1D', '#E8F5E9': '#1C3324', '#EAFAF1': '#1C3324', '#D5F5E3': '#1C3324', '#F3E5F5': '#2E2236', '#0D47A1': P.text, '#003366': P.text, '#001B3D': P.text, '#003A70': P.text, '#00539F': '#BBDEFB', '#005A9C': '#BBDEFB', '#1565C0': P.text2, '#1976D2': '#64B5F6', '#546E7A': P.muted, '#5D6D7E': P.muted, '#7F8C8D': '#9EADB5', '#95A5A6': '#9EADB5', '#37474F': '#CFD8DC', '#444444': '#CFD8DC', '#000000': '#ECEFF1', '#94A3B8': '#78909C', '#6A1B9A': '#CE93D8', '#2E7D32': '#4CAF50', '#1E8449': '#81C784', '#C62828': '#E53935', '#E65100': '#FB8C00', '#7D4F00': '#FFCC80', '#8B1A1A': '#EF9A9A', '#7A0008': '#EF9A9A' }; var paint = function (html) { if (!dark || typeof html !== 'string') return html; return html .replace(/(background(?:-color)?\s*:\s*)(#fff\b|white\b)/gi, '$1' + P.bg) .replace(/(<(?:rect|circle|ellipse|path)\b[^>]*?\sfill=")(white|#fff|#ffffff)(")/gi, '$1' + P.bg2 + '$3') .replace(/rgba\(\s*255\s*,\s*255\s*,\s*255\s*,\s*([0-9.]+)\s*\)/g, function (m, a) { return 'rgba(255,255,255,' + Math.min(0.08, parseFloat(a) * 0.1).toFixed(3) + ')'; }) .replace(/#[0-9a-fA-F]{6}\b/g, function (m) { return MAP[m.toUpperCase()] || m; }); }; var T3 = function (o) { return (o && typeof o === 'object') ? (o[lang] || o.en || '') : String(o || ''); }; var model = spA.model ? String(spA.model).toUpperCase() : ''; var meta = [spA.family, spA.kw ? spA.kw + ' kW' : '', spA.refrigerant].filter(function (x) { return x && String(x) !== 'None'; }).join(' · '); /* one header for every card: icon, title + model, subtitle + family / kW / refrigerant */ var header = function (icon, title, sub) { return '
' + '
' + icon + '
' + '
' + '
' + T3(title) + (model ? ' · ' + model : '') + '
' + '
' + T3(sub) + (meta ? ' · ' + meta : '') + '
' + '
'; }; return { lang: lang, dark: dark, P: P, paint: paint, header: header, T3: T3, V: V, model: model, showHelp: V.show_help !== false && V.show_hints !== false }; })(); /* DCM-COMMON-END */ return DCM.paint((function () { var _DEC = (function(){ try { var _lc = (typeof hass !== 'undefined' && hass && hass.locale) ? hass.locale : {}; var _nf = _lc.number_format; if (_nf === 'comma_decimal' || _nf === 'none') return '.'; if (_nf === 'decimal_comma' || _nf === 'space_comma') return ','; var _l = String(_lc.language || (typeof hass !== 'undefined' && hass && hass.language) || 'en'); return (1.5).toLocaleString(_l).indexOf(',') >= 0 ? ',' : '.'; } catch (e) { return '.'; } })(); /* #427: decimal separator from the HA number format */ /* #347 entity resolver (EN id -> [translation_key, nl, fr]) */ var _dcmA = {"sensor.daikin_cycle_ml_cop_mean_day":["cop_mean_day","daikin_cycle_ml_cop_gemiddelde_dag","daikin_cycle_ml_cop_moyen_du_jour"],"sensor.daikin_cycle_ml_cop_mean_week":["cop_mean_week","daikin_cycle_ml_cop_gemiddelde_week","daikin_cycle_ml_cop_moyen_de_la_semaine"],"sensor.daikin_cycle_ml_cycle_state":["cycle_state","daikin_cycle_ml_cyclus_status","daikin_cycle_ml_etat_du_cycle"],"sensor.daikin_cycle_ml_heating_curve_advice":["heating_curve_advice","daikin_cycle_ml_stooklijn_advies","daikin_cycle_ml_conseil_de_loi_d_eau"]}; var _dcmC = {}; var _dcmR = function(id){ if (_dcmC[id]) return _dcmC[id]; var r = id, a = _dcmA[id], st = (typeof states !== 'undefined' && states) ? states : {}; if (!st[id] && a) { var dom = id.split('.')[0], i, k, ents = (typeof hass !== 'undefined' && hass && hass.entities) ? hass.entities : null; if (ents) { for (k in ents) { var e = ents[k]; if (e && e.platform === 'daikin_cycle_ml' && e.translation_key === a[0] && k.indexOf(dom + '.') === 0 && st[k]) { r = k; break; } } } if (r === id) { for (i = 1; i < a.length; i++) { if (st[dom + '.' + a[i]]) { r = dom + '.' + a[i]; break; } } } } _dcmC[id] = r; return r; }; var st = function(s,d){ if(d===undefined)d=0; var x=states[s]; if(!x||!x.state)return d; if(x.state==='unknown'||x.state==='unavailable'||x.state==='')return d; var v=parseFloat(x.state); return isNaN(v)?d:v; }; var hasV = function(v){ return v!==null && v!==undefined && v!=='' && String(v)!=='None'; }; var v1 = function(v){ if(!hasV(v)||isNaN(parseFloat(v)))return '—'; return Number(v).toFixed(1).replace('.', _DEC); }; var attr = function(id,n,d){ try{ var a=states[id] && states[id].attributes; if(!a)return d; var v=a[n]; if(v===undefined||v===null||String(v)==='None')return d; return v; } catch(e){ return d; } }; var aN = function(id,n,d){ var v=attr(id,n,null); if(v===null)return d; var x=parseFloat(v); return isNaN(x)?d:x; }; var DK_BLUE = '#0097E0'; var DK_BLUE_DK = '#003366'; var S_STATE = _dcmR('sensor.daikin_cycle_ml_cycle_state'); var cfgLang = String(attr(S_STATE,'configured_language','en')).toLowerCase(); var LANG = DCM.lang; /* #427: shared language rule */ var T = { nl: { lwtNow:'LWT NU', lwtOpt:'LWT OPT', sav:'BESPARING', trend:'COP TREND' }, en: { lwtNow:'LWT NOW', lwtOpt:'LWT OPT', sav:'SAVINGS', trend:'COP TREND' } }; /* FR-I18N (azsono03) */ var FRM={" cycles in IDEAL zone":" cycles dans la zone IDÉALE"," cycles in PENDULUM zone":" cycles dans la zone TROP COURTE"," cycles over ":" cycles sur ","24h vs 7d":"24 h / 7 j","30d":"30 j","365d":"365 j","Last 7d":"7 derniers jours","SHORT 20-60m":"COURT 20-60 min","GOOD 60-180m":"BON 60-180 min","LONG >180m":"LONG >180 min","40-70 mid":"40-70 moyen","<40 low":"<40 faible","ACTION REQUIRED":"ACTION REQUISE","ATTENTION":"ATTENTION","AVG DURATION":"DURÉE MOY.","Average quality ":"Qualité moyenne ","Average quality low (":"Qualité moyenne faible (","Avg duration":"Durée moy.","Avg off":"Arrêt moy.","Avg quality":"Qualité moy.","Avg ratio":"Taux moy.","Avg/day":"Moy./jour","BUH":"Appoint","BUH >":"Appoint >","Band":"Plage","Best day":"Meilleur jour","Boiler COP":"COP chaudière","Bucket":"Tranche","CARNOT EFF.":"RENDEMENT CARNOT","COMPRESSOR":"COMPRESSEUR","COOLING":"RAFRAÎCHISSEMENT","COP":"COP","COP TODAY":"COP DU JOUR","COP TREND":"TENDANCE COP","COP above datasheet reference":"COP au-dessus de la fiche technique","CYCLES PER DAY":"CYCLES PAR JOUR","CYCLES/DAY":"CYCLES/JOUR","Comfort":"Confort","Compressor off":"Compresseur arrêté","Contribution":"Part","Cool":"Froid","Cooling":"Rafraîchissement","Cycles":"Cycles","Cycles per day":"Cycles par jour","DEFROST":"DÉGIVRAGE","DEFROST IMPACT":"EFFET DES DÉGIVRAGES","DHW":"ECS","DURATION/DAY":"DURÉE/JOUR","Days":"Jours","Defrost":"Dégivrage","Duration":"Durée","Duration per day":"Durée par jour","Duty":"Taux de marche","ELEC":"ÉLEC","ELECTRICAL":"ÉLECTRIQUE","EMITTER":"RADIATEURS","ENERGY TODAY":"ÉNERGIE DU JOUR","Elapsed":"Écoulé","Energy":"Énergie","Event counts per day":"Événements par jour","Event ratio per day":"Taux d'événements par jour","Good days":"Bons jours","Good ratio":"Taux de bons cycles","HEAT BALANCE":"BILAN DE CHALEUR","HEAT PUMP":"PAC","HEATING":"CHAUFFAGE","HEATING OFF":"CHAUFFAGE COUPÉ","HP → EMITTER":"PAC → RADIATEURS","Heat":"Chauffage","Heating":"Chauffage","IDLE":"À L'ARRÊT","IN":"ENTRÉE","INFO":"INFO","Insufficient data":"Pas assez de données","LWT":"Départ","LWT NOW":"DÉPART ACTUEL","LWT OPT":"DÉPART OPTIMAL","Last defrost":"Dernier dégivrage","Last: ":"Dernier : ","Live cycle · COP · quality · alerts":"Cycle en direct · COP · qualité · alertes","Longest":"Le plus long","Longest day":"Jour le plus long","Low days":"Jours faibles","MAX LWT":"DÉPART MAX","MIN LWT":"DÉPART MIN","MODES":"MODES","Max day":"Jour max","Mid days":"Jours moyens","Mode":"Mode","Month":"Mois","No COP data":"Pas de COP","No data":"Pas de données","OUT":"SORTIE","OUTDOOR TEMPERATURE (°C)":"TEMPÉRATURE EXTÉRIEURE (°C)","Outdoor":"Extérieur","PENDULUM <20m":"TROP COURT <20 min","Phase":"Phase","Power":"Puissance","QUALITY":"QUALITÉ","Quality":"Qualité","Quality dropping (":"Qualité en baisse (","Quality per day":"Qualité par jour","Quality rising (+":"Qualité en hausse (+","RPS":"tr/s","RUNNING":"EN MARCHE","Range":"Plage","Reliability":"Fiabilité","Runs":"Cycles","Runtime":"Durée de marche","SAVINGS":"ÉCONOMIE","SPF SEASON":"SPF SAISON","STANDBY":"EN ATTENTE","SUPPLY LWT (°C)":"DÉPART D'EAU (°C)","Samples":"Échantillons","Savings":"Économie","Share":"Part","Short runs":"Cycles courts","Since midnight":"Depuis minuit","Source":"Source","Span":"Période","Starts":"Démarrages","Starts today":"Démarrages du jour","State":"État","Step":"Pas","Sum":"Somme","System performing normally":"Le système fonctionne normalement","THERM":"CHALEUR","THERMAL":"CHALEUR","THERMAL SPLIT":"RÉPARTITION DE LA CHALEUR","Today":"Aujourd'hui","Total":"Total","Total BUH":"Appoint total","Total defrost":"Dégivrage total","Total runtime":"Marche totale","Trends":"Tendances","VS DATASHEET":"VS FICHE TECHNIQUE","WEEK TREND":"TENDANCE SEMAINE","Week":"Semaine","Worst day":"Pire jour","Y-axis max":"Échelle max","Year":"Année","act":"act.","active":"active","ago":"plus tôt","avg":"moy.","buckets":"tranches","cycles":"cycles","datasheet":"fiche technique","day":"jour","defrost <":"dégivrage <","demand":"demande","duration":"durée","events":"événements","heating OFF >":"chauffage coupé >","high":"élevé","in bucket":"dans la tranche","insufficient buckets":"pas assez de tranches","last":"dernier","low":"faible","max":"max","min":"min","month":"mois","more":"de plus","nominal":"normal","nominal COP":"COP nominal","of cycles":"des cycles","outdoor":"extérieur","per day":"par jour","samples":"échantillons","state":"état","supply":"départ","today":"aujourd'hui","total":"total","week":"semaine","Ø duration":"Ø durée","Ø/cycle":"Ø/cycle","← 💧 RETURN":"← 💧 RETOUR","≥70 good":"≥70 bon","⏮️ Last cycle":"⏮️ Dernier cycle","⏱️ DURATION":"⏱️ DURÉE","♻️ Hydraulic circuit":"♻️ Circuit hydraulique","⚠ BUH ASSIST":"⚠ APPOINT","⚡ BUH":"⚡ Appoint","⚡ EVENTS":"⚡ ÉVÉNEMENTS","✅ System OK — no active warnings":"✅ Système OK — aucune alerte active","❄ DEFROST":"❄ DÉGIVRAGE","❄ Defrost":"❄ Dégivrage","⭐ QUALITY":"⭐ QUALITÉ","🎯 COP":"🎯 COP","🎯 COP Efficiency":"🎯 Efficacité COP","🎯 Cycles vs Duration":"🎯 Cycles / durée","🎯 SCATTER":"🎯 NUAGE","💡 COP = efficiency · ~ref = approximate datasheet comparison (A7/W35) · duration/cycle trends per day":"💡 COP = efficacité · ~réf = comparaison approximative avec la fiche (A7/W35) · tendances durée/cycles par jour","💡 Cycle = continuous compressor run · <15m = inefficient cycling · >48h = safety limit":"💡 Cycle = marche continue du compresseur · <15 min = cycles trop courts · >48 h = limite de sécurité","💡 Duration = total compressor runtime per day · split per mode · ⚠ = clipped":"💡 Durée = marche totale du compresseur par jour · par mode · ⚠ = tronqué","💡 Higher COP = better · Q = quality 0-100 · Alerts on top = action":"💡 COP élevé = mieux · Q = qualité 0-100 · Alertes en haut = à traiter","💡 Ratio = events per cycle × 100 · green = nominal (15%) · red = elevated (35%)":"💡 Taux = événements par cycle × 100 · vert = normal (15 %) · rouge = élevé (35 %)","💡 Tap a bar for details — buckets by avg cycle duration per mode":"💡 Toucher une barre pour le détail — tranches par durée moyenne de cycle et par mode","💡 Tap a dot for details — X: cycles/day · Y: avg duration · color: quality":"💡 Toucher un point pour le détail — X : cycles/jour · Y : durée moy. · couleur : qualité","💡 Tap a dot or stat for day details":"💡 Toucher un point ou une valeur pour le détail du jour","💡 Tap an item for details":"💡 Toucher un élément pour le détail","📅 Today":"📅 Aujourd'hui","📈 Heating curve advice":"📈 Conseil de loi d'eau","📈 Regression":"📈 Régression","📊 Cycle duration distribution":"📊 Répartition des durées de cycle","📊 DISTRIBUTION":"📊 RÉPARTITION","📊 OVERVIEW":"📊 VUE D'ENSEMBLE","📊 historical":"📊 historique","🔄 CYCLES":"🔄 CYCLES","🔍 auto-discovery":"🔍 détection auto","🔥 SUPPLY →":"🔥 DÉPART →"," below datasheet":" sous la fiche technique"," well above target":" bien au-dessus de l'objectif","% week":" % / semaine","BUH active":"Appoint en marche","COP dropping ":"COP en baisse ","COP heating ":"COP chauffage ","COP low":"COP bas","DHW cycling":"Cycles d'eau chaude","High cycle rate":"Fréquence de cycles élevée","Missing attributes":"Valeurs manquantes","Pendulum/day":"Cycles trop fréquents/jour","Pendulum/hour":"Cycles trop fréquents/heure","Previous: BUH":"Précédent : appoint","Previous: defrost":"Précédent : dégivrage","SPF ":"SPF ","Setpoint oscillation":"Consigne instable","Short off-time":"Arrêt court","Short run":"Marche courte","Source stale":"Source muette","Too many cycles (target ":"Trop de cycles (objectif ","Update available":"Mise à jour disponible","is_stale flag":"Source en retard"}; var FR=function(x){ return (LANG==='fr' && typeof x==='string' && Object.prototype.hasOwnProperty.call(FRM,x)) ? FRM[x] : x; }; var FRO=function(o){ if(typeof o==='string') return Object.prototype.hasOwnProperty.call(FRM,o)?FRM[o]:o; if(o&&typeof o==='object'){ var r=Array.isArray(o)?[]:{}; for(var k in o){ r[k]=FRO(o[k]); } return r; } return o; }; T.fr = FRO(T.en); var t = function(k){ return (T[LANG] && T[LANG][k]) || (T.en && T.en[k]) || k; }; var S = _dcmR('sensor.daikin_cycle_ml_heating_curve_advice'); var sav = aN(S,'besparing_cop_pct',null); var opt = aN(S,'optimale_lwt',null); var now = aN(S,'huidige_lwt',null); var copDay = st(_dcmR('sensor.daikin_cycle_ml_cop_mean_day'), null); var copWeek = st(_dcmR('sensor.daikin_cycle_ml_cop_mean_week'), null); var trendTxt = '—', trendCol = '#7f8c8d'; if (copDay !== null && copWeek !== null && copWeek > 0) { var d = ((copDay - copWeek) / copWeek) * 100; if (Math.abs(d) < 2) { trendTxt = '▬ ' + v1(copDay) + ' / ' + v1(copWeek); trendCol = '#7f8c8d'; } else if (d > 0) { trendTxt = '▲ +' + d.toFixed(1) + '%'; trendCol = '#4CAF50'; } else { trendTxt = '▼ ' + d.toFixed(1) + '%'; trendCol = '#E60012'; } } else if (copDay !== null) { trendTxt = '● ' + v1(copDay); trendCol = DK_BLUE; } var r = ''; r += '
'; /* #431: never wider than the card */ var tile = function(icon,label,val,col){ return '
' +'' +'
'+label+'
' +'
'+val+'
' +'
'; }; r += tile('mdi:thermometer-chevron-down', t('lwtNow'), (now===null?'—':v1(now)+'°'), '#E60012'); r += tile('mdi:target', t('lwtOpt'), (opt===null?'—':v1(opt)+'°'), '#4CAF50'); r += tile('mdi:percent', t('sav'), (sav===null?'—':(sav>0?'+':'')+v1(sav)+'%'), (sav&&sav>0?'#4CAF50':'#7f8c8d')); r += tile('mdi:trending-up', t('trend'), trendTxt, trendCol); r += '
'; return r; }).call(this)); ]]]