Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. Sonoff Geräte als HTML Tabelle - Vis

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Sonoff Geräte als HTML Tabelle - Vis

    This topic has been deleted. Only users with topic management privileges can see it.
    • Chaot
      Chaot @liv-in-sky last edited by

      @liv-in-sky Ok, kein Error mehr. Nur noch warn:

      javascript.0	2020-01-14 22:05:38.356	warn	(560) at script.js.Systeminfo.Tasmotas:702:2
      javascript.0	2020-01-14 22:05:38.356	warn	(560) at writeHTML (script.js.Systeminfo.Tasmotas:221:30)
      javascript.0	2020-01-14 22:05:38.356	warn	(560) at Object.result.each (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:846:29)
      javascript.0	2020-01-14 22:05:38.355	warn	(560) at script.js.Systeminfo.Tasmotas:236:22
      javascript.0	2020-01-14 22:05:38.355	warn	(560) getState "sonoff.0.Sender.POWER" not found (3)
      javascript.0	2020-01-14 22:05:38.354	warn	(560) at script.js.Systeminfo.Tasmotas:702:2
      javascript.0	2020-01-14 22:05:38.354	warn	(560) at writeHTML (script.js.Systeminfo.Tasmotas:221:30)
      javascript.0	2020-01-14 22:05:38.354	warn	(560) at Object.result.each (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:846:29)
      javascript.0	2020-01-14 22:05:38.354	warn	(560) at script.js.Systeminfo.Tasmotas:236:22
      javascript.0	2020-01-14 22:05:38.352	warn	(560) getState "sonoff.0.Eingang.POWER" not found (3)
      

      Das liegt daran das die Geräte zwei Ausgänge schalten. Also Power1 und Power2 . Unter Power steht deshalb kein Wert.

      liv-in-sky 1 Reply Last reply Reply Quote 0
      • liv-in-sky
        liv-in-sky @Chaot last edited by

        @Chaot
        kommentiere die 2 zeilen aus: 236 und 237
        und schreibe darunter val7="";

                 //   let val7_1=getState(id.replace("INFO.Module","POWER")).val;        
                 //   val7_1 ? val7=(" <font color=\"lightgreen\"> ")+"ON" : val7=(" <font color=\"red\"> ")+"OFF";
                      val7="";
        

        dann überlegen wir morgen, was wird da machen

        wäre schön, wenn das script noch ohne fehler liefe

        1 Reply Last reply Reply Quote 0
        • Chaot
          Chaot @liv-in-sky last edited by

          @liv-in-sky

          Bisheriges Resultat:
          SonoffDevices1.png

          Es fehlen:
          .158: Sonoff SV
          .159 Sonoff TH1 1CH
          .160 Sonoff SV
          .161 Sonoff SV
          .168 Sonoff SV
          .169 Sonoff Dev

          Ich hau mich jetzt aufs Ohr. Klasse Arbeit von dir

          liv-in-sky 1 Reply Last reply Reply Quote 0
          • liv-in-sky
            liv-in-sky @Chaot last edited by

            @Chaot dito

            Chaot ? 3 Replies Last reply Reply Quote 0
            • Chaot
              Chaot @liv-in-sky last edited by

              @liv-in-sky
              Mit der letzten Änderung läuft es jetzt auch ohne Warnung.

              1 Reply Last reply Reply Quote 0
              • ?
                A Former User @liv-in-sky last edited by

                @liv-in-sky darf ich mich wieder einklinken? Habe interessiert mitgelesen. Kann ich das letzte Script auch schon nehmen oder abwarten noch? Dank

                liv-in-sky 1 Reply Last reply Reply Quote 0
                • liv-in-sky
                  liv-in-sky @Guest last edited by liv-in-sky

                  @Alina kannst du gerne ausprobieren

                  aber datenpunkt anlegen nicht vergessen - für die anzahl

                  1 Reply Last reply Reply Quote 0
                  • Chaot
                    Chaot @liv-in-sky last edited by

                    @liv-in-sky
                    Das hat mir jetzt keine Ruhe gelassen.
                    Kannst du mal über das Script schauen:

                    //@liv-in-sky Januar 2020
                    
                    //HIER WIRD PFAD UND FILENAME DEFINIERT
                    const path = "/htmlakku.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="vis.0.TABELLEN.SONOFF"         //WICHTIG wenn braucheEinVISWidget auf true gesetzt !!  dp zusätzlich für VIS-HTML-Basic-Widget
                    let dpAnzahl="vis.0.TABELLEN.AnzahlSonoff";  //WICHTIG datenpunkt erstellen vom typ "number" - bei 0 kein alarm und größer 0 die anzahl der schlechten batterien
                    let htmlColorDeviceUeberschrift="#00BFFF"
                    var battAlarm=30;                                     //alarm batterie wert
                    var battAlarmWarning=55;                                     //warnungen batterie wert
                    
                    // ------------------------    hier einstellen, was man für ein device  hat - die nicht gebraucht werden auf false setzen !!!
                    var pow=true;
                    var generic=true;
                    var basic=true;
                    var externalMitInfo=false; //noch nicht integriert
                    var externalOhneInfo=false;  //noch nicht integriert
                    var schalter2ch=true;                                               
                    var rfbridge=true;
                    var stdoseS2X=true;
                    var ohneInfo=false;
                    //Sonderfall
                    var linganSteckdose =true;
                    
                    
                    
                    var filterArray=["Sonoff Pow","Generic","Sonoff Basic","Sonoff T1 1CH","Sonoff SV","Sonoff Dev","BlitzWolf SHP"]; //hier arten eintragen - muss gefiltert werden für geräte ohne INFO
                    
                    let mySchedule="*/20 * * * * * "; 
                    
                    //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";                    // überschrift Tabellen Spalte3 und  Ausrichtung left,right or center
                    var htmlFeld4='WLAN';        var Feld4lAlign="right";                    // überschrift Tabellen Spalte4 und  Ausrichtung left,right or center
                    var htmlFeld5='IP';        var Feld5lAlign="left";                    // überschrift Tabellen Spalte5 und  Ausrichtung left,right or center
                    var htmlFeld6='';        var Feld6lAlign="center";                    // überschrift Tabellen Spalte5 und  Ausrichtung left,right or center
                    var htmlFeld7='';        var Feld7lAlign="center";                    // überschrift Tabellen Spalte5 und  Ausrichtung left,right or center
                    var htmlFeld8='';        var Feld8lAlign="center";                    // überschrift Tabellen Spalte5 und  Ausrichtung left,right or center
                    
                    //-----------------------------------
                    
                    
                    
                    //hier werden die styles für die tabelle definiert
                    //ÜBERSCHRIFT ÜBER TABELLE
                    let   htmlUberschrift=true;                           // mit Überschrift über der tabelle
                    let   htmlSignature=false;                              // 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 htmlFarbZweiteTabelle="white";                // Farbe der Überschrift bei jeder 2.ten Tabelle
                    const htmlFarbTableColorUber="#BDBDBD";               // Überschrift in der tabelle - der einzelnen Spalten
                    //GANZE TABELLE
                    let abstandZelle="1";
                    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="Helvetica";
                    const htmlSchriftgroesse="12px";
                    //FELDER UND RAHMEN
                    let   UeberschriftSpalten=true;                // ein- oder ausblenden der spatlen-überschriften
                    const htmlFarbFelderschrift="#BDBDBD";                  // SchriftFarbe der Felder
                    const htmlFarbFelderschrift2="#D8D8D8";                 // SchriftFarbe der Felder für jede 2te Tabelle
                    const htmlFarbTableColorGradient1="#424242";          //  Gradient - Hintergrund der Tabelle - Verlauffarbe
                    const htmlFarbTableColorGradient2="#424242";          //  Gradient - Hintergrund der Tabelle - ist dieser Wert gleich Gradient1 gibt es keinen verlauf
                    const htmlFarbTableBorderColor="gray";             // 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='<center>'
                    const htmlStart=    "<!DOCTYPE html><html lang=\"de\"><head><title>Vorlage</title><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">"+
                                      "<style> * {  margin: 0;} body {background-color: "+backgroundAll+"; margin: 0 auto;  }"+
                                      " p {padding-top: 10px; padding-bottom: 10px; text-align: "+htmlcenterHelp2+"}"+
                                     // " div { margin: 0 auto;  margin-left: auto; margin-right: auto;}"+
                                      " td { padding:"+abstandZelle+"px; border:0px solid "+htmlFarbTableBorderColor+";  border-right:"+borderHelpRight+"px solid "+htmlFarbTableBorderColor+";border-bottom:"+borderHelpBottum+"px solid "+htmlFarbTableBorderColor+";}"+ 
                                      " table { width: "+weite+";  margin: 0 "+htmlcenterHelp+"; border:1px solid "+htmlFarbTableBorderColor+"; border-spacing=\""+abstandZelle+"0px\" ; }"+   // margin macht center
                                      "td:nth-child(1) {width: "+htmlSpalte1Weite+"}"+"td:nth-child(2) {width:"+htmlSpalte1Weite+"}"+
                                      " </style></head><body> <div>";
                    //const htmlUeber=    "<p style=\"color:"+htmlFarbUber+"; font-family:"+htmlSchriftart+"; font-weight: bold\">"+htmlFeldUeber+"</p>";                    
                    const htmlTabStyle= "<table bordercolor=\""+htmlFarbTableBorderColor+"\" border=\"2px\" cellspacing=\""+abstandZelle+"\" cellpadding=\""+abstandZelle+"\" width=\""+weite+"\" rules=\""+htmlRahmenLinien+"\" style=\"color:"+htmlFarbFelderschrift+";  font-size:"+htmlSchriftgroesse+
                                         "; font-family:"+htmlSchriftart+";background-image: linear-gradient(42deg,"+htmlFarbTableColorGradient2+","+htmlFarbTableColorGradient1+");\">";
                    const htmlTabUeber1="<tr style=\"color:"+htmlFarbTableColorUber+"; font-weight: bold\">";
                    const htmlTabUeber3="</tr>";
                    
                    
                    //NICHTS ÄNDERN - abhängig von den oben definierten _Spalten - in diesem Beispiel sind es 5
                    
                    
                    var htmlTabUeber2="<td width="+htmlSpalte1Weite+" align="+Feld1lAlign+">&ensp;"+htmlFeld1+"&ensp;</td><td width="+htmlSpalte1Weite+" align="+Feld2lAlign+">&ensp;"+htmlFeld2+"&ensp;</td><td  align="+Feld3lAlign+">&ensp;"+htmlFeld3+"&ensp;</td><td align="+Feld4lAlign+">&ensp;"+htmlFeld4+"&ensp;</td><td  align="+Feld5lAlign+">&ensp;"+htmlFeld5+"&ensp;</td><td  align="+Feld6lAlign+">&ensp;"+htmlFeld6+"&ensp;</td><td  align="+Feld7lAlign+">&ensp;"+htmlFeld7+"&ensp;</td><td  align="+Feld8lAlign+">&ensp;"+htmlFeld8+"&ensp;</td>";
                    var htmlTabUeber2_1="<td width="+htmlSpalte1Weite+" align="+Feld1lAlign+" style=\"color:"+htmlFarbZweiteTabelle+"\">&ensp;"+htmlFeld1+"&ensp;</td><td width="+htmlSpalte1Weite+" align="+Feld2lAlign+" style=\"color:"+htmlFarbZweiteTabelle+"\">&ensp;"+htmlFeld3+
                                      "&ensp;</td><td  align="+Feld3lAlign+" style=\"color:"+htmlFarbZweiteTabelle+"\">&ensp;"+htmlFeld3+"&ensp;</td><td  align="+Feld4lAlign+" style=\"color:"+htmlFarbZweiteTabelle+"\">&ensp;"+htmlFeld4+
                                      "&ensp;</td><td align="+Feld5lAlign+" style=\"color:"+htmlFarbZweiteTabelle+"\"&ensp;>"+htmlFeld5+"&ensp;</td><td align="+Feld6lAlign+" style=\"color:"+htmlFarbZweiteTabelle+"\"&ensp;>"+htmlFeld6+"&ensp;</td><td align="+Feld7lAlign+" style=\"color:"+htmlFarbZweiteTabelle+"\"&ensp;>"+htmlFeld7+"&ensp;</td><td align="+Feld8lAlign+" style=\"color:"+htmlFarbZweiteTabelle+"\"&ensp;>"+htmlFeld8+"&ensp;</td>";
                                          //------------------------------------------------------
                    
                    var anzahl;
                    var AkkuAlarm=[];
                    var htmlOut="";
                    var mix;
                    var counter;
                    var val1; var val2; var val0; var val3; var val4; var val5; var val6; var val7;
                    var htmlTabUeber="";
                    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=""}  
                    
                    //--------------------------------------------------------------------------------------------------------------------------------------------------
                    //---------hier kommt eure schleife rein counter++, tabelleBind() und tabelleFinish() müssen so integriert bleiben !!!------------------------------
                    //---------alle valx werte müssen von euch bestimmt werden - val0,val1,val2,val3,val4!!!------------------------------------------------------------
                    //--------------------------------------------------------------------------------------------------------------------------------------------------
                    
                    var myColl=[];
                    var val1help;
                    
                     
                     if (pow){
                    
                                // UNTERTEILUNG - ÜBERSCHRIFT IN TABELLE
                         tabelleAusbessern();
                         counter=0;
                         val0=val0=""; val1=""; val2="";val3="";val4="";val5="";val6="";
                         tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         tabelleAusbessern();
                         counter=0;
                         val0="<font color=\""+htmlColorDeviceUeberschrift+"\"><b>BlitzWolf SHP</b>"; val1=""; val2="";val3="";val4="";val5="<font color=\""+htmlColorDeviceUeberschrift+"\">kWh Gesamt";val6="<font color=\""+htmlColorDeviceUeberschrift+"\">kWh Today";val7="<font color=\""+htmlColorDeviceUeberschrift+"\">Power Switch"
                         tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         tabelleAusbessern();
                         counter=-1
                    
                    //sonoff.0.SonoffPow1.INFO.Module
                    $('sonoff.*.*.INFO.Module').each(function(id, i) {           // hier eigene schleife definieren und den wert counter++ nicht vergessen  !!!
                      
                         if (getState(id).val=="BlitzWolf SHP") {
                            // log (id)
                            anzahl++;
                           var ida = id.split('.');
                          
                             counter++; 
                               //log("dad   "+getState(id.replace("Info.Module","alive")).val + " ----" +id.replace("Info.Module","alive"))
                             val1=getState(id.replace("INFO.Module","alive")).val;                   //sonoff.0.SonoffPow1.alive          sonoff.0.SonoffPow1.INFO.Module
                             val0=getObject(ida[0]+"."+ida[1]+"."+ida[2]).common.name ;
                             val4=getState(id.replace("Module","IPAddress")).val
                             val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"")     //sonoff.0.SonoffPow1.Wifi_RSSIsonoff.0.SonoffPow1.POWER
                             val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; 
                             let val7_1=getState(id.replace("INFO.Module","POWER")).val;        
                             val7_1 ? val7=(" <font color=\"lightgreen\"> ")+"ON" : val7=(" <font color=\"red\"> ")+"OFF";
                             val6=getState(id.replace("INFO.Module","ENERGY_Today")).val.toString();
                             val5=getState(id.replace("INFO.Module","ENERGY_Total")).val.toString();
                           
                             if (!getState(id.replace("INFO.Module","alive")).val) {
                                 val1="❌";
                                 val4=(" <font color=\"red\"> ")+val1;
                                 val2=(" <font color=\"red\"> ")+val2;
                                 val3=(" <font color=\"red\"> ")+" 0 %";
                                 val5=(" <font color=\"red\"> ")+" --- ";
                                 val6=(" <font color=\"red\"> ")+" --- ";
                                 val7=(" <font color=\"red\"> ")+" --- ";
                                 val0=(" <font color=\"red\"> ")+val0} 
                             else{
                                 val1="✅";
                                // val1=(" <font color=\"lightgreen\"> ")+val1
                                // val2=(" <font color=\"green\"> ")+val2
                                // val3=(" <font color=\"green\"> ")+val3
                                // val0=(" <font color=\"green\"> ")+val0
                                }
                    
                    
                            
                      
                        tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                       
                     } }); //Schleifen Ende - je nach schleifenart muss hier etwas geändert werden !!!!!!!!!  
                    } //ende fritzdect
                    
                    if (generic){
                                // UNTERTEILUNG - ÜBERSCHRIFT IN TABELLE
                         tabelleAusbessern();
                         counter=0;
                         val0=val0=""; val1=""; val2="";val3="";val4="";val5="";val6="";
                         tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         tabelleAusbessern();
                         counter=0;
                         val0="<font color=\""+htmlColorDeviceUeberschrift+"\"><b>Generic</b>"; val1=""; val2="";val3="";val4="";val5="<font color=\""+htmlColorDeviceUeberschrift+"\">Uptime";val6="<font color=\""+htmlColorDeviceUeberschrift+"\">";val7="<font color=\""+htmlColorDeviceUeberschrift+"\">Power Switch"
                         tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         tabelleAusbessern();
                         counter=-1
                    
                    //sonoff.0.SonoffPow1.INFO.Module
                    $('sonoff.*.*.INFO.Module').each(function(id, i) {           // hier eigene schleife definieren und den wert counter++ nicht vergessen  !!!
                      
                         if (getState(id).val=="Generic") {
                            //log (id)
                            anzahl++;
                           var ida = id.split('.');
                          
                             counter++; 
                               //log("dad   "+getState(id.replace("Info.Module","alive")).val + " ----" +id.replace("Info.Module","alive"))
                             val1=getState(id.replace("INFO.Module","alive")).val;                   //sonoff.0.SonoffPow1.alive          sonoff.0.SonoffPow1.INFO.Module
                             val0=getObject(ida[0]+"."+ida[1]+"."+ida[2]).common.name ;
                             val4=getState(id.replace("Module","IPAddress")).val
                             val5=val3=getState(id.replace("INFO.Module","Uptime")).val.toString()
                             val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"")     //sonoff.0.SonoffPow1.Wifi_RSSIsonoff.0.SonoffPow1.POWER
                             val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; 
                             //let val7_1=getState(id.replace("INFO.Module","alive")).val;        
                             //val7_1 ? val7=(" <font color=\"lightgreen\"> ")+"ON" : val7=(" <font color=\"red\"> ")+"OFF";
                             val7="";
                           //  let val6_1=getState(id.replace("INFO.Module","Switch1")).val;        
                           //  val6_1 ? val6=(" <font color=\"lightgreen\"> ")+"ON" : val6=(" <font color=\"red\"> ")+"OFF";
                             
                            // val6=getState(id.replace("INFO.Module","SWITCH1")).val.toString();
                             //val7=getState(id.replace("INFO.Module","ENERGY_Total")).val.toString();
                            // val6=""
                              val6="";
                           
                             if (!getState(id.replace("INFO.Module","alive")).val) {
                                 val1="❌";
                                 val4=(" <font color=\"red\"> ")+val4;
                                 val2=(" <font color=\"red\"> ")+val2;
                                 val3=(" <font color=\"red\"> ")+" 0 %";
                                 val5=(" <font color=\"red\"> ")+" --- ";
                                 val6=(" <font color=\"red\"> ")+" --- ";
                                 val7=(" <font color=\"red\"> ")+" --- ";
                                 val0=(" <font color=\"red\"> ")+val0} 
                             else{
                                 val1="✅";
                                // val1=(" <font color=\"lightgreen\"> ")+val1
                                // val2=(" <font color=\"green\"> ")+val2
                                // val3=(" <font color=\"green\"> ")+val3
                                // val0=(" <font color=\"green\"> ")+val0
                                }
                            
                         
                      
                        tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         }
                      }); //Schleifen Ende - je nach schleifenart muss hier etwas geändert werden !!!!!!!!!
                    
                    } //ende xiaomi
                    
                    if (basic){
                                // UNTERTEILUNG - ÜBERSCHRIFT IN TABELLE
                         tabelleAusbessern();
                         counter=0;
                         val0=val0=""; val1=""; val2="";val3="";val4="";val5="";val6="";val7="";
                         tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         tabelleAusbessern();
                         counter=0;
                         val0="<font color=\""+htmlColorDeviceUeberschrift+"\"><b>Generic</b>"; val1=""; val2="";val3="";val4="";val5="<font color=\""+htmlColorDeviceUeberschrift+"\">Uptime";val6="<font color=\""+htmlColorDeviceUeberschrift+"\">";val7="<font color=\""+htmlColorDeviceUeberschrift+"\">Power Switch"
                         tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         tabelleAusbessern();
                         counter=-1
                    
                    //sonoff.0.SonoffPow1.INFO.Module
                    $('sonoff.*.*.INFO.Module').each(function(id, i) {           // hier eigene schleife definieren und den wert counter++ nicht vergessen  !!!
                      
                         if (getState(id).val=="Sonoff Basic") {
                            //log (id)
                            anzahl++;
                           var ida = id.split('.');
                          
                             counter++; 
                               //log("dad   "+getState(id.replace("Info.Module","alive")).val + " ----" +id.replace("Info.Module","alive"))
                             val1=getState(id.replace("INFO.Module","alive")).val;                   //sonoff.0.SonoffPow1.alive          sonoff.0.SonoffPow1.INFO.Module
                             val0=getObject(ida[0]+"."+ida[1]+"."+ida[2]).common.name ;
                             val4=getState(id.replace("Module","IPAddress")).val
                             val5=val3=getState(id.replace("INFO.Module","Uptime")).val.toString()
                             val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"")     //sonoff.0.SonoffPow1.Wifi_RSSIsonoff.0.SonoffPow1.POWER
                             val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; 
                             //let val7_1=getState(id.replace("INFO.Module","alive")).val;        
                             //val7_1 ? val7=(" <font color=\"lightgreen\"> ")+"ON" : val7=(" <font color=\"red\"> ")+"OFF";
                             val7="";
                           //  let val6_1=getState(id.replace("INFO.Module","Switch1")).val;        
                           //  val6_1 ? val6=(" <font color=\"lightgreen\"> ")+"ON" : val6=(" <font color=\"red\"> ")+"OFF";
                             
                            // val6=getState(id.replace("INFO.Module","SWITCH1")).val.toString();
                             //val7=getState(id.replace("INFO.Module","ENERGY_Total")).val.toString();
                            // val6=""
                              val6="";
                           
                             if (!getState(id.replace("INFO.Module","alive")).val) {
                                 val1="❌";
                                 val4=(" <font color=\"red\"> ")+val4;
                                 val2=(" <font color=\"red\"> ")+val2;
                                 val3=(" <font color=\"red\"> ")+" 0 %";
                                 val5=(" <font color=\"red\"> ")+" --- ";
                                 val6=(" <font color=\"red\"> ")+" --- ";
                                 val7=(" <font color=\"red\"> ")+" --- ";
                                 val0=(" <font color=\"red\"> ")+val0} 
                             else{
                                 val1="✅";
                                // val1=(" <font color=\"lightgreen\"> ")+val1
                                // val2=(" <font color=\"green\"> ")+val2
                                // val3=(" <font color=\"green\"> ")+val3
                                // val0=(" <font color=\"green\"> ")+val0
                                }
                            
                         
                      
                        tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         }
                      }); //Schleifen Ende - je nach schleifenart muss hier etwas geändert werden !!!!!!!!!
                    
                    } //ende xiaomi
                    
                    
                    if (schalter2ch){
                                // UNTERTEILUNG - ÜBERSCHRIFT IN TABELLE
                         tabelleAusbessern();
                         counter=0;
                         val0=val0=""; val1=""; val2="";val3="";val4="";val5="";val6="";val7="";
                         tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         tabelleAusbessern();
                         counter=0;
                         val0="<font color=\""+htmlColorDeviceUeberschrift+"\"><b>Schalter</b>"; val1=""; val2="";val3="";val4="";val5="<font color=\""+htmlColorDeviceUeberschrift+"\">Uptime";val6="<font color=\""+htmlColorDeviceUeberschrift+"\">";val7="<font color=\""+htmlColorDeviceUeberschrift+"\">Power Switch"
                         tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         tabelleAusbessern();
                         counter=-1
                    
                    //sonoff.0.SonoffPow1.INFO.Module
                    $('sonoff.*.*.INFO.Module').each(function(id, i) {           // hier eigene schleife definieren und den wert counter++ nicht vergessen  !!!
                      
                         if (getState(id).val=="Sonoff T1 1CH") {
                            //log (id)
                            anzahl++;
                           var ida = id.split('.');
                          
                             counter++; 
                               //log("dad   "+getState(id.replace("Info.Module","alive")).val + " ----" +id.replace("Info.Module","alive"))
                             val1=getState(id.replace("INFO.Module","alive")).val;                   //sonoff.0.SonoffPow1.alive          sonoff.0.SonoffPow1.INFO.Module
                             val0=getObject(ida[0]+"."+ida[1]+"."+ida[2]).common.name ;
                             val4=getState(id.replace("Module","IPAddress")).val
                             val5=val3=getState(id.replace("INFO.Module","Uptime")).val.toString()
                             val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"")     //sonoff.0.SonoffPow1.Wifi_RSSIsonoff.0.SonoffPow1.POWER
                             val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; 
                             //let val7_1=getState(id.replace("INFO.Module","alive")).val;        
                             //val7_1 ? val7=(" <font color=\"lightgreen\"> ")+"ON" : val7=(" <font color=\"red\"> ")+"OFF";
                             val7="";
                           //  let val6_1=getState(id.replace("INFO.Module","Switch1")).val;        
                           //  val6_1 ? val6=(" <font color=\"lightgreen\"> ")+"ON" : val6=(" <font color=\"red\"> ")+"OFF";
                             
                            // val6=getState(id.replace("INFO.Module","SWITCH1")).val.toString();
                             //val7=getState(id.replace("INFO.Module","ENERGY_Total")).val.toString();
                            // val6=""
                              val6="";
                           
                             if (!getState(id.replace("INFO.Module","alive")).val) {
                                 val1="❌";
                                 val4=(" <font color=\"red\"> ")+val4;
                                 val2=(" <font color=\"red\"> ")+val2;
                                 val3=(" <font color=\"red\"> ")+" 0 %";
                                 val5=(" <font color=\"red\"> ")+" --- ";
                                 val6=(" <font color=\"red\"> ")+" --- ";
                                 val7=(" <font color=\"red\"> ")+" --- ";
                                 val0=(" <font color=\"red\"> ")+val0} 
                             else{
                                 val1="✅";
                                // val1=(" <font color=\"lightgreen\"> ")+val1
                                // val2=(" <font color=\"green\"> ")+val2
                                // val3=(" <font color=\"green\"> ")+val3
                                // val0=(" <font color=\"green\"> ")+val0
                                }
                            
                         
                      
                        tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         }
                      }); //Schleifen Ende - je nach schleifenart muss hier etwas geändert werden !!!!!!!!!
                    
                    } //ende xiaomi
                    
                    if (stdoseS2X){
                                // UNTERTEILUNG - ÜBERSCHRIFT IN TABELLE
                         tabelleAusbessern();
                         counter=0;
                         val0=val0=""; val1=""; val2="";val3="";val4="";val5="";val6="";val7="";
                         tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         tabelleAusbessern();
                         counter=0;
                         val0="<font color=\""+htmlColorDeviceUeberschrift+"\"><b>Sonoff DEV</b>"; val1=""; val2="";val3="";val4="";val5="<font color=\""+htmlColorDeviceUeberschrift+"\">Uptime";val6="<font color=\""+htmlColorDeviceUeberschrift+"\">";val7="<font color=\""+htmlColorDeviceUeberschrift+"\">Power Switch"
                         tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         tabelleAusbessern();
                         counter=-1
                    
                    //sonoff.0.SonoffPow1.INFO.Module
                    $('sonoff.*.*.INFO.Module').each(function(id, i) {           // hier eigene schleife definieren und den wert counter++ nicht vergessen  !!!
                      
                         if (getState(id).val=="Sonoff Dev") {
                            //log (id)
                            anzahl++;
                           var ida = id.split('.');
                          
                             counter++; 
                               //log("dad   "+getState(id.replace("Info.Module","alive")).val + " ----" +id.replace("Info.Module","alive"))
                             val1=getState(id.replace("INFO.Module","alive")).val;                   //sonoff.0.SonoffPow1.alive          sonoff.0.SonoffPow1.INFO.Module
                             val0=getObject(ida[0]+"."+ida[1]+"."+ida[2]).common.name ;
                             val4=getState(id.replace("Module","IPAddress")).val
                             val5=val3=getState(id.replace("INFO.Module","Uptime")).val.toString()
                             val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"")     //sonoff.0.SonoffPow1.Wifi_RSSIsonoff.0.SonoffPow1.POWER
                             val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; 
                             //let val7_1=getState(id.replace("INFO.Module","alive")).val;        
                             //val7_1 ? val7=(" <font color=\"lightgreen\"> ")+"ON" : val7=(" <font color=\"red\"> ")+"OFF";
                             val7="";
                           //  let val6_1=getState(id.replace("INFO.Module","Switch1")).val;        
                           //  val6_1 ? val6=(" <font color=\"lightgreen\"> ")+"ON" : val6=(" <font color=\"red\"> ")+"OFF";
                             
                            // val6=getState(id.replace("INFO.Module","SWITCH1")).val.toString();
                             //val7=getState(id.replace("INFO.Module","ENERGY_Total")).val.toString();
                            // val6=""
                              val6="";
                           
                             if (!getState(id.replace("INFO.Module","alive")).val) {
                                 val1="❌";
                                 val4=(" <font color=\"red\"> ")+val4;
                                 val2=(" <font color=\"red\"> ")+val2;
                                 val3=(" <font color=\"red\"> ")+" 0 %";
                                 val5=(" <font color=\"red\"> ")+" --- ";
                                 val6=(" <font color=\"red\"> ")+" --- ";
                                 val7=(" <font color=\"red\"> ")+" --- ";
                                 val0=(" <font color=\"red\"> ")+val0} 
                             else{
                                 val1="✅";
                                // val1=(" <font color=\"lightgreen\"> ")+val1
                                // val2=(" <font color=\"green\"> ")+val2
                                // val3=(" <font color=\"green\"> ")+val3
                                // val0=(" <font color=\"green\"> ")+val0
                                }
                            
                         
                      
                        tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         }
                      }); //Schleifen Ende - je nach schleifenart muss hier etwas geändert werden !!!!!!!!!
                    
                    } //ende xiaomi
                    
                    if (linganSteckdose){
                                // UNTERTEILUNG - ÜBERSCHRIFT IN TABELLE
                         tabelleAusbessern();
                         counter=0;
                         val0=val0=""; val1=""; val2="";val3="";val4="";val5="";val6="";val7="";
                         tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         tabelleAusbessern();
                         counter=0;
                         val0="<font color=\""+htmlColorDeviceUeberschrift+"\"><b>Sonoff SV</b>"; val1=""; val2="";val3="";val4="";val5="<font color=\""+htmlColorDeviceUeberschrift+"\">Uptime";val6="<font color=\""+htmlColorDeviceUeberschrift+"\">";val7="<font color=\""+htmlColorDeviceUeberschrift+"\">Power Switch"
                         tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         tabelleAusbessern();
                         counter=-1
                    
                    //sonoff.0.SonoffPow1.INFO.Module
                    $('sonoff.*.*.INFO.Module').each(function(id, i) {           // hier eigene schleife definieren und den wert counter++ nicht vergessen  !!!
                      
                         if (getState(id).val=="Sonoff SV") {
                            //log (id)
                            anzahl++;
                           var ida = id.split('.');
                          
                             counter++; 
                               //log("dad   "+getState(id.replace("Info.Module","alive")).val + " ----" +id.replace("Info.Module","alive"))
                             val1=getState(id.replace("INFO.Module","alive")).val;                   //sonoff.0.SonoffPow1.alive          sonoff.0.SonoffPow1.INFO.Module
                             val0=getObject(ida[0]+"."+ida[1]+"."+ida[2]).common.name ;
                             val4=getState(id.replace("Module","IPAddress")).val
                             val5=val3=getState(id.replace("INFO.Module","Uptime")).val.toString()
                             val2=getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"")     //sonoff.0.SonoffPow1.Wifi_RSSIsonoff.0.SonoffPow1.POWER
                             val3=getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; 
                             //let val7_1=getState(id.replace("INFO.Module","alive")).val;        
                             //val7_1 ? val7=(" <font color=\"lightgreen\"> ")+"ON" : val7=(" <font color=\"red\"> ")+"OFF";
                             val7="";
                           //  let val6_1=getState(id.replace("INFO.Module","Switch1")).val;        
                           //  val6_1 ? val6=(" <font color=\"lightgreen\"> ")+"ON" : val6=(" <font color=\"red\"> ")+"OFF";
                             
                            // val6=getState(id.replace("INFO.Module","SWITCH1")).val.toString();
                             //val7=getState(id.replace("INFO.Module","ENERGY_Total")).val.toString();
                            // val6=""
                              val6="";
                           
                             if (!getState(id.replace("INFO.Module","alive")).val) {
                                 val1="❌";
                                 val4=(" <font color=\"red\"> ")+val4;
                                 val2=(" <font color=\"red\"> ")+val2;
                                 val3=(" <font color=\"red\"> ")+" 0 %";
                                 val5=(" <font color=\"red\"> ")+" --- ";
                                 val6=(" <font color=\"red\"> ")+" --- ";
                                 val7=(" <font color=\"red\"> ")+" --- ";
                                 val0=(" <font color=\"red\"> ")+val0} 
                             else{
                                 val1="✅";
                                // val1=(" <font color=\"lightgreen\"> ")+val1
                                // val2=(" <font color=\"green\"> ")+val2
                                // val3=(" <font color=\"green\"> ")+val3
                                // val0=(" <font color=\"green\"> ")+val0
                                }
                            
                         
                      
                        tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         }
                      }); //Schleifen Ende - je nach schleifenart muss hier etwas geändert werden !!!!!!!!!
                    
                    } //ende xiaomi
                    
                    if (ohneInfo){
                                   // UNTERTEILUNG - ÜBERSCHRIFT IN TABELLE
                         tabelleAusbessern();
                         counter=0;
                         val0=val0=""; val1=""; val2="";val3="";val4="";val5="";val6="";val7="";
                         tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         tabelleAusbessern();
                         counter=0;
                         val0="<font color=\""+htmlColorDeviceUeberschrift+"\"><b>Sonderfälle ohne INFO</b>"; val1=""; val2="";val3="";val4="";val5="<font color=\""+htmlColorDeviceUeberschrift+"\">Uptime";val6="<font color=\""+htmlColorDeviceUeberschrift+"\">";val7="<font color=\""+htmlColorDeviceUeberschrift+"\">Power Switch"
                         tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         tabelleAusbessern();
                         counter=-1
                    var arrFilt=[];
                    //sonoff.0.SonoffPow1.INFO.Module
                    
                    $('sonoff.*.*').each(function(id, i) {           // hier eigene schleife definieren und den wert counter++ nicht vergessen  !!!
                    
                           var ida = id.split('.');
                    
                           //  log(ida[0]+"."+ida[1]+"."+ida[2]+"."+"INFO.IPAddress")
                    
                             $(ida[0]+"."+ida[1]+"."+ida[2]+"."+"INFO.IPAddress").each(function(id, i) {   // kontrolliere ob  vorhanden
                               
                                 var idc = id.split('.');
                                 if(!arrFilt.includes(idc[2])){
                               //  log(idc[2])
                              arrFilt.push(idc[2])}
                              });
                             
                    });
                    
                    //log("filter: "+arrFilt.toString())
                    //sonoff.0.ShellyWC.alive
                    $('sonoff.*.*.alive').each(function(id, i) {           // hier eigene schleife definieren und den wert counter++ nicht vergessen  !!!
                    
                      var ida = id.split('.');
                      //log(ida[2])
                         //  log (" hier die werte: "+id)
                       //  if (filterArray.includes) {
                             if (!arrFilt.includes(ida[2])) {
                         //   log (id)
                         
                          anzahl++;
                             counter++; 
                               //log("dad   "+getState(id.replace("Info.Module","alive")).val + " ----" +id.replace("Info.Module","alive"))
                             val1=getState(id).val;                   //sonoff.0.SonoffPow1.alive          sonoff.0.SonoffPow1.INFO.Module
                             val0=getObject(ida[0]+"."+ida[1]+"."+ida[2]).common.name ;
                             val4=" na "; //getState(id.replace("Module","IPAddress")).val
                             val2=" na "; //getState(id.replace("Module","Version")).val.replace(/\(.+\)/g,"")     //sonoff.0.SonoffPow1.Wifi_RSSIsonoff.0.SonoffPow1.POWER
                             val3="na"; //getState(id.replace("INFO.Module","Wifi_RSSI")).val.toString()+" %"; 
                             val5="na"; //val3=getState(id.replace("INFO.Module","Uptime")).val.toString()
                             val7="na" // let val7_1=getState(id.replace("alive","POWER")).val;        
                            // val7_1 ? val7=(" <font color=\"lightgreen\"> ")+"ON" : val7=(" <font color=\"red\"> ")+"OFF";
                             
                          //   let val7_1=getState(id.replace("INFO.Module","Switch1")).val;        
                          //   val7_1 ? val7=(" <font color=\"lightgreen\"> ")+"ON" : val7=(" <font color=\"red\"> ")+"OFF";
                            // val6=getState(id.replace("INFO.Module","SWITCH1")).val.toString();
                             //val7=getState(id.replace("INFO.Module","ENERGY_Total")).val.toString();
                            // ida[2].includes("Bridge") ?  val6=getState(id.replace("alive","RfReceived_Data")).val : val6="";
                             
                             
                           
                             if (!getState(id).val) {
                                 val1="❌";
                                 val4=(" <font color=\"red\"> ")+val4;
                                 val2=(" <font color=\"red\"> ")+val1;
                                 val3=(" <font color=\"red\"> ")+" 0 %";
                                 val5=(" <font color=\"red\"> ")+" --- ";
                                 val6=(" <font color=\"red\"> ")+" --- ";
                                 val7=(" <font color=\"red\"> ")+" --- ";
                                 val0=(" <font color=\"red\"> ")+val0} 
                             else{
                                 val1="✅";
                                // val1=(" <font color=\"lightgreen\"> ")+val1
                                // val2=(" <font color=\"green\"> ")+val2
                                // val3=(" <font color=\"green\"> ")+val3
                                // val0=(" <font color=\"green\"> ")+val0
                                }
                            
                         
                      
                        tabelleBind(); //HIER NICHTS ÄNDERN : HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT  - diese function muss als letztes in der eigenen schleife aufgerufen werden
                         }
                      }); //Schleifen Ende - je nach schleifenart muss hier etwas geändert werden !!!!!!!!!
                    
                    } //ende xiaomi
                    
                    //   if (AkkuAlarm.length >=1 ) {setState(dpAlarm,AkkuAlarm.length)} else {setState(dpAlarm,AkkuAlarm.length)}
                      // log("BATTERIE Alarm     : "+AkkuAlarm.length.toString());
                    //-------------------------------------------------------------------------------------------------------------------------------------------------
                    //--------------------------------------------------Ende der schleife------------------------------------------------------------------------------
                    //-------------------------------------------------------------------------------------------------------------------------------------------------
                    
                       tabelleFinish(); // AB HIER NICHTS ÄNDERN - tabelle fertigstellen
                    
                       setState(dpAnzahl,anzahl); 
                    
                      
                    
                    } // function ende
                    
                    
                    
                    //MAIN:
                    
                    schedule(mySchedule,  function () {
                    writeHTML();
                    if (braucheEinFile) {writeFile(home, path ,htmlOut, function (error) { /* log('file written');*/  });}
                    }); 
                    writeHTML();
                    
                      				 function tabelleBind(){
                        //HIER WERDEN DIE DATEN DER SCHLEIFE ZUSAMMENGESETZT - hat man oben 5 Felder definiert, braucht man hier 5 Werte
                      
                          switch (mehrfachTabelle) {  
                            case 1:                    htmlOut=htmlOut+"<tr><td align="+Feld1lAlign+" >&ensp;"+val0+"&ensp;</td><td align="+Feld2lAlign+">&ensp;"+val1+"&ensp;</td><td align="+Feld3lAlign+">&ensp;"+val2+"&ensp;</td><td align="+Feld4lAlign+">&ensp;"+val3+"&ensp;</td><td align="+Feld5lAlign+">&ensp;"+val4+"&ensp;</td><td align="+Feld6lAlign+">&ensp;"+val5+"&ensp;</td><td align="+Feld7lAlign+">&ensp;"+val6+"&ensp;</td><td align="+Feld8lAlign+">&ensp;"+val7+"&ensp;</td></tr>"; break;
                           case 2:  if(counter%2==0)  {htmlOut = htmlOut+"<tr><td align="+Feld1lAlign+" >&ensp;"+val0+"&ensp;</td><td align="+Feld2lAlign+">&ensp;"+val1+"&ensp;</td><td align="+Feld3lAlign+">&ensp;"+val2+"&ensp;</td><td align="+Feld4lAlign+">&ensp;"+val3+"&ensp;</td><td align="+Feld5lAlign+">&ensp;"+val4+"&ensp;</td><td align="+Feld6lAlign+">&ensp;"+val5+"&ensp;</td><td align="+Feld7lAlign+">&ensp;"+val6+"&ensp;</td><td align="+Feld8lAlign+">&ensp;"+val7+"&ensp;</td>"; } 
                                                 else {htmlOut = htmlOut+"<td align="+Feld1lAlign+"  style=\"color:"+htmlFarbFelderschrift2+"\">&ensp;"+val0+"&ensp;</td><td  align="+Feld2lAlign+" style=\"color:"+htmlFarbFelderschrift2+"\">&ensp;"+val1+"&ensp;</td><td  align="+Feld3lAlign+" style=\"color:"+htmlFarbFelderschrift2+"\">&ensp;"+val2+"&ensp;</td><td  align="+Feld4lAlign+" style=\"color:"+htmlFarbFelderschrift2+"\">&ensp;"+val3+"&ensp;</td><td align="+Feld5lAlign+">&ensp;"+val4+"&ensp;</td><td align="+Feld6lAlign+">&ensp;"+val5+"&ensp;</td><td align="+Feld7lAlign+">&ensp;"+val6+"&ensp;</td><td align="+Feld8lAlign+">&ensp;"+val7+"&ensp;</td></tr>";} break;
                                                      
                           case 3: if(counter%3==0 )  {htmlOut = htmlOut+"<tr><td align="+Feld1lAlign+" >&ensp;"+val0+"&ensp;</td><td align="+Feld2lAlign+">&ensp;"+val1+"&ensp;</td><td align="+Feld3lAlign+">&ensp;"+val2+"&ensp;</td><td align="+Feld4lAlign+">&ensp;"+val3+"&ensp;</td><td align="+Feld5lAlign+">&ensp;"+val4+"&ensp;</td><td align="+Feld6lAlign+">&ensp;"+val5+"&ensp;</td><td align="+Feld7lAlign+">&ensp;"+val6+"&ensp;</td><td align="+Feld8lAlign+">&ensp;"+val7+"&ensp;</td>"; } 
                                                 else { if(counter%3==1 )  { htmlOut = htmlOut+"<td align="+Feld1lAlign+"  style=\"color:"+htmlFarbFelderschrift2+"\">&ensp;"+val0+"&ensp;</td><td  align="+Feld2lAlign+" style=\"color:"+htmlFarbFelderschrift2+"\">&ensp;"+val1+"&ensp;</td><td  align="+Feld3lAlign+" style=\"color:"+htmlFarbFelderschrift2+"\">&ensp;"+val2+"&ensp;</td><td  align="+Feld4lAlign+" style=\"color:"+htmlFarbFelderschrift2+"\">&ensp;"+val3+"&ensp;</td><td align="+Feld5lAlign+">&ensp;"+val4+"&ensp;</td><td align="+Feld6lAlign+">&ensp;"+val5+"&ensp;</td><td align="+Feld7lAlign+">&ensp;"+val6+"&ensp;</td><td align="+Feld8lAlign+">&ensp;"+val7+"&ensp;</td>";} 
                                                                  else    {htmlOut = htmlOut+"<td align="+Feld1lAlign+" >&ensp;"+val0+"&ensp;</td><td align="+Feld2lAlign+">&ensp;"+val1+"&ensp;</td><td align="+Feld3lAlign+">&ensp;"+val2+"&ensp;</td><td align="+Feld4lAlign+">&ensp;"+val3+"&ensp;</td><td align="+Feld5lAlign+">&ensp;"+val4+"&ensp;</td><td align="+Feld6lAlign+">&ensp;"+val5+"&ensp;</td><td align="+Feld7lAlign+">&ensp;"+val6+"&ensp;</td><td align="+Feld8lAlign+">&ensp;"+val7+"&ensp;</td></tr>";}
                                                            } break;
                    
                    
                           case 4: if(counter%4==0)  {htmlOut = htmlOut+"<tr><td align="+Feld1lAlign+" >&ensp;"+val0+"&ensp;</td><td align="+Feld2lAlign+">&ensp;"+val1+"&ensp;</td><td align="+Feld3lAlign+">&ensp;"+val2+"&ensp;</td><td align="+Feld4lAlign+">&ensp;"+val4+"&ensp;</td><td align="+Feld5lAlign+">&ensp;"+val3+"&ensp;</td><td align="+Feld6lAlign+">&ensp;"+val5+"&ensp;</td><td align="+Feld7lAlign+">&ensp;"+val6+"&ensp;</td><td align="+Feld8lAlign+">&ensp;"+val7+"&ensp;</td>"; } 
                                                     else {if(counter%2==1 )  { htmlOut = htmlOut+"<td  align="+Feld1lAlign+" style=\"color:"+htmlFarbFelderschrift2+"\">&ensp;"+val0+"&ensp;</td><td  align="+Feld2lAlign+" style=\"color:"+htmlFarbFelderschrift2+"\">&ensp;"+val1+"&ensp;</td><td  align="+Feld3lAlign+" style=\"color:"+htmlFarbFelderschrift2+"\">&ensp;"+val2+"&ensp;</td><td  align="+Feld4lAlign+" style=\"color:"+htmlFarbFelderschrift2+"\">&ensp;"+val3+"&ensp;</td><td align="+Feld5lAlign+">&ensp;"+val4+"&ensp;</td><td align="+Feld6lAlign+">&ensp;"+val5+"&ensp;</td><td align="+Feld7lAlign+">&ensp;"+val6+"&ensp;</td><td align="+Feld8lAlign+">&ensp;"+val7+"&ensp;</td>";} 
                                                                  else    {if(counter%2==1 && counter%4==3)  { htmlOut= htmlOut+"<td align="+Feld1lAlign+"  style=\"color:"+htmlFarbFelderschrift2+"\">&ensp;"+val0+"&ensp;</td><td  align="+Feld2lAlign+" style=\"color:"+htmlFarbFelderschrift2+"\">&ensp;"+val1+"&ensp;</td><td align="+Feld3lAlign+" style=\"color:"+htmlFarbFelderschrift2+"\">&ensp;"+val2+"&ensp;</td><td  align="+Feld4lAlign+" style=\"color:"+htmlFarbFelderschrift2+"\">&ensp;"+val3+"&ensp;</td><td align="+Feld5lAlign+">&ensp;"+val4+"&ensp;</td><td align="+Feld6lAlign+">&ensp;"+val5+"&ensp;</td><td align="+Feld7lAlign+">&ensp;"+val6+"&ensp;</td><td align="+Feld8lAlign+">&ensp;"+val7+"&ensp;</td></tr>";} 
                                                                                    else    {htmlOut = htmlOut = htmlOut+"<td align="+Feld1lAlign+" >&ensp;"+val0+"&ensp;</td><td>&ensp;"+val1+"&ensp;</td><td align="+Feld2lAlign+">&ensp;"+val2+"&ensp;</td><td align="+Feld3lAlign+">&ensp;"+val3+"&ensp;</td><td align="+Feld4lAlign+">&ensp;"+val4+"&ensp;</td><td align="+Feld6lAlign+">&ensp;"+val5+"&ensp;</td><td align="+Feld7lAlign+">&ensp;"+val6+"&ensp;</td><td align="+Feld8lAlign+">&ensp;"+val7+"&ensp;</td>";}}
                                                            } break;
                    
                        } //switch ende
                    
                    
                    
                    }
                    
                    function tabelleAusbessern() {
                               switch (mehrfachTabelle) {  
                            case 1:    break;
                            case 2:    mix=Math.abs(((counter+1)%2)-mehrfachTabelle);  
                                       if(mix==1)  htmlOut = htmlOut.replace(/<\/td>$/, '</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td></tr>');       
                                       break;
                            case 3:    mix =Math.abs(((counter+1)%3)-mehrfachTabelle);
                                       if(mix==1)  htmlOut = htmlOut.replace(/<\/td>$/, '</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td></tr>');       
                                       if(mix==2)  htmlOut = htmlOut.replace(/<\/td>$/, '</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td></tr>');   
                                       break;
                            case 4:    mix=Math.abs(((counter+1)%4)-mehrfachTabelle);
                                       if(mix==1)  htmlOut = htmlOut.replace(/<\/td>$/, '</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td></tr>');
                                       if(mix==2)  htmlOut = htmlOut.replace(/<\/td>$/, '</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td></tr>');    
                                       if(mix==3)  htmlOut = htmlOut.replace(/<\/td>$/, '</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td></tr>');      
                                       break; }
                    }
                    
                    function tabelleFinish() {
                    
                         // tabelle fertigstellen
                          switch (mehrfachTabelle) {  
                            case 1:    break;
                            case 2:    mix=Math.abs(((counter+1)%2)-mehrfachTabelle);  
                                       if(mix==1)  htmlOut = htmlOut.replace(/<\/td>$/, '</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td></tr>');       
                                       break;
                            case 3:    mix =Math.abs(((counter+1)%3)-mehrfachTabelle);
                                       if(mix==1)  htmlOut = htmlOut.replace(/<\/td>$/, '</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td></tr>');       
                                       if(mix==2)  htmlOut = htmlOut.replace(/<\/td>$/, '</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td></tr>');   
                                       break;
                            case 4:    mix=Math.abs(((counter+1)%4)-mehrfachTabelle);
                                       if(mix==1)  htmlOut = htmlOut.replace(/<\/td>$/, '</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td></tr>');
                                       if(mix==2)  htmlOut = htmlOut.replace(/<\/td>$/, '</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td></tr>');    
                                       if(mix==3)  htmlOut = htmlOut.replace(/<\/td>$/, '</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td><td>&ensp;</td></tr>');      
                                       break; }
                        
                                       var htmlUeber=    "<p style=\"color:"+htmlFarbUber+"; font-family:"+htmlSchriftart+"; font-size: "+htmlÜberFontGroesse+"; font-weight:"+htmlSchriftWeite+ "\">"+htmlFeldUeber+"&ensp;&ensp;Last Update: "+formatDate(getDateObject((parseFloat((new Date().getTime())))), "SS:mm:ss");+"</p>"; 
                          var htmlUnter= "<div  style=\"color:"+htmlFarbUber+"; font-family:"+htmlSchriftart+"; font-size: 70%; text-align: right;\" >"+htmlFeldUeber+"&ensp;&ensp;Last Update: "+formatDate(getDateObject((parseFloat((new Date().getTime())))), "SS:mm:ss");+"</div>"
                           
                           if (!htmlSignature) htmlUnter="";
                             //Ausgabe über VIS html widget - tabelle in datenpunkt schreiben - html tabelle ohne html header und body
                              var htmlOutVIS="";
                            //  htmlUberschrift ? htmlOutVIS=htmlUeber+htmlTabStyle+htmlTabUeber+htmlOut+"</table>" : htmlOutVIS=htmlTabStyle+htmlTabUeber+htmlOut+"</table>";
                               if (htmlUberschrift) 
                                   { zentriert ? htmlOutVIS=htmlZentriert+htmlUeber+htmlTabStyle+htmlTabUeber+htmlOut+"</table>"+htmlUnter : htmlOutVIS=htmlUeber+htmlTabStyle+htmlTabUeber+htmlOut+"</table>"+htmlUnter ;
                    
                                 } else {
                                  zentriert ?  htmlOutVIS=htmlZentriert+htmlTabStyle+htmlTabUeber+htmlOut+"</table>"+htmlUnter :  htmlOutVIS=htmlTabStyle+htmlTabUeber+htmlOut+"</table>"+htmlUnter;
                    
                                    }
                    
                    // log("bin raus aus tabelleBind");
                              if (braucheEinVISWidget) setState(dpVIS, htmlOutVIS );
                    
                    var htmlUnter= "<div  style=\"color:"+htmlFarbUber+"; font-family:"+htmlSchriftart+"; font-size: 80%;  text-align: center; \" >"+htmlFeldUeber+"&ensp;&ensp;Last Update: "+formatDate(getDateObject((parseFloat((new Date().getTime())))), "SS:mm:ss");+"</div>"
                    var htmlEnd="</table>"+htmlUnter+"</div></body>";
                    if (!htmlSignature) htmlUnter="";
                    
                    //mit oder ohne überschrift - zentriert oder links
                    htmlUberschrift ? htmlOut=htmlStart+htmlUeber+htmlTabStyle+htmlTabUeber+htmlOut+htmlEnd : htmlOut=htmlStart+htmlTabStyle+htmlTabUeber+htmlOut+htmlEnd;
                    //log(htmlOut);
                    
                    
                    
                    }
                    
                    
                    
                    
                    


                    Ich habe die Power Werte ganz weggelassen. Die benötige ich nicht, da ich eigentlich nur die Übersicht möchte. Also von Spalte 1 bis Spalte 6. Aber ich schaffe es nicht die Spalten zu löschen.

                    liv-in-sky 1 Reply Last reply Reply Quote 0
                    • ?
                      A Former User @liv-in-sky last edited by

                      @liv-in-sky Hallo, nur ganz kurz. Meine beiden Geräte werden jetzt angezeigt; aber das liegt sicher auch daran, dass meine Versionen <8.x.x.x sind.

                      Nur zur Info mein Screen:
                      Bildschirmfoto 2020-01-15 um 06.02.01.JPG

                      1 Reply Last reply Reply Quote 0
                      • ?
                        A Former User last edited by

                        Hallo

                        ich hänge mich auch mal dazu. Ich habe eine POW R2 und die wird nicht angezeigt. Einfach nur als Hinweis und Kritik. Ich hänge mal zwei Bildschirmauszüge an.
                        Dazu noch wird bei der S2X und dem WLAN die uptime angezeigt 🙂

                        Bildschirmfoto 2020-01-15 um 08.40.30.JPG

                        Bildschirmfoto 2020-01-15 um 08.39.57.JPG

                        1 Reply Last reply Reply Quote 0
                        • liv-in-sky
                          liv-in-sky @Chaot last edited by liv-in-sky

                          @Chaot sagte in Sonoff Geräte als HTML Tabelle - Vis - Iqontrol:

                          Ich habe die Power Werte ganz weggelassen. Die benötige ich nicht, da ich eigentlich nur die Übersicht möchte. Also von Spalte 1 bis Spalte 6. Aber ich schaffe es nicht die Spalten zu löschen.

                          willst du die ganzen letzten beiden spalten nicht haben oder mit leerzeichen bestückt ? wenn du 2 werte weniger haben möchtest, brauchst du ein anderes script, diese rauszulöschen ist nicht so einfach

                          wenn du aber eine version mit 6 werten haben willst, kann ich die dir machen (ist kein so großer aufwand)- ich würde aber gerne vorher noch mehr geräte integrieren wollen, und dann erst eine kleinere version erstellen - sonst muß ich alle doppelt pflegen was hälst du davon

                          ich könnte uch gut ein paar bilder von dir brauchen - von den datenpunkten deiner oben aufgelisteten devices
                          Sonoff SV
                          Sonoff T1 1CH
                          oder Sonoff DEV
                          so wie im post darüber nur mit allen datenpunkte pro device mit dem genauen inhalt von INFO.Module
                          die könnte ich noch einbinden

                          @HeinrichB S2X wird korrigiert und ist der pow R2 nehme ich an, hat die selben datenpunkte wie der pow - wird auch integriert

                          @Alina du kannst ganz oben im script definieren, welche devices du nicht haben willst - dann verschwinden auch die überschriften für diese geräte und ich glaube nicht, dass es um die version geht (<8.x) - die datenpunkte sollten für jede version gleich sein

                          Image 1.png

                          nach dem integrieren der neuen devices (von @Chaot ) gibt es dann wieder ein script update)

                          6 spalten

                          Image 2.png

                          ? Chaot ? 3 Replies Last reply Reply Quote 0
                          • Meister Mopper
                            Meister Mopper @liv-in-sky last edited by

                            @liv-in-sky sagte in Sonoff Geräte als HTML Tabelle - Vis - Iqontrol:

                            habt ihr auch sonoff geräte, die kein info als ordner in den datenpunkten haben ?

                            Tatsächlich habe ich nur einen Sonoff, der noch einen Info-Ordner hat. Gestern waren es noch eine Menge mehr. Habe vorhin alle Sonoff-Objekte gelöscht. Nach Neustart des Adapters baut er die Objekt auf, aber in den meisten Fällen ohne Info-Ordner.

                            liv-in-sky 1 Reply Last reply Reply Quote 0
                            • liv-in-sky
                              liv-in-sky @Meister Mopper last edited by

                              @Meister-Mopper hast du dann mal die sonoffs vom strom genommen - hat bei mir geholfen - bei fast allen

                              Meister Mopper Lenny.CB 2 Replies Last reply Reply Quote 0
                              • Meister Mopper
                                Meister Mopper @liv-in-sky last edited by

                                @liv-in-sky Tatsächlich, das ist die Lösung. Habe den einzigen mit Info gestern Abend frisch geplugged. Aber es geht offenbar auch mit Neustart des Sonoff.

                                liv-in-sky 1 Reply Last reply Reply Quote 0
                                • ?
                                  A Former User @liv-in-sky last edited by

                                  @liv-in-sky Perfekt. Vielen Dank :))

                                  1 Reply Last reply Reply Quote 0
                                  • liv-in-sky
                                    liv-in-sky @Meister Mopper last edited by

                                    @Meister-Mopper hast du noch devices, die nicht eingebunden sind- dann bitte auch die datenpunkte davon

                                    1 Reply Last reply Reply Quote 0
                                    • Lenny.CB
                                      Lenny.CB Most Active @liv-in-sky last edited by

                                      @liv-in-sky tolle Übersicht. Danke dafür!
                                      Hatte das grad mal probiert. Ich habe 2 Devices die nicht auftauchen:

                                      Sonoff Dual R2
                                      Sonoff 4CH
                                      

                                      wenn Du die auch implementieren willst, nützen Dir meine DP was?

                                      -->Sonoff Dual R2
                                      770a5a95-9966-4ebe-afdb-3e7dd34d2383-image.png

                                      --> Sonoff 4CH
                                      ecbbcfbd-a11d-4071-bbcb-54e73402bb89-image.png

                                      Grüße, Lenny

                                      liv-in-sky 1 Reply Last reply Reply Quote 1
                                      • liv-in-sky
                                        liv-in-sky @Lenny.CB last edited by

                                        @Lenny-CB was ich noch bräuchte ist die bezeichnung, die in INFO.Module steht

                                        Lenny.CB 1 Reply Last reply Reply Quote 0
                                        • Lenny.CB
                                          Lenny.CB Most Active @liv-in-sky last edited by

                                          @liv-in-sky sagte in Sonoff Geräte als HTML Tabelle - Vis - Iqontrol:

                                          @Lenny-CB was ich noch bräuchte ist die bezeichnung, die in INFO.Module steht

                                          Bitte schön. 🙂

                                          1ab3befc-547d-4f89-97a3-7ca54b5f9597-image.png
                                          b70b74ce-c200-4220-ad6b-754009e84141-image.png

                                          liv-in-sky 2 Replies Last reply Reply Quote 0
                                          • liv-in-sky
                                            liv-in-sky @Lenny.CB last edited by

                                            @Lenny-CB beim 4ch geht mir der platz aus für die anzeige der power zustände - sollen wir die power1 und 2 drinlassen oder auch entfernen -. was denkst du

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            810
                                            Online

                                            31.7k
                                            Users

                                            79.8k
                                            Topics

                                            1.3m
                                            Posts

                                            javascript monitoring template
                                            33
                                            629
                                            102634
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo