//@liv-in-sky Januar 2021 Ver 17.01-13:45 //HIER WIRD PFAD UND FILENAME DEFINIERT const path = "/htmlsonoff.html"; //FIlenamen definieren const home ='vis.0' //wo soll das file im iobroker-file-system liegen ? (oder z.b auch iqontrol.meta) let braucheEinFile=false; // bei true wird ein file geschrieben let braucheEinVISWidget=true; // bei true wird ein html-tabelle in einen dp geschrieben - siehe nächste zeile let dpVIS="controll-own.0.TABELLEN.SONOFF" //WICHTIG wenn braucheEinVISWidget auf true gesetzt !! dp zusätzlich für VIS-HTML-Basic-Widget let dpAnzahl="controll-own.0.TABELLEN.AnzahlSonoff"; //WICHTIG datenpunkt erstellen vom typ "number" - bei 0 kein alarm und größer 0 die anzahl der schlechten batterien let htmlColorDeviceUeberschrift="white" // Farbe der Geräte Marken let HTMLbrandSetting="b" // style der geräte marken: möglich b fett; i kursiv; span normal let triggerBySonoffPower=true; // --- hier einstellen, was man für ein device hat - die nicht gebraucht werden auf false setzen !!! var pow=true; var generic=true; var genericMitDiv=true; // anzeige mit DIVersen Sensoren var th10=false; var basic=true; var basicMitTemp=true; // anzeige mit DIVersen Sensoren var mini=false; var externalMitInfo=false; //noch nicht integriert var externalOhneInfo=false; //noch nicht integriert var schalter2ch=true; var schalter3ch=false; var dual=false; var schalter1ch=false; var delock=false; var channel4=true; //Sonoff 4CH var rfbridge=true; var stdoseS2X=true; var teckin=false; var sv=true; var blitzwolf_shp=false; //SHP9 ist in 3ch, SHP7 ist in 2ch integriert var sonoffDev=true; var gosundSP1x=true; var shelly=true; var twoNice=false; var ohneInfo=true; // bei manchen fehlt der INFO ordner - diese werden hier erfasst //Sonderfall var linganSteckdose =true; const mitSchalter=true; // für freigabe von schaltern für POWER const mitYesterday=true; // Für anzeige der yestersay werte bei energie-aufzeichnenden geräten (poe, blitzwolf, teckin, ..) const mitLink=true; // link zum sonoff-web-interface const farbeNichtConnected="lightblue"; const styleNichtErreichbar="i"; // möglich i=schräg, b ist fett und span ist normal - nur eines davon !!! const farbeSchalterON="lightblue" // farbe des schalters für ON const farbeSchalterOFF="grey" // farbe des schalters für OFF var symbolOK="⚪"; // auch möglich: ="✅"} var symbolKO="⭕"; //z.b. auch "X" für ein rotes kreuz ❌" ⚪ ⚫ ⭕ 🔴 🔵 ⏱ 💀 👍 👎 📑 💲 👀 var symbolWARN="⚠️"; // ="⚠️" var symbolSwitch="🔄" var symbolLink="🌎"; let mySchedule=" * * * * * "; //HIER DIE SPALTEN ANZAHL DEFINIEREN - jede Spalte einen Wert - in diesem Beispiel sind es 5 var htmlFeld1='Device'; var Feld1lAlign="left"; // überschrift Tabellen Spalte1 und Ausrichtung left,right or center var htmlFeld2='Status'; var Feld2lAlign="center"; // überschrift Tabellen Spalte2 und Ausrichtung left,right or center var htmlFeld3='Version'; var Feld3lAlign="center"; var htmlFeld4='WLAN'; var Feld4lAlign="right"; // usw.. var htmlFeld5='IP'; var Feld5lAlign="left"; var htmlFeld6=''; var Feld6lAlign="center"; var htmlFeld7=''; var Feld7lAlign="center"; var htmlFeld8=''; var Feld8lAlign="center"; // -------------- //hier werden die styles für die tabelle definiert //ÜBERSCHRIFT ÜBER TABELLE let htmlUberschrift=true; // mit Überschrift über der tabelle let htmlSignature=true; // anstatt der Überscghrift eine signature: - kleiner - anliegend const htmlFeldUeber='Sonoff Devices'; // Überschrift und Signature const htmlFarbUber="white"; // Farbe der Überschrift const htmlSchriftWeite="normal"; // bold, normal - Fettschrift für Überschrift const htmlÜberFontGroesse="18px"; // schriftgröße überschrift //MEHRERE TABELLEN NEBENEINANDER let mehrfachTabelle=1; // bis zu 4 Tabellen werden nebeneinander geschrieben- verkürzt das Ganze, dafür etwas breiter - MÖGLICH 1,2,3,oder 4 !!! const trennungsLinie="2"; //extra trennungslinie bei mehrfachtabellen - evtl auf 0 stellen, wnn htmlRahmenLinien auf none sind const farbetrennungsLinie="white"; const htmlFarbZweiteTabelle="white"; // Farbe der Überschrift bei jeder 2.ten Tabelle const htmlFarbTableColorUber="lightblue"; // Überschrift in der tabelle - der einzelnen Spalten //ÜBERSCHRIFT SPALTEN const UeberSchriftHöhe="35"; //Überschrift bekommt mehr Raum - darunter und darüber - Zellenhöhe const LinieUnterUeberschrift="2"; // Linie nur unter Spaltenüberschrift - const farbeLinieUnterUeberschrift="lightblue"; const groesseUeberschrift=16; const UeberschriftStyle="normal" // möglich "bold" //GANZE TABELLE let abstandZelle="1"; let farbeUngeradeZeilen="#000000"; //Farbe für ungerade Zeilenanzahl - Hintergrund der Spaltenüberschrift bleibt bei htmlFarbTableColorGradient1/2 let farbeGeradeZeilen="#151515"; //Farbe für gerade Zeilenanzahl - Hintergrund der Spaltenüberschrift bleibt bei htmlFarbTableColorGradient1/2 let weite="auto"; //Weite der Tabelle let zentriert=true; //ganze tabelle zentriert const backgroundAll="#000000"; //Hintergrund für die ganze Seite - für direkten aufruf oder iqontrol sichtber - keine auswirkung auf vis-widget const htmlSchriftart="RobotoCondensed-Regular" //"Helvetica"; const htmlSchriftgroesse="16px"; //FELDER UND RAHMEN let UeberschriftSpalten=true; // ein- oder ausblenden der spatlen-überschriften const htmlFarbFelderschrift="#D8D8D8"; // SchriftFarbe der Felder const htmlFarbFelderschrift2="#D8D8D8"; // SchriftFarbe der Felder für jede 2te Tabelle const htmlFarbTableColorGradient1="#1c1c1c"; // Gradient - Hintergrund der Tabelle - Verlauffarbe const htmlFarbTableColorGradient2="#1c1c1c"; // Gradient - Hintergrund der Tabelle - ist dieser Wert gleich Gradient1 gibt es keinen verlauf const htmlFarbTableBorderColor="grey"; // Farbe des Rahmen - is tdieser gleich den gradienten, sind die rahmen unsichtbar let htmlRahmenLinien="cols"; // Format für Rahmen: MÖGLICH: "none" oder "all" oder "cols" oder "rows" const htmlSpalte1Weite="auto"; // Weite der ersten beiden Spalten oder z.b. 115px // HIER NICHTS ÄNDERN let borderHelpBottum; let borderHelpRight; let htmlcenterHelp; let htmlcenterHelp2; if(htmlRahmenLinien=="rows") {borderHelpBottum=1;borderHelpRight=0;} if(htmlRahmenLinien=="cols") {borderHelpBottum=0;borderHelpRight=1;} if(htmlRahmenLinien=="none") {borderHelpBottum=0;borderHelpRight=0;} if(htmlRahmenLinien=="all") {borderHelpBottum=1;borderHelpRight=1;} zentriert ? htmlcenterHelp="auto" : htmlcenterHelp="left"; zentriert ? htmlcenterHelp2="center" : htmlcenterHelp2="left"; const htmlZentriert='
' const htmlStart= "Vorlage"+ "
"; const htmlTabStyle= ""; const htmlTabUeber1=""; const htmlTabUeber3=""; const buttonScript = '' var htmlTabUeber2=""; var htmlTabUeber2_1=""; // ------------ let triggerBySonoffSwitch=false; var anzahl; var AkkuAlarm=[]; var htmlOut=""; var mix; var counter; var arrTrigger=[]; var val1; var val2; var val0; var val3; var val4; var val5; var val6; var val7; var htmlTabUeber=""; if (mitSchalter) triggerBySonoffPower=true; function writeHTML(){ anzahl=0; htmlOut=""; counter=-1; htmlTabUeber=""; switch (mehrfachTabelle) { case 1: htmlTabUeber=htmlTabUeber1+htmlTabUeber2+htmlTabUeber3; break; case 2: htmlTabUeber=htmlTabUeber1+htmlTabUeber2+htmlTabUeber2_1+htmlTabUeber3; break; case 3: htmlTabUeber=htmlTabUeber1+htmlTabUeber2+htmlTabUeber2+htmlTabUeber2+htmlTabUeber3; break; case 4: htmlTabUeber=htmlTabUeber1+htmlTabUeber2+htmlTabUeber2_1+htmlTabUeber2+htmlTabUeber2_1+htmlTabUeber3; break; }; if (!UeberschriftSpalten) {htmlTabUeber=""} if (triggerBySonoffPower) { $('sonoff.*.*.POWER*').each(function(id, i) { arrTrigger.push(id) });} if (triggerBySonoffSwitch) { $('sonoff.*.*.Switch*').each(function(id, i) { arrTrigger.push(id) });} var myColl=[]; var val1help; var tempArr=[];var humArr=[];var illArr=[];var sw1Arr=[];var sw2Arr=[];var irArr=[];;var powArr=[];var disArr=[]; $('sonoff.*.*.*').each(function(id, i) { var ida = id.split('.'); if(ida[3].indexOf("_Temperature")>-1) tempArr.push(id); if(ida[3].indexOf("_Humidity")>-1) humArr.push(id); if(ida[3].indexOf("_Illuminance")>-1) illArr.push(id); if(ida[3].indexOf("POWER1")>-1) sw1Arr.push(id); if(ida[3].indexOf("POWER2")>-1) sw2Arr.push(id); if(ida[3].indexOf("_Distance")>-1) disArr.push(id); if(ida[3].indexOf("IrReceived_Data")>-1) irArr.push(id); if(ida[3].match(/POWER$/)!=null) powArr.push(id); }); if (pow){ counter=-1; for(var i=0;i<"+HTMLbrandSetting+">Sonoff Pow (R2)";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="kWh Gesamt"; if (mitYesterday) {val6="kWh Heute(Gestern)";} else {val6="kWh Heute";} val7="Power"; counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="Sonoff Pow" || getState(id).val=="Sonoff Pow R2") { anzahl++; var ida = id.split('.'); counter++; val1=getState(id.replace("INFO.Module","alive")).val; // val0=getState(id.replace("INFO.Module","INFO.Hostname")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; // val7 definition ichWillSchalten(id); if (mitYesterday) { var val6_1=getState(id.replace("INFO.Module","ENERGY_Yesterday")).val val6=(getState(id.replace("INFO.Module","ENERGY_Today")).val.toString())+" ("+val6_1.toString()+")";} else {val6=getState(id.replace("INFO.Module","ENERGY_Today")).val.toString();} val5=getState(id.replace("INFO.Module","ENERGY_Total")).val.toString(); inaktiv(id); tabelleBind(); } }); } //end fritzdect if (gosundSP1x){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">Gosund";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="kWh Gesamt"; if (mitYesterday) {val6="kWh Heute(Gestern)";} else {val6="kWh Heute";} val7="Power"; counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if ( getState(id).val.includes("SP111 v1.1") || getState(id).val.includes("Gosund SP211") || getState(id).val.includes("Gosund SP1") || getState(id).val.includes("Gosund SP11") || getState(id).val.includes("Gosund SP111") || getState(id).val.includes("Gosund SP111") || getState(id).val.includes("Gosund SP112") || getState(id).val.includes("Gosund_P1") ) { anzahl++; var ida = id.split('.'); counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; if (mitYesterday) { var val6_1=getState(id.replace("INFO.Module","ENERGY_Yesterday")).val val6=(getState(id.replace("INFO.Module","ENERGY_Today")).val.toString())+" ("+val6_1.toString()+")";} else {val6=getState(id.replace("INFO.Module","ENERGY_Today")).val.toString();} val5=getState(id.replace("INFO.Module","ENERGY_Total")).val.toString(); let val6helping=val6; if(getState(id).val=="Gosund SP112" || getState(id).val=="Gosund_P1" || getState(id).val=="Gosund SP211" ) { let val6_1; val6_1=getState(id.replace("INFO.Module","POWER1")).val; val6_1 ? val6=(" ")+"ON" : val6=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER1") val6_1 ? val6=" "+"ON " : val6=" "+"OFF"; } else {val6_1 ? val6=(" ")+"ON" : val7=(" ")+"OFF";} let val7_1; val7_1=getState(id.replace("INFO.Module","POWER2")).val; val7_1 ? val7=(" ")+"ON" : val7=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER2") val7_1 ? val7=" "+"ON " : val7=" "+"OFF"; } else {val7_1 ? val7=(" ")+"ON" : val7=(" ")+"OFF";} val7= val6+" "+val7 val6=val6helping; if( getState(id).val=="Gosund_P1" ) { let val11; let val12; let val6_1; val6_1=getState(id.replace("INFO.Module","POWER3")).val; val6_1 ? val11=(" ")+"ON" : val11=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER3") val6_1 ? val11=" "+"ON " : val11=" "+"OFF"; } else {val6_1 ? val11=(" ")+"ON" : val12=(" ")+"OFF";} let val7_1; val7_1=getState(id.replace("INFO.Module","POWER4")).val; val7_1 ? val12=(" ")+"ON" : val12=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER4") val7_1 ? val12=" "+"ON " : val12=" "+"OFF"; } else {val7_1 ? val12=(" ")+"ON" : val12=(" ")+"OFF";} val7=val7+" "+val11+" "+val12; } } else { // val7 definition ichWillSchalten(id);} inaktiv(id); tabelleBind(); } }); } //end fritzdect if (delock){ counter=-1; for(var i=0;i<"+HTMLbrandSetting+">Delock";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="kWh Gesamt"; if (mitYesterday) {val6="kWh Heute(Gestern)";} else {val6="kWh Heute";} val7="Power"; counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="Delock 11827" ) { anzahl++; var ida = id.split('.'); counter++; val1=getState(id.replace("INFO.Module","alive")).val; // val0=getState(id.replace("INFO.Module","INFO.Hostname")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; // val7 definition ichWillSchalten(id); if (mitYesterday) { var val6_1=getState(id.replace("INFO.Module","ENERGY_Yesterday")).val val6=(getState(id.replace("INFO.Module","ENERGY_Today")).val.toString())+" ("+val6_1.toString()+")";} else {val6=getState(id.replace("INFO.Module","ENERGY_Today")).val.toString();} val5=getState(id.replace("INFO.Module","ENERGY_Total")).val.toString(); inaktiv(id); tabelleBind(); } }); } //end fritzdect if (twoNice){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">2Nice";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="Uptime"; val6="Temp"; val7="Power"; counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="2NICE SP111") { anzahl++; var ida = id.split('.'); counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; val5=getState(id.replace("INFO.Module","Uptime")).val.toString() val6=getState(id.replace("INFO.Module","ANALOG_Temperature")).val.toString()+" °C" ichWillSchalten(id); inaktiv(id); tabelleBind(); } }); } //end if (teckin){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">Teckin";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="kWh Gesamt"; if (mitYesterday) {val6="kWh Heute(Gestern)";} else {val6="kWh Heute";} val7="Power"; counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="Teckin" || getState(id).val=="Teckin SS42") { anzahl++; var ida = id.split('.'); counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; if (mitYesterday) { var val6_1=getState(id.replace("INFO.Module","ENERGY_Yesterday")).val val6=(getState(id.replace("INFO.Module","ENERGY_Today")).val.toString())+" ("+val6_1.toString()+")";} else {val6=getState(id.replace("INFO.Module","ENERGY_Today")).val.toString();} val5=getState(id.replace("INFO.Module","ENERGY_Total")).val.toString(); let val6helping=val6; if(getState(id).val=="Teckin SS42") { let val6_1; val6_1=getState(id.replace("INFO.Module","POWER1")).val; val6_1 ? val6=(" ")+"ON" : val6=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER1") val6_1 ? val6=" "+"ON " : val6=" "+"OFF"; } else {val6_1 ? val6=(" ")+"ON" : val7=(" ")+"OFF";} let val7_1; val7_1=getState(id.replace("INFO.Module","POWER2")).val; val7_1 ? val7=(" ")+"ON" : val7=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER2") val7_1 ? val7=" "+"ON " : val7=" "+"OFF"; } else {val7_1 ? val7=(" ")+"ON" : val7=(" ")+"OFF";} val7= val6+" "+val7 val6=val6helping; } inaktiv(id); tabelleBind(); } }); } if (blitzwolf_shp){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">BlitzWolf SHP";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="kWh Gesamt"; if (mitYesterday) {val6="kWh Heute(Gestern)";} else {val6="kWh Heute";} val7="Power"; counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="BlitzWolf SHP" || getState(id).val=="BlitzWolf SHP8" || getState(id).val=="BlitzWolf SHP6" || getState(id).val=="SHP5") { anzahl++; var ida = id.split('.'); counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; if (mitYesterday) { var val6_1=getState(id.replace("INFO.Module","ENERGY_Yesterday")).val val6=(getState(id.replace("INFO.Module","ENERGY_Today")).val.toString())+" ("+val6_1.toString()+")";} else {val6=getState(id.replace("INFO.Module","ENERGY_Today")).val.toString();} val5=getState(id.replace("INFO.Module","ENERGY_Total")).val.toString(); ichWillSchalten(id); inaktiv(id); tabelleBind(); } }); } //end if (generic){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">Generic";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="Uptime";val6="Div";val7="Power";counter++;tabelleBind(); if (genericMitDiv) {val1=""; val2="";val3="";val4="";val5="Uptime";val6="Div";val7="Power"} } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="Generic") { anzahl++; var ida = id.split('.'); counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val5=getState(id.replace("INFO.Module","Uptime")).val.toString() val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; val7=" - "; var val7_1="finde" for (var i=0;i-1) {val7_1=getState(id.replace("INFO.Module","POWER")).val.toString();} } if (val7_1!="finde") ichWillSchalten(id); val6=" "; if (genericMitDiv) { var val6_1="";var val6_2=""; //--------TEMP var val6help="xxx"; for (var i=0;i-1) val6help=tempArr[i]} if (val6help != "xxx") {val6_1=getState(val6help).val+" °C"} else {val6_1=""} //---------HUM var val6help1="xxx"; for (var i=0;i-1) val6help1=humArr[i]} if (val6help1 != "xxx") {val6_2=(getState(val6help1).val)+" %"} else {val6_2=""} val6=val6_1+" / "+val6_2; if (val6 == " / ") val6=" - "; //-----------ILLuminance var val6help="xxx"; for (var i=0;i-1) val6help=illArr[i]} if (val6help != "xxx") {val6=getState(val6help).val+" lux"} //----------ILLuminance var val6_1="";var val6_2=""; //---------POWER1 var val6help="xxx"; for (var i=0;i-1) val6help=sw1Arr[i]} if (val6help != "xxx") {if (getState(val6help).val){val6_1="ON"} else {val6_1="OFF"}} //---------POWER2 var val6help1="xxx"; for (var i=0;i-1) val6help1=sw2Arr[i]} if (val6help1 != "xxx") {if (getState(val6help1).val) {val6_2="ON"} else {val6_2="OFF"} val6=val6_1+" / "+val6_2; if (val6 == " / ") val6=" - ";} //------IR EMPFANG var val6help="xxx"; for (var i=0;i-1) val6help=irArr[i]} if (val6help != "xxx") {val6=getState(val6help).val} //-----Distance var val6help="xxx"; for (var i=0;i-1) val6help=disArr[i]} if (val6help != "xxx") {val6=getState(val6help).val+" cm"} } inaktiv(id); tabelleBind(); } }); } //end if (basic){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">Basic";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="Uptime";val6="Div";val7="Power";counter++;tabelleBind(); if (genericMitDiv) {val1=""; val2="";val3="";val4="";val5="Uptime";val6="Div";val7="Power"} } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="Sonoff Basic" || getState(id).val=="SWA11") { var ida = id.split('.'); anzahl++; counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; ichWillSchalten(id) val6=" "; if (basicMitTemp) {var val6_1="";var val6_2=""; //------TEMP var val6help="xxx"; for (var i=0;i-1) val6help=tempArr[i]} if (val6help != "xxx") {val6_1=getState(val6help).val+" °C"} else {val6_1=""} // --------HUM var val6help1="xxx"; for (var i=0;i-1) val6help1=humArr[i]} if (val6help1 != "xxx") {val6_2=(getState(val6help1).val)+" %"} else {val6_2=""} val6=val6_1+" / "+val6_2; if (val6 == " / ") val6=" - "; // --------ILLuminance var val6help="xxx"; for (var i=0;i-1) val6help=illArr[i]} if (val6help != "xxx") {val6=getState(val6help).val+" lux"} // --------ILLuminance var val6_1="";var val6_2=""; // --------POWER1 var val6help="xxx"; for (var i=0;i-1) val6help=sw1Arr[i]} if (val6help != "xxx") {if (getState(val6help).val){val6_1="ON"} else {val6_1="OFF"}} // --------POWER2 var val6help1="xxx"; for (var i=0;i-1) val6help1=sw2Arr[i]} if (val6help1 != "xxx") {if (getState(val6help1).val) {val6_2="ON"} else {val6_2="OFF"} val6=val6_1+" / "+val6_2; if (val6 == " / ") val6=" - ";} // --------IR EMPFANG var val6help="xxx"; for (var i=0;i-1) val6help=irArr[i]} if (val6help != "xxx") {val6=getState(val6help).val} // --------Distance var val6help="xxx"; for (var i=0;i-1) val6help=disArr[i]} if (val6help != "xxx") {val6=getState(val6help).val+" cm"} } val5=getState(id.replace("INFO.Module","Uptime")).val.toString() inaktiv(id); tabelleBind(); } }); } //end if (mini){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">Mini";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="Uptime";val6="";val7="Power";counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="Sonoff Mini") { var ida = id.split('.'); anzahl++; counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; ichWillSchalten(id) val6="" val5=getState(id.replace("INFO.Module","Uptime")).val.toString() inaktiv(id); tabelleBind(); } }); } //end if (th10){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">TH10/TH16";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="Uptime";val6="Temp/Hum";val7="Power";counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="Sonoff TH") { var ida = id.split('.'); anzahl++; counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; ichWillSchalten(id) var val6_1="";var val6_2=""; var val6help="xxx"; for (var i=0;i-1) val6help=tempArr[i]} if (val6help != "xxx") {val6_1=getState(val6help).val+" °C"} else {val6_1=""} var val6help1="xxx"; for (var i=0;i-1) val6help1=humArr[i]} if (val6help1 != "xxx") {val6_2=(getState(val6help1).val)+" %"} else {val6_2=""} val6=val6_1+" / "+val6_2; if (val6 == "") val6=" - "; val5=getState(id.replace("INFO.Module","Uptime")).val.toString() inaktiv(id); tabelleBind(); } }); } //end if (shelly){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">Shelly";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="Uptime";val6="";val7="Power";counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="Shelly 1" || getState(id).val=="Shelly 1PM" || getState(id).val=="Shelly 2.5" || getState(id).val=="Shelly 2") { var ida = id.split('.'); anzahl++; counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; if(getState(id).val=="Shelly 2.5") { let val6_1; val6_1=getState(id.replace("INFO.Module","POWER1")).val; val6_1 ? val6=(" ")+"ON" : val6=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER1") val6_1 ? val6=" "+"ON " : val6=" "+"OFF"; } else {val6_1 ? val6=(" ")+"ON" : val7=(" ")+"OFF";} let val7_1; val7_1=getState(id.replace("INFO.Module","POWER2")).val; val7_1 ? val7=(" ")+"ON" : val7=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER2") val7_1 ? val7=" "+"ON " : val7=" "+"OFF"; } else {val7_1 ? val7=(" ")+"ON" : val7=(" ")+"OFF";} val7=val7+" "+val6; let val6_11; if (mitYesterday) { val6_11=getState(id.replace("INFO.Module","ENERGY_Yesterday")).val val6=(getState(id.replace("INFO.Module","ENERGY_Today")).val.toString())+" ("+val6_11.toString()+")";} else {val6=getState(id.replace("INFO.Module","ENERGY_Today")).val.toString();} } else { ichWillSchalten(id) val6=""} val5=getState(id.replace("INFO.Module","Uptime")).val.toString() inaktiv(id); tabelleBind(); } }); } //end if (schalter1ch){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">Schalter T1 CH";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="Uptime";val6="";val7="Power";counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="Sonoff T1 1CH" || getState(id).val=="1 Channel" ) { anzahl++; var ida = id.split('.'); counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; val5=getState(id.replace("INFO.Module","Uptime")).val.toString() ichWillSchalten(id) val6=""; inaktiv(id); tabelleBind(); } }); } //end if (schalter2ch){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">Schalter T2 CH";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="Uptime";val6="Power 1";val7="Power 2";counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="Sonoff T1 2CH" || getState(id).val=="BlitzWolf SHP7") { anzahl++; var ida = id.split('.'); counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; val5=getState(id.replace("INFO.Module","Uptime")).val.toString() let val6_1; val6_1=getState(id.replace("INFO.Module","POWER1")).val; val6_1 ? val6=(" ")+"ON" : val6=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER1") val6_1 ? val6=" "+"ON " : val6=" "+"OFF"; } else {val6_1 ? val6=(" ")+"ON" : val7=(" ")+"OFF";} let val7_1; val7_1=getState(id.replace("INFO.Module","POWER2")).val; val7_1 ? val7=(" ")+"ON" : val7=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER2") val7_1 ? val7=" "+"ON " : val7=" "+"OFF"; } else {val7_1 ? val7=(" ")+"ON" : val7=(" ")+"OFF";} inaktiv(id); tabelleBind(); } }); } //end if (schalter3ch){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">Schalter T3 CH";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="Uptime";val6="Power 1/2";val7="Power 3";counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="Sonoff 3CH" || getState(id).val=="BlitzWolf SHP9" ) { anzahl++; var ida = id.split('.'); counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; val5=getState(id.replace("INFO.Module","Uptime")).val.toString() let val5_0; let val5_1; val5_1=getState(id.replace("INFO.Module","POWER1")).val; val5_1 ? val5_0=(" ")+"ON" : val7=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER1") val5_1 ? val5_0=" "+"ON " : val5_0=" "+"OFF"; } else {val5_1 ? val5_0=(" ")+"ON" : val7=(" ")+"OFF";} let val6_1; val6_1=getState(id.replace("INFO.Module","POWER1")).val; val6_1 ? val6=(" ")+"ON" : val7=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER1") val6_1 ? val6=" "+"ON " : val6=" "+"OFF"; } else {val6_1 ? val6=(" ")+"ON" : val7=(" ")+"OFF";} ichWillSchalten(id) val6= val5_0+" "+val6; inaktiv(id); tabelleBind(); } }); } // ende ch4 if (channel4){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">Schalter 4CH";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="Uptime";val6="Power 1/2";val7="Power 3/4";counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val.includes("Sonoff 4CH") || getState(id).val.includes("Sonoff 4CH Pro") ) { anzahl++; var ida = id.split('.'); counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; val5=getState(id.replace("INFO.Module","Uptime")).val.toString() let val4_0; let val4_1; val4_1=getState(id.replace("INFO.Module","POWER1")).val; val4_1 ? val4_0=(" ")+"ON" : val7=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER1") val4_1 ? val4_0=" "+"ON " : val4_0=" "+"OFF"; } else {val4_1 ? val4_0=(" ")+"ON" : val7=(" ")+"OFF";} let val5_0; let val5_1; val5_1=getState(id.replace("INFO.Module","POWER2")).val; val5_1 ? val5_0=(" ")+"ON" : val7=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER2") val5_1 ? val5_0=" "+"ON " : val5_0=" "+"OFF"; } else {val5_1 ? val5_0=(" ")+"ON" : val7=(" ")+"OFF";} let val6_0; let val6_1; val6_1=getState(id.replace("INFO.Module","POWER3")).val; val6_1 ? val6_0=(" ")+"ON" : val7=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER3") val6_1 ? val6_0=" "+"ON " : val6_0=" "+"OFF"; } else {val6_1 ? val6_0=(" ")+"ON" : val7=(" ")+"OFF";} let val7_0; let val7_1; val7_1=getState(id.replace("INFO.Module","POWER4")).val; val7_1 ? val7_0=(" ")+"ON" : val7=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER4") val7_1 ? val7_0=" "+"ON " : val7_0=" "+"OFF"; } else {val7_1 ? val7_0=(" ")+"ON" : val7=(" ")+"OFF";} val6= val4_0+""+val5_0; val7= val6_0+""+val7_0; inaktiv(id); tabelleBind(); } }); } // ende ch4 if (dual){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">Dual (R2)";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="Uptime";val6="Power 1";val7="Power 2";counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="Sonoff Dual" || getState(id).val=="Sonoff Dual R2") { anzahl++; var ida = id.split('.'); counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; val5=getState(id.replace("INFO.Module","Uptime")).val.toString() let val6_1; val6_1=getState(id.replace("INFO.Module","POWER1")).val; val6_1 ? val6=(" ")+"ON" : val7=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER1") val6_1 ? val6=" "+"ON " : val6=" "+"OFF"; } else {val6_1 ? val6=(" ")+"ON" : val7=(" ")+"OFF";} let val7_1; val7_1=getState(id.replace("INFO.Module","POWER2")).val; val7_1 ? val7=(" ")+"ON" : val7=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER2") val7_1 ? val7=" "+"ON " : val7=" "+"OFF"; } else {val7_1 ? val7=(" ")+"ON" : val7=(" ")+"OFF";} inaktiv(id); tabelleBind(); } }); } //end if (stdoseS2X){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">Steckdose S2x";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="Uptime";val6="";val7="Power";counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="Sonoff S2X" ) { anzahl++; var ida = id.split('.'); counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; val5=getState(id.replace("INFO.Module","Uptime")).val.toString() ichWillSchalten(id) val6="" inaktiv(id); tabelleBind(); } }); } //end if (linganSteckdose){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">Lingan Steckdose";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="Uptime";val6="";val7="Power";counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="Lingan SWA1") { var ida = id.split('.'); anzahl++; counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3="na"; val5="na"; ichWillSchalten(id) val6="" inaktiv(id); tabelleBind(); } }); } //end if (rfbridge){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">RF Bridge";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="Uptime";val6="Received";val7="Power";counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="Sonoff Bridge" || getState(id).val=="Sonoff ZbBridge") { var ida = id.split('.'); anzahl++; counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; ichWillSchalten(id); existsState(id.replace("INFO.Module","RfReceived_Data")) ? val6=getState(id.replace("INFO.Module","RfReceived_Data")).val : val6=""; val5=getState(id.replace("INFO.Module","Uptime")).val.toString() inaktiv(id); tabelleBind(); } }); } //end if (ohneInfo){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">Sonderfälle ohne Info";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="Uptime";val6="";val7="Power";counter++;tabelleBind(); } var arrFilt=[]; $('sonoff.*.*').each(function(id, i) { var ida = id.split('.'); $(ida[0]+"."+ida[1]+"."+ida[2]+"."+"INFO.IPAddress").each(function(id, i) { // kontrolliere ob vorhanden var idc = id.split('.'); if(!arrFilt.includes(idc[2])){ arrFilt.push(idc[2])} }); }); $('sonoff.*.*.alive').each(function(id, i) { var ida = id.split('.'); if (!arrFilt.includes(ida[2])) { anzahl++; counter++; val1=getState(id).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=" na "; val2=" na "; val3="na"; val5="na"; val7="na" ida[2].includes("Bridge") ? val6=getState(id.replace("alive","RfReceived_Data")).val : val6=""; inaktiv(id); tabelleBind(); } }); } //end if (sv){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">Sonoff SV";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="Uptime";val6="";val7="";counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="Sonoff SV") { var ida = id.split('.'); anzahl++; counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; val7=""; val6="" val5=getState(id.replace("INFO.Module","Uptime")).val.toString() inaktiv(id); tabelleBind(); } }); } //end if (sonoffDev){ tabelleAusbessern() counter=-1; for(var i=0;i<"+HTMLbrandSetting+">Sonoff Dev";} else{val0=""; } val1=""; val2="";val3="";val4="";val5="Uptime";val6="";val7="";counter++;tabelleBind(); } $('sonoff.*.*.INFO.Module').each(function(id, i) { if (getState(id).val=="Sonoff Dev") { var ida = id.split('.'); anzahl++; counter++; val1=getState(id.replace("INFO.Module","alive")).val; val0=getState(id.replace("INFO.Module","INFO.Hostname")).val ; val4=(getState(id.replace("Module","IPAddress")).val) if (mitLink && val1) val4 = ""+symbolLink+""+val4 val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"") val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; val7=""; val6="" val5=getState(id.replace("INFO.Module","Uptime")).val.toString() inaktiv(id); tabelleBind(); } }); } //end tabelleFinish(); setState(dpAnzahl,anzahl); } //MAIN: schedule(mySchedule, function () { writeHTML(); if (braucheEinFile) {writeFile(home, path ,htmlOut, function (error) { });} }); writeHTML(); function tabelleBind(){ switch (mehrfachTabelle) { case 1: if(counter%2==0){ htmlOut=htmlOut+""; break;} else { htmlOut=htmlOut+""; break;} case 2: if(counter%4==0) { if(counter%2==0) {htmlOut = htmlOut+""; } else {htmlOut = htmlOut+"";} break; }else{ if(counter%2==0) {htmlOut = htmlOut+""; } else {htmlOut = htmlOut+"";} break;} case 3: if(counter%2==0 ) { if(counter%3==0) {htmlOut = htmlOut+""; } else { if(counter%3==1 ) { htmlOut = htmlOut+"";} else {htmlOut = htmlOut+"";} } break; }else{ if(counter%3==0) {htmlOut = htmlOut+""; } else { if(counter%3==1 ) { htmlOut = htmlOut+"";} else {htmlOut = htmlOut+"";} } break; } case 4: if(counter%8==0) { if(counter%4==0) {htmlOut = htmlOut+""; } else {if(counter%4==1 ) { htmlOut = htmlOut+"";} else {if(counter%4==3) { htmlOut= htmlOut+"";} else {htmlOut = htmlOut+"";}} } break; }else{ if(counter%4==0) {htmlOut = htmlOut+""; } else {if(counter%4==1 ) { htmlOut = htmlOut+"";} else {if(counter%4==3) { htmlOut= htmlOut+"";} else {htmlOut = htmlOut+"";}} } break; } } //switch ende } function tabelleAusbessern() { switch (mehrfachTabelle) { case 1: break; case 2: if(counter%2==0) htmlOut = htmlOut.replace(/<\/td>$/, ''); break; case 3: if(counter%3==2) htmlOut = htmlOut.replace(/<\/td>$/, ""); if(counter%3==1) htmlOut = htmlOut.replace(/<\/td>$/, ''); if(counter%3==0) htmlOut = htmlOut.replace(/<\/td>$/, ""); break; case 4: if(counter%4==3) htmlOut = htmlOut.replace(/<\/td>$/, ""); if(counter%4==2) htmlOut = htmlOut.replace(/<\/td>$/, ''); if(counter%4==1) htmlOut = htmlOut.replace(/<\/td>$/, ""); if(counter%4==0) htmlOut = htmlOut.replace(/<\/td>$/, ""); break; } } function tabelleFinish() { switch (mehrfachTabelle) { case 1: break; case 2: if(counter%2==0) { htmlOut = htmlOut.replace(/<\/td>$/, ''); } break; case 3: if(counter%3==2) htmlOut = htmlOut.replace(/<\/td>$/, ""); if(counter%3==1) htmlOut = htmlOut.replace(/<\/td>$/, ''); if(counter%3==0) htmlOut = htmlOut.replace(/<\/td>$/, ""); break; case 4: if(counter%4==3) htmlOut = htmlOut.replace(/<\/td>$/, ""); if(counter%4==2) htmlOut = htmlOut.replace(/<\/td>$/, ''); if(counter%4==1) htmlOut = htmlOut.replace(/<\/td>$/, ""); if(counter%4==0) htmlOut = htmlOut.replace(/<\/td>$/, ""); break; } var htmlUeber= "

"+htmlFeldUeber+"  Last Update: "+formatDate(getDateObject((parseFloat((new Date().getTime())))), "SS:mm:ss")+"  Anzahl: "+anzahl+"

"; var htmlUnter= "
"+htmlFeldUeber+"  Last Update: "+formatDate(getDateObject((parseFloat((new Date().getTime())))), "SS:mm:ss")+"  Anzahl: "+anzahl+"
" if (!htmlSignature) htmlUnter=""; var htmlOutVIS=""; if (htmlUberschrift) { zentriert ? htmlOutVIS=htmlZentriert+htmlUeber+htmlTabStyle+htmlTabUeber+htmlOut+"
 "+htmlFeld1+"  "+htmlFeld2+"  "+htmlFeld3+"  "+htmlFeld4+"  "+htmlFeld5+"  "+htmlFeld6+"  "+htmlFeld7+"  "+htmlFeld8+"  "+htmlFeld1+"  "+htmlFeld3+ "  "+htmlFeld3+"  "+htmlFeld4+ "  "+htmlFeld5+"  "+htmlFeld6+"  "+htmlFeld7+"  "+htmlFeld8+" 
 "+val0+"  "+val1+"  "+val2+"  "+val3+"  "+val4+"  "+val5+"  "+val6+"  "+val7+" 
 "+val0+"  "+val1+"  "+val2+"  "+val3+"  "+val4+"  "+val5+"  "+val6+"  "+val7+" 
 "+val0+"  "+val1+"  "+val2+"  "+val3+"  "+val4+"  "+val5+"  "+val6+"  "+val7+"  "+val0+"  "+val1+"  "+val2+"  "+val3+"  "+val4+"  "+val5+"  "+val6+"  "+val7+" 
 "+val0+"  "+val1+"  "+val2+"  "+val3+"  "+val4+"  "+val5+"  "+val6+"  "+val7+"  "+val0+"  "+val1+"  "+val2+"  "+val3+"  "+val4+"  "+val5+"  "+val6+"  "+val7+" 
 "+val0+"  "+val1+"  "+val2+"  "+val3+"  "+val4+"  "+val5+"  "+val6+"  "+val7+"  "+val0+"  "+val1+"  "+val2+"  "+val3+"  "+val4+"  "+val5+"  "+val6+"  "+val7+"  "+val0+"  "+val1+"  "+val2+"  "+val3+"  "+val4+"  "+val5+"  "+val6+"  "+val7+" 
 "+val0+"  "+val1+"  "+val2+"  "+val3+"  "+val4+"  "+val5+"  "+val6+"  "+val7+"  "+val0+"  "+val1+"  "+val2+"  "+val3+"  "+val4+"  "+val5+"  "+val6+"  "+val7+"  "+val0+"  "+val1+"  "+val2+"  "+val3+"  "+val4+"  "+val5+"  "+val6+"  "+val7+" 
 "+val0+"  "+val1+"  "+val2+"  "+val4+"  "+val3+"  "+val5+"  "+val6+"  "+val7+"  "+val0+"  "+val1+"  "+val2+"  "+val3+"  "+val4+"  "+val5+"  "+val6+"  "+val7+"  "+val0+"  "+val1+"  "+val2+"  "+val3+"  "+val4+"  "+val5+"  "+val6+"  "+val7+" 
 "+val0+"  "+val1+"  "+val2+"  "+val3+"  "+val4+"  "+val5+"  "+val6+"  "+val7+" 
 "+val0+"  "+val1+"  "+val2+"  "+val4+"  "+val3+"  "+val5+"  "+val6+"  "+val7+"  "+val0+"  "+val1+"  "+val2+"  "+val3+"  "+val4+"  "+val5+"  "+val6+"  "+val7+"  "+val0+"  "+val1+"  "+val2+"  "+val3+"  "+val4+"  "+val5+"  "+val6+"  "+val7+" 
 "+val0+"  "+val1+"  "+val2+"  "+val3+"  "+val4+"  "+val5+"  "+val6+"  "+val7+" 
"+htmlUnter+ buttonScript : htmlOutVIS=htmlUeber+htmlTabStyle+htmlTabUeber+htmlOut+"" + "bla bla"+htmlUnter + buttonScript; } else { zentriert ? htmlOutVIS=htmlZentriert+htmlTabStyle+htmlTabUeber+htmlOut+""+htmlUnter+ buttonScript : htmlOutVIS=htmlTabStyle+htmlTabUeber+htmlOut+"" + "blabla"+htmlUnter+ buttonScript ; } if (braucheEinVISWidget) setState(dpVIS, htmlOutVIS ); var htmlUnter= "
"+htmlFeldUeber+"  Last Update: "+formatDate(getDateObject((parseFloat((new Date().getTime())))), "SS:mm:ss");+"
" if (!htmlSignature) htmlUnter=""; var htmlEnd=""+htmlUnter+"
"; htmlUberschrift ? htmlOut=htmlStart+htmlUeber+htmlTabStyle+htmlTabUeber+htmlOut+buttonScript+htmlEnd+buttonScript : htmlOut=htmlStart+htmlTabStyle+htmlTabUeber+htmlOut+buttonScript+htmlEnd+buttonScript; } on({id: arrTrigger, ack: false, change: "any"}, function (obj) { writeHTML(); if (braucheEinFile) {writeFile(home, path ,htmlOut, function (error) { /* log('file written');*/ });} }); function ichWillSchalten(id) { let val7_1; val7_1=getState(id.replace("INFO.Module","POWER")).val; val7_1 ? val7=(" ")+"ON" : val7=(" ")+"OFF"; if (mitSchalter){ let valButton=id.replace("INFO.Module","POWER") val7_1 ? val7=" "+"ON " : val7=" "+"OFF"; } else {val7_1 ? val7=(" ")+"ON" : val7=(" ")+"OFF";} } function inaktiv(id) { if (!getState(id.replace("INFO.Module","alive")).val) { //farbeNichtConnected val1=symbolKO; val4=("<"+styleNichtErreichbar+">   ")+val4; val2=("<"+styleNichtErreichbar+">")+val2; val3=("<"+styleNichtErreichbar+">")+" 0 %"; val5=("")+" --- "; val6=("")+" --- "; val7=("")+" --- "; val0=("<"+styleNichtErreichbar+">")+val0} else{ val1=symbolOK; }}