document.addEventListener('DOMContentLoaded',()=>{ const q=new URLSearchParams(location.search); document.documentElement.dataset.theme='dark'; const view=q.get('view')||'dashboard'; document.querySelectorAll('.view').forEach(v=>v.classList.toggle('active',v.dataset.view===view)); if(view==='dashboard'){ document.querySelector('#summaryText').textContent='3 urządzenia online · 2 aktywne termostaty'; document.querySelector('#metrics').innerHTML='Online 3/3Aktywne 2'; document.querySelector('#heroTemperature').innerHTML='21.4°C'; document.querySelector('#houseClimate').innerHTML='

Tryb domu

Wspólne ustawienia dla stref.

Na zewnątrz 12.8°C
'; document.querySelector('#controlPlan').innerHTML='

Salon

Utrzymuj 21.5°C do 22:30

Aktywne

Sypialnia

Tryb nocny od 22:30

za 2h
'; } if(view==='simulation'){ document.querySelector('#simulationTarget').innerHTML=''; document.querySelector('#simulationSummary').innerHTML='
Tryb domuGrzanieStrategia: temperatura zadana
Tryb nocnyWyłączony22:00 → 06:00
Na zewnątrz12.8°CAktualizacja 08:30
Aktywne strefy21 strefa zgłasza zapotrzebowanie
'; const board=document.querySelector('#simulationFlowBoard'); board.style.width='1325px'; board.style.height='390px'; board.innerHTML='
SalonGREE Salon
Temperatura

Salon

20.8°C

Home Assistant

Termostat

Salon

21.5°C

Komfort

Decyzja

Grzanie

Potrzeba ciepła

Poniżej celu

Polecenie

GREE Salon

22.0°C · Auto

Quiet: wył.

'; document.querySelector('#simulationTimeline').innerHTML='
Salon

Komfort · 21.5°C · GREE Salon

Cały dom

Tryb nocny

Sypialnia

Komfort · 20.5°C · GREE Sypialnia

'; document.querySelector('#simulationRules').innerHTML='
Automatyzacja

Otwarte okno

Stan

Urządzenie: GREE Salon

Wyłącz termostat, gdy okno pozostaje otwarte.
Ostatnio: 07:12Gotowa: teraz
Automatyzacja

Tani prąd

Próg

Urządzenie: GREE Sypialnia

Podnieś temperaturę docelową o 0.5°C.
Ostatnio: wczorajGotowa: teraz
'; } if(view==='flows'){ document.querySelector('#flowListCount').textContent='3 flow'; document.querySelector('#flowList').innerHTML=`

Okno w salonie

Wyłącza grzanie, gdy okno jest otwarte.

Bloki5
Harmonogramy0
Automatyzacje1

Tani prąd

Podbija temperaturę przy niskiej cenie energii.

Bloki7
Harmonogramy1
Automatyzacje2
`; } if(q.get('editor')==='1'){ document.querySelector('#flowEditor').hidden=false; document.body.classList.add('flow-editor-open'); document.querySelector('#flowName').hidden=true; document.querySelector('#flowNameView').hidden=false; document.querySelector('#flowNameText').textContent='Okno w salonie'; document.querySelector('#flowCompileStatus').textContent='0 harm. · 1 autom.'; document.querySelector('#flowSaveStatus').textContent='Zapisano'; document.querySelector('#flowInterpretation').textContent='Jeśli okno w salonie jest otwarte przez 30 s, wyłącz termostat Salon.'; document.querySelector('#flowRuntimeSummary').textContent='Ostatnie wykonanie: 07:12 · wynik: prawda'; document.querySelector('#flowEmptyHint').style.display='none'; document.querySelector('#flowNodes').innerHTML=`
Wspólne wejście
Okno w salonie
Terazotwarte
Utrzymuje się przez…
30 sekund
Termostat
Salon · wyłącz
`; document.querySelector('#flowInspector').classList.add('has-selection'); document.querySelector('#flowInspector').innerHTML='
Ustawienia bloku

Wspólne wejście

Czujnik używany tylko we Flow. Nie jest zapisywany do metryk.

'; } });