HM-DIS-WM55 Seitenweise blättern und Aktionen ausführen

Problemlösungen und Hinweise von allgemeinem Interesse zur Haussteuerung mit HomeMatic

Moderator: Co-Administratoren

ElmoS04
Beiträge: 92
Registriert: 20.08.2015, 09:46

Re: HM-DIS-WM55 Seitenweise blättern und Aktionen ausführen

Beitrag von ElmoS04 » 02.12.2015, 10:30

Ich bin sehr glücklich mit dem Skript. Nur manchmal stosse ich doch an meine Grenzen.
Bin halt wirklich kein Programmierer.
Ich habe dieses Tolle Skript gefunden.

Code: Alles auswählen

! ### Homatic-Statusanzeige HM-Dis-WM55 ####
! ### Stausanzeige 2 , Vers. 1.0;
! ### Anzeige Außentemperatur, Status der Türen, Fenster und Lichter
!! Display 1 Taste2 kurz                                                        
!! 
!! Universalprogramm zum Füllen                                                  
!! (c) DrTob 
!! optimized by thkl
!! 
!! überarbeitet geosshark 30.12.2014 11:48:00
!! Anzeige der Aussentemperatur und der Stati aller Fenster, die mit dem 
!! Drehgriffsensor (nur mit diesem getestet) ausgerüstet sind.
!! Alle Sensoren müssen im Gewerk "Verschluss" sein.
!! Die Namenskonvention der Sensoren : z.B. xx_Bad_yyy_zz..., der 2. mit "_" getrennt Parameter wird angezeigt, hier "Bad".
!! (lötix)geändert: Gewerk Fenster in Verschluss, Unterstrich in Leerzeichen, alles geschlossen-zweizeilig, HM-Sec-SCo und HM-Sec-SC-2 eingefügt
!! Das Script holt sich jetzt die Seriennummer des Displays selbst aus der Auslösebedingung des Programms

! Farben
! 0x80 weiß
! 0x81 rot
! 0x82 orange
! 0x83 gelb
! 0x84 gruen
! 0x85 blau 
string weiss  = "0x80";
string rot    = "0x81";
string orange = "0x82";
string gelb   = "0x83";
string gruen  = "0x84";
string blau   = "0x85";

! Symbole 
! 
! 0x80 AUS
! 0x81 EIN
! 0x82 OFFEN
! 0x83 geschlossen
! 0x84 fehler
! 0x85 alles ok
! 0x86 information
! 0x87 neue nachricht
! 0x88 servicemeldung
! 0x89 Signal grün
! 0x8A Signal gelb
! 0x8B Signal rot

! Zugriff auf vordefinierte Texte
! 
! 0x80 Text  0 (Kanal 1  Text Zeile 1)
! 0x81 Text  1 (Kanal 1  Text Zeile 2)
! 0x82 Text  2 (Kanal 2  Text Zeile 3)
! 0x83 Text  3 (Kanal 2  Text Zeile 4)
! 0x84 Text  4 (Kanal 3  Text Zeile 5)
! 0x85 Text  5 (Kanal 3  Text Zeile 6)
! 0x86 Text  6 (Kanal 4  Text Zeile 7)
! 0x87 Text  7 (Kanal 4  Text Zeile 8)
! 0x88 Text  8 (Kanal 5  Text Zeile 9)
! 0x89 Text  9 (Kanal 5  Text Zeile 10)
! 0x8A Text 10 (Kanal 6  Text Zeile 11)
! 0x8B Text 11 (Kanal 6  Text Zeile 12)
! 0x8C Text 12 (Kanal 7  Text Zeile 13)
! 0x8D Text 13 (Kanal 7  Text Zeile 14)
! 0x8E Text 14 (Kanal 8  Text Zeile 15)
! 0x8F Text 15 (Kanal 8  Text Zeile 16)
! 0x90 Text 16 (Kanal 9  Text Zeile 17)
! 0x91 Text 17 (Kanal 9  Text Zeile 18)
! 0x92 Text 18 (Kanal 10 Text Zeile 19)
! 0x93 Text 19 (Kanal 10 Text Zeile 20)

! ==================================================================================================
var istTemp = dom.GetObject("BidCos-RF.MEQ0477861:1.TEMPERATURE").State();

string zeile1 = "Wohnzimmer.";
string color1 = "0x80";
string  icon1 = "";

string zeile2 = istTemp.ToString(1) # " C";
if (istTemp >= 0.0)  { string color2 = orange; }
if (istTemp >= 10.0) { string color2 = gelb; }
if (istTemp >= 20.0) { string color2 = rot; }
if (istTemp < 0.0)   { string color2 = weiss; }
if (istTemp < -6.0)  { string color2 = blau; }
string icon2 = "";
! ----------------------------------------------------------------------------------------
var fem = dom.GetObject("Verschluss");
string m;
string listg;
string listo;
string Wo;
integer status = 0;
string nam;
string zeil = "";

listo = "";
listg = "";

foreach(m, fem.EnumUsedIDs())
{
  var item = dom.GetObject(m);
  if(item.IsTypeOf(OT_CHANNEL))
  {
    var dev = dom.GetObject(item.Device());
    if((dev.HssType()=="HM-Sec-RHS"))
    {
      var stat = item.DPByHssDP("STATE");
      if(stat.Value()== '0')               
      {
        status = status + 0;   ! geschlossen
      }
      if (stat.Value()== '1')     
      {
         status = status + 1;   ! gekippt
         Wo = dev.Name();
         Wo = Wo.StrValueByIndex(" ", 1);
         listg = listg + Wo # ",";
      }
      if (stat.Value()== '2')     
      {
         status = status + 1000;   ! offen
         Wo = dev.Name();
         Wo = Wo.StrValueByIndex(" ", 1);
        listo = listo + Wo # ",";
      }
    }
    if((dev.HssType()=="HM-Sec-SCO") || (dev.HssType()=="HM-Sec-SC-2"))
    {
      var stat = item.DPByHssDP("STATE");
      if(stat.Value()== '0')               
      {
        status = status + 0;   ! geschlossen
      }
      if (stat.Value()== '2')     
      {
         status = status + 1000;   ! offen
         Wo = dev.Name();
         Wo = Wo.StrValueByIndex(" ", 1);
        listo = listo + Wo # ",";
      }          
    }
  }
}

string zeile3 = "Verschluss:";
string color3 = "0x80";
string icon3  = "";

! if (status < 1000)
! {   ! mindestens 1 gekippt
!    string zeile4 = "gekippt:";
!    string color4 = "0x83";
!    string icon4  = "";
! } 
! 
! if (status >= 1000)
! {   ! mindestens 1 offen
!    string zeile4 = "offen:";
!    string color4 = "0x81";
!    string icon4  = "";
! }   
string zeile4 = "";
string color4 = "";
string  icon4 = "";

string zeile5 = "";
string color5 = "";
string  icon5 = "";

string zeile6 = "";
string color6 = "";
string  icon6   = "";

if ( status == 0)
{      
   ! alles zu
   string zeile4 = "alles";
   string color4 = gruen;
   string  icon4 = "";
   string zeile5 = "geschlossen";
   string color5 = gruen;
   string icon5 = "";
}
else
{
   ! irgendwo was offen
   integer i = 4;
   foreach (nam, listo.Split(","))
   {
      if ((zeil.Length() + nam.Length()) < 12)
      {
         if (zeil == "")
         {
            zeil = nam;
         } 
         else 
         {
            zeil = zeil # "," # nam;
         }
      }
      else
      {

         if (i == 4)
         {
            string zeile4 = zeil;
            string color4 = rot;
            string  icon4 = "";         
         }
         if (i == 5)
         {
            string zeile5 = zeil;
            string color5 = rot;
            string  icon5 = "";         
         }
         if (i == 6)
         {
            string zeile6 = zeil;
            string color6 = rot;
            string  icon6 = "";         
         }
         zeil = nam;
         i = i + 1;
      }
   }
   if (zeil <> "")
   {
      if (i == 4)
      {
         string zeile4 = zeil;
         string color4 = rot;
         string  icon4 = "";         
      }
      if (i == 5)
      {
         string zeile5 = zeil;
         string color5 = rot;
         string  icon5 = "";         
      }
      if (i == 6)
      {
         string zeile6 = zeil;
         string color6 = rot;
         string  icon6 = "";         
      }
      zeil = "";
      i = i + 1;
      
   }

   foreach (nam, listg.Split(","))
   {
      if ((zeil.Length() + nam.Length()) < 12)
      {
         if (zeil == "")
         {
            zeil = nam;
         } 
         else 
         {
            zeil = zeil # "," # nam;
         }
      }
      else
      {
         if (i == 4)
         {
            string zeile4 = zeil;
            string color4 = gelb;
            string  icon4 = "";         
         }
         if (i == 5)
         {
            string zeile5 = zeil;
            string color5 = gelb;
            string  icon5 = "";         
         }
         if (i == 6)
         {
            string zeile6 = zeil;
            string color6 = gelb;
            string  icon6 = "";         
         }
         zeil = nam;
         i = i + 1;
      }
   }
   if (zeil <> "")
   {
         if (i == 4)
         {
            string zeile4 = zeil;
            string color4 = gelb;
            string  icon4 = "";         
         }
         if (i == 5)
         {
            string zeile5 = zeil;
            string color5 = gelb;
            string  icon5 = "";         
         }
         if (i == 6)
         {
            string zeile6 = zeil;
            string color6 = gelb;
            string  icon6 = "";         
         }
      zeil = "";
      i = i + 1;   
   }
}


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! System Routine do not change anything below !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

string splitter="|";
string msgBuffer = zeile1 # splitter # color1 # splitter # icon1 # "\t";
msgBuffer = msgBuffer # zeile2 # splitter # color2 # splitter # icon2 # "\t";
msgBuffer = msgBuffer # zeile3 # splitter # color3 # splitter # icon3 # "\t";
msgBuffer = msgBuffer # zeile4 # splitter # color4 # splitter # icon4 # "\t";
msgBuffer = msgBuffer # zeile5 # splitter # color5 # splitter # icon5 # "\t";
msgBuffer = msgBuffer # zeile6 # splitter # color6 # splitter # icon6 # "\t";

string substitutions = "A,0x41\tB,0x42\tC,0x43\tD,0x44\tE,0x45\tF,0x46\tG,0x47\tH,0x48\tI,0x49\tJ,0x4A\tK,0x4B\tL,0x4C\tM,0x4D\tN,0x4E\tO,0x4F\tP,0x50\tQ,0x51\tR,0x52\tS,0x53\tT,0x54\tU,0x55\tV,0x56\tW,0x57\tX,0x58\tY,0x59\tZ,0x5A";
substitutions = substitutions # "\ta,0x61\tb,0x62\tc,0x63\td,0x64\te,0x65\tf,0x66\tg,0x67\th,0x68\ti,0x69\tj,0x6A\tk,0x6B\tl,0x6C\tm,0x6D\tn,0x6E\to,0x6F\tp,0x70\tq,0x71\tr,0x72\ts,0x73\tt,0x74\tu,0x75\tv,0x76\tw,0x77\tx,0x78\ty,0x79\tz,0x7A";
substitutions = substitutions # "\t0,0x30\t1,0x31\t2,0x32\t3,0x33\t4,0x34\t5,0x35\t6,0x36\t7,0x37\t8,0x38\t9,0x39\t ,0x20\t!,0x21\t\",0x22\t%,0x25\t&,0x26\t=,0x27\t(,0x28\t),0x29\t*,0x2A\t+,0x2B\t,,0x2C\t-,0x2D\t.,0x2E\t/,0x2F";
substitutions = substitutions # "\tÄ,0x5B\tÖ,0x23\tÜ,0x24\tä,0x7B\tö,0x7C\tü,0x7D\tß,0x5F\t:,0x3A\t;,0x3B\t@,0x40\t>,0x3E"; 

string bufferLine;
string substEntry;

string command = "0x02";
integer i = 0;
string char = "";

foreach(bufferLine, msgBuffer) 
{
   string line = bufferLine.StrValueByIndex(splitter, 0);
   string color = bufferLine.StrValueByIndex(splitter, 1);
   string icon = bufferLine.StrValueByIndex(splitter, 2);
   if ((line <> "") || (icon <> "")) 
   {
      command = command # ",0x12";
      if ((line.Substr(0,2) == "0x") && (line.Length() == 4)) 
      {
         command = command # "," # line;
         i = 12;
      } else {
         i = 0;
      }
      while ((i < line.Length()) && (i < 12)) 
      { 
         char = line.Substr(i, 1);     
         foreach(substEntry, substitutions)
         {
            if (char == substEntry.Substr(0,1)){command = command # substEntry.Substr(1,5);}
         }
         i = i + 1; 
      }
      command = command # ",0x11," # color;
      if (icon <> "") 
      {
         command = command # ",0x13," # icon;
      }
    }
 command = command # ",0x0A";
}
command = command # ",0x0A,0x03";

dom.GetObject("BidCos-RF." # dom.GetObject("$src$").Name().StrValueByIndex(".",1) # ".SUBMIT").State(command);

Das geht super wenn es eigenständig als Programm erstellt wir. nur wenn es in dem Seitenweise Blättern Skript Auf z.B. Seite 4 Kopiert wird geht keine Seite mehr.
Es erscheint immer keine Daten.
Beim Skript Testen kommen auch etliches an Fehlermeldungen. Die ich natürlich nicht verstehe.

Code: Alles auswählen

Error 1 at row 348 col 48 near ^; }
if (istTemp >= 10.0) { string color2 = gelb; }
if (istTemp >= 20.0) { string
Error 1 at row 348 col 48 near ^; }
if (istTemp >= 10.0) { string color2 = gelb; }
if (istTemp >= 20.0) { string
Error 1 at row 348 col 48 near ^; }
if (istTemp >= 10.0) { string color2 = gelb; }
if (istTemp >= 20.0) { string
Parse following code failed:
! ### Homatic-Statusanzeige HM-Dis-WM55 ####
! ### Stausanzeige 2 , Vers. 1.0;
! ### Anzeige der Zysternen Füllstand, Zysternen Filter stand, Außentemperatur, Status der Türen, Fenster und Lichter

!! Universalprogramm zum Füllen 
!! (c) DrTob 
!! optimized by thkl
!! changed by wortmann30
!! Seitenzähler von Brufi

!! Das Script holt sich jetzt die Seriennummer des Displays selbst aus der Auslösebedinung des Programms

! Farben
! 0x80 weiß
! 0x81 rot
! 0x82 orange
! 0x83 gelb
! 0x84 gruen
! 0x85 blau 

! Symbole 
! 0x80 AUS
! 0x81 EIN
! 0x82 OFFEN
! 0x83 geschlossen
! 0x84 fehler
! 0x85 alles ok
! 0x86 information
! 0x87 neue nachricht
! 0x88 servicemeldung
! 0x89 Signal grün
! 0x8A Signal gelb
! 0x8B Signal rot

! Zugriff auf vordefinierte Texte
!
! 0x80 Text 0 (Kanal 1 Text Zeile 1)
! 0x81 Text 1 (Kanal 1 Text Zeile 2)
! 0x82 Text 2 (Kanal 2 Text Zeile 3)
! 0x83 Text 3 (Kanal 2 Text Zeile 4)
! 0x84 Text 4 (Kanal 3 Text Zeile 5)
! 0x85 Text 5 (Kanal 3 Text Zeile 6)
! 0x86 Text 6 (Kanal 4 Text Zeile 7)
! 0x87 Text 7 (Kanal 4 Text Zeile 8)
! 0x88 Text 8 (Kanal 5 Text Zeile 9)
! 0x89 Text 9 (Kanal 5 Text Zeile 10)
! 0x8A Text 10 (Kanal 6 Text Zeile 11)
! 0x8B Text 11 (Kanal 6 Text Zeile 12)
! 0x8C Text 12 (Kanal 7 Text Zeile 13)
! 0x8D Text 13 (Kanal 7 Text Zeile 14)
! 0x8E Text 14 (Kanal 8 Text Zeile 15)
! 0x8F Text 15 (Kanal 8 Text Zeile 16)
! 0x90 Text 16 (Kanal 9 Text Zeile 17)
! 0x91 Text 17 (Kanal 9 Text Zeile 18)
! 0x92 Text 18 (Kanal 10 Text Zeile 19)
! 0x93 Text 19 (Kanal 10 Text Zeile 20)

string zeile1 = "";
string color1 = "0x80";
string icon1 = "";

string zeile2 = "";
string color2 = "0x80";
string icon2 = "";

string zeile3 = "";
string color3 = "0x80";
string icon3 = "";

string zeile4 = "";
string color4 = "0x80";
string icon4 = "";

string zeile5 = "";
string color5 = "0x80";
string icon5 = "";

string zeile6 = "";
string color6 = "0x80";
string icon6 = "";

! ####### wie viele Seiten auf dem Display sollen durchlaufen werden? ###########

integer seitenzahl = 6; 

! ###############################################################
  
! ####################### Zähler entsprechend der Anzahl Tastendrücke verändern #################
  

integer obj = dom.GetObject("seitenzaehler01"); ! ######## rausholen

integer xyz = obj.State();


if (xyz == seitenzahl) {
  obj.Variable(1);
}
else {

  xyz = xyz + 1; ! ######## incrementieren
  obj.Variable(xyz); ! ######### reinschreiben
}

! ################################################################################################  
  

  
  
! --------- Anfang Ermitteln der Systemzustände und Zuweisung zu den einzelnen Zeilen -------------

! ### Systemvariable seitenzaehler01 holen ###

var seitenZaehler = dom.GetObject("seitenzaehler01");


! ###################### Seite 1 ######################
if (seitenZaehler.State()==1){
  
! ### Alarmanlage ####
  
zeile1 = "Alarmanlage";
color1 = "0x80";
icon1 = "";  

! #### Zeile 2 und 3 - Scharf oder Unscharf #######


var oSysvar = dom.GetObject("Alarm ist");
if (oSysvar.State()==1){

string zeile2  = "Scharf";
 color2 = "0x81";
icon2 = "";
zeile3 = "";
color3 = "0x81";
icon3 = "";
} 

else {
zeile2 = "Unscharf";
color2 = "0x84";
icon2 = "";
} 


! ### Alarm Bereit ####
  
var oSysvar = dom.GetObject("Alarm Bereit");
if (oSysvar.State()==2){



zeile4 = "Einschalt";
color4="0x81";
icon4 = "";
zeile5 = "Nicht Bereit";
color5="0x81";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";
}
else
{


zeile4 = "Einschalt";
color4="0x84";
icon4 = "";
zeile5 = "Bereit";
color5="0x84";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";
}
}


! ###################### Seite 2 ######################
if (seitenZaehler.State()==2){
  



! ### Meldung ####
  
zeile1 = "Meldung";
color1 = "0x80";
icon1 = "";  

! #### Zeile 2 und 3 - Scharf oder Unscharf #######


var oSysvar = dom.GetObject("Stiller Alarm");
if (oSysvar.State()==1){

string zeile2 = "Lautlos";
 color2 = "0x81";
icon2 = "";
zeile3 = "Achtung!";
color3 = "0x81";
icon3 = "";
zeile4 = "";
color4="0x81";
icon4 = "";
} 

else {
string zeile2 = "Akustisch";
 color2 = "0x84";
icon2 = "";
zeile3 = "Normal";
color3 = "0x84";
icon3 = "";
zeile4 = "";
color4="0x84";
icon4 = "";
} 


! ### Sirene ####
  
var oSysvar = dom.GetObject("Sirene Stumm");
if (oSysvar.State()==2){



zeile5 = "Sirene";
color5="0x80";
icon5 = "";
zeile6 = "-LAUT-";
color6="0x81";
icon6 = "";

}
else
{


zeile5 = "Sirene";
color5="0x80";
icon5 = "";
zeile6 = "-Stumm-";
color6="0x84";
icon6 = "";


}
}
  


! ###################### Seite 3 ######################

if (seitenZaehler.State()==3){

! ### Beleuchtung ####
  
zeile1 = "Beleuchtung";
color1 = "0x80";
icon1 = "";  

! #### Zeile 2 und 3 - Alle Fenster zu? Wie viele sind offen? #######
! # Gewerk mit dem Namen Verschluss wird gezählt

var obj = dom.GetObject("Lichter");
 string itemID;
 var cntopen=0;
 foreach(itemID, obj.EnumUsedIDs()) {
  var item = dom.GetObject(itemID);
  if(item.IsTypeOf(OT_CHANNEL))
  {
   var state=item.DPByHssDP("STATE");
   if(state.Value()<>0)
   {
     cntopen=cntopen+1;
   }
 }
}

if (cntopen>0) {
  zeile2 = cntopen # " Lampen";
  color2 = "0x81";
  icon2 = "";
  zeile3 = "Ein";
  color3 = "0x81";
  icon3 = "";
} 

else {
  zeile2 = "Lampen Aus";
  color2 = "0x84";
  icon2 = "";
} 

! ### Fenster ####
  
zeile4 = "Verschluss";
color4 = "0x80";
icon4 = "";  

! #### Zeile 5 und 6 - Alle Fenster zu? Wie viele sind offen? #######
! # Gewerk mit dem Namen Verschluss wird gezählt

var obj = dom.GetObject("Verschluss");
 string itemID;
 var cntopen=0;
 foreach(itemID, obj.EnumUsedIDs()) {
  var item = dom.GetObject(itemID);
  if(item.IsTypeOf(OT_CHANNEL))
  {
   var state=item.DPByHssDP("STATE");
   if(state.Value()<>0)
   {
     cntopen=cntopen+1;
   }
 }
}

if (cntopen>0) {
  zeile5 = cntopen # " Fenster";
  color5 = "0x81";
  icon5 = "";
  zeile6= "Offen";
  color6 = "0x81";
  icon6 = "";
} 

else {
  zeile5 = "Fenster Zu";
  color5 = "0x84";
  icon5 = "";

} 
} 

! ###################### Seite 4 ######################
if (seitenZaehler.State()==4){

var istTemp = dom.GetObject("BidCos-RF.MEQ0477861:1.TEMPERATURE").State();

string zeile1 = "Wohnzimmer.";
string color1 = "0x80";
string  icon1 = "";

string zeile2 = istTemp.ToString(1) # " C";
if (istTemp >= 0.0)  { string color2 = orange; }
if (istTemp >= 10.0) { string color2 = gelb; }
if (istTemp >= 20.0) { string color2 = rot; }
if (istTemp < 0.0)   { string color2 = weiss; }
if (istTemp < -6.0)  { string color2 = blau; }
string icon2 = "";
! ----------------------------------------------------------------------------------------
var fem = dom.GetObject("Verschluss");
string m;
string listg;
string listo;
string Wo;
integer status = 0;
string nam;
string zeil = "";

listo = "";
listg = "";

foreach(m, fem.EnumUsedIDs())
{
  var item = dom.GetObject(m);
  if(item.IsTypeOf(OT_CHANNEL))
  {
    var dev = dom.GetObject(item.Device());
    if((dev.HssType()=="HM-Sec-RHS"))
    {
      var stat = item.DPByHssDP("STATE");
      if(stat.Value()== '0')               
      {
        status = status + 0;   ! geschlossen
      }
      if (stat.Value()== '1')     
      {
         status = status + 1;   ! gekippt
         Wo = dev.Name();
         Wo = Wo.StrValueByIndex(" ", 1);
         listg = listg + Wo # ",";
      }
      if (stat.Value()== '2')     
      {
         status = status + 1000;   ! offen
         Wo = dev.Name();
         Wo = Wo.StrValueByIndex(" ", 1);
        listo = listo + Wo # ",";
      }
    }
    if((dev.HssType()=="HM-Sec-SCO") || (dev.HssType()=="HM-Sec-SC-2"))
    {
      var stat = item.DPByHssDP("STATE");
      if(stat.Value()== '0')               
      {
        status = status + 0;   ! geschlossen
      }
      if (stat.Value()== '2')     
      {
         status = status + 1000;   ! offen
         Wo = dev.Name();
         Wo = Wo.StrValueByIndex(" ", 1);
        listo = listo + Wo # ",";
      }          
    }
  }
}

string zeile3 = "Verschluss:";
string color3 = "0x80";
string icon3  = "";

! if (status < 1000)
! {   ! mindestens 1 gekippt
!    string zeile4 = "gekippt:";
!    string color4 = "0x83";
!    string icon4  = "";
! } 
! 
! if (status >= 1000)
! {   ! mindestens 1 offen
!    string zeile4 = "offen:";
!    string color4 = "0x81";
!    string icon4  = "";
! }   
string zeile4 = "";
string color4 = "";
string  icon4 = "";

string zeile5 = "";
string color5 = "";
string  icon5 = "";

string zeile6 = "";
string color6 = "";
string  icon6   = "";

if ( status == 0)
{      
   ! alles zu
   string zeile4 = "alles";
   string color4 = gruen;
   string  icon4 = "";
   string zeile5 = "geschlossen";
   string color5 = gruen;
   string icon5 = "";
}
else
{
   ! irgendwo was offen
   integer i = 4;
   foreach (nam, listo.Split(","))
   {
      if ((zeil.Length() + nam.Length()) < 12)
      {
         if (zeil == "")
         {
            zeil = nam;
         } 
         else 
         {
            zeil = zeil # "," # nam;
         }
      }
      else
      {

         if (i == 4)
         {
            string zeile4 = zeil;
            string color4 = rot;
            string  icon4 = "";         
         }
         if (i == 5)
         {
            string zeile5 = zeil;
            string color5 = rot;
            string  icon5 = "";         
         }
         if (i == 6)
         {
            string zeile6 = zeil;
            string color6 = rot;
            string  icon6 = "";         
         }
         zeil = nam;
         i = i + 1;
      }
   }
   if (zeil <> "")
   {
      if (i == 4)
      {
         string zeile4 = zeil;
         string color4 = rot;
         string  icon4 = "";         
      }
      if (i == 5)
      {
         string zeile5 = zeil;
         string color5 = rot;
         string  icon5 = "";         
      }
      if (i == 6)
      {
         string zeile6 = zeil;
         string color6 = rot;
         string  icon6 = "";         
      }
      zeil = "";
      i = i + 1;
      
   }

   foreach (nam, listg.Split(","))
   {
      if ((zeil.Length() + nam.Length()) < 12)
      {
         if (zeil == "")
         {
            zeil = nam;
         } 
         else 
         {
            zeil = zeil # "," # nam;
         }
      }
      else
      {
         if (i == 4)
         {
            string zeile4 = zeil;
            string color4 = gelb;
            string  icon4 = "";         
         }
         if (i == 5)
         {
            string zeile5 = zeil;
            string color5 = gelb;
            string  icon5 = "";         
         }
         if (i == 6)
         {
            string zeile6 = zeil;
            string color6 = gelb;
            string  icon6 = "";         
         }
         zeil = nam;
         i = i + 1;
      }
   }
   if (zeil <> "")
   {
         if (i == 4)
         {
            string zeile4 = zeil;
            string color4 = gelb;
            string  icon4 = "";         
         }
         if (i == 5)
         {
            string zeile5 = zeil;
            string color5 = gelb;
            string  icon5 = "";         
         }
         if (i == 6)
         {
            string zeile6 = zeil;
            string color6 = gelb;
            string  icon6 = "";         
         }
      zeil = "";
      i = i + 1;   
   }
}

! ###################### Seite 5 ######################

if (seitenZaehler.State()==5){

! ### Anwesenheit ####
  
var oSysvar = dom.GetObject("Anwesenheit");
if (oSysvar.State()==1){

string zeile1 = "Anwesenheit:";
 color1 = "0x80";
icon1 = "";
zeile2 = "Anwesend";
color2 = "0x84";
icon2 = "";

} 

else {
string zeile1 = "Abwesenheit:";
color1 = "0x80";
icon1 = "";
zeile2 = "Abwesend";
color2 = "0x81";
icon2 = "";
} 


! ### Gong ####
  
var oSysvar = dom.GetObject("Gong");
if (oSysvar.State()==2){


zeile3 = "";
color3="0x80";
icon3 = "";
zeile4 = "Gong";
color4="0x80";
icon4 = "";
zeile5 = "Aus";
color5 = "0x81";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
color6 = "0x85";
icon6 = "";
}
else
{
zeile3 = "";
color3="0x80";
icon3 = "";
zeile4 = "Gong";
color4="0x80";
icon4 = "";
zeile5 = "Ein";
color5 = "0x84";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
color6 = "0x85";
icon6 = "";
}
}

! ###################### Seite 6 ######################

if (seitenZaehler.State()==6){
  
! ### Schlafen ####
  
zeile1 = "Schlafmodus:";
color1 = "0x80";
icon1 = "";  

! #### Zeile 2 und 3 - Schlafmodus #######


var oSysvar = dom.GetObject("Schlafmodus");
if (oSysvar.State()==1){

string zeile2  = "Schlafen";
 color2 = "0x81";
icon2 = "";
zeile3 = "";
color3 = "0x81";
icon3 = "";
} 

else {
zeile2 = "Wach";
color2 = "0x84";
icon2 = "";
} 


! ### Wecker ####
  
var oSysvar = dom.GetObject("Wecker");
if (oSysvar.State()==2){



zeile4 = "Wecker";
color4="0x80";
icon4 = "";
zeile5 = "Ein";
color5="0x84";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";
}
else
{


zeile4 = "Wecker";
color4="0x80";
icon4 = "";
zeile5 = "Aus";
color5="0x81";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";
}
}



! --------- Ende Ermitteln der Systemzustände und Zuweisung zu den einzelnen Zeilen -------------


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! System Routine do not change anything below !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

string splitter="|";
string msgBuffer = zeile1 # splitter # color1 # splitter # icon1 # "\t";
msgBuffer = msgBuffer # zeile2 # splitter # color2 # splitter # icon2 # "\t";
msgBuffer = msgBuffer # zeile3 # splitter # color3 # splitter # icon3 # "\t";
msgBuffer = msgBuffer # zeile4 # splitter # color4 # splitter # icon4 # "\t";
msgBuffer = msgBuffer # zeile5 # splitter # color5 # splitter # icon5 # "\t";
msgBuffer = msgBuffer # zeile6 # splitter # color6 # splitter # icon6;

string substitutions = "A,0x41\tB,0x42\tC,0x43\tD,0x44\tE,0x45\tF,0x46\tG,0x47\tH,0x48\tI,0x49\tJ,0x4A\tK,0x4B\tL,0x4C\tM,0x4D\tN,0x4E\tO,0x4F\tP,0x50\tQ,0x51\tR,0x52\tS,0x53\tT,0x54\tU,0x55\tV,0x56\tW,0x57\tX,0x58\tY,0x59\tZ,0x5A";
substitutions = substitutions # "\ta,0x61\tb,0x62\tc,0x63\td,0x64\te,0x65\tf,0x66\tg,0x67\th,0x68\ti,0x69\tj,0x6A\tk,0x6B\tl,0x6C\tm,0x6D\tn,0x6E\to,0x6F\tp,0x70\tq,0x71\tr,0x72\ts,0x73\tt,0x74\tu,0x75\tv,0x76\tw,0x77\tx,0x78\ty,0x79\tz,0x7A";
substitutions = substitutions # "\t0,0x30\t1,0x31\t2,0x32\t3,0x33\t4,0x34\t5,0x35\t6,0x36\t7,0x37\t8,0x38\t9,0x39\t ,0x20\t!,0x21\t\",0x22\t%,0x25\t&,0x26\t=,0x27\t(,0x28\t),0x29\t*,0x2A\t+,0x2B\t,,0x2C\t-,0x2D\t.,0x2E\t/,0x2F";
substitutions = substitutions # "\tÄ,0x5B\tÖ,0x23\tÜ,0x24\tä,0x7B\tö,0x7C\tü,0x7D\tß,0x5F\t:,0x3A\t;,0x3B\t@,0x40\t>,0x3E"; 

string bufferLine;
string substEntry;
integer i;
string char;
string line;
string icon;

string command = "0x02";
foreach(bufferLine, msgBuffer) {
   line = bufferLine.StrValueByIndex(splitter, 0);
   icon = bufferLine.StrValueByIndex(splitter, 2);
   if ((line <> "") || (icon <> "")) {
      command = command # ",0x12";
      if ((line.Substr(0,2) == "0x") && (line.Length() == 4)) {
         command = command # "," # line;
         i = 12;
      }
      else {
         i = 0;
      }
      while ((i < line.Length()) && (i < 12)) { 
         char = line.Substr(i, 1);     
         foreach(substEntry, substitutions){
            if (char == substEntry.Substr(0,1)){command = command # substEntry.Substr(1,5);}
         }
         i = i + 1; 
      }
      command = command # ",0x11," # bufferLine.StrValueByIndex(splitter, 1);
      if (icon <> "") {
         command = command # ",0x13," # icon;
      }
   }
   command = command # ",0x0A";
}
command = command # ",0x03";

dom.GetObject("BidCos-RF." # dom.GetObject("$src$").Name().StrValueByIndex(".",1) # ".SUBMIT").State(command);

! ##### FERTIG #####

Das kommt wenn ich es so auf Seite 4 Einfüge:

Code: Alles auswählen

! ### Homatic-Statusanzeige HM-Dis-WM55 ####
! ### Stausanzeige 2 , Vers. 1.0;
! ### Anzeige der Zysternen Füllstand, Zysternen Filter stand, Außentemperatur, Status der Türen, Fenster und Lichter

!! Universalprogramm zum Füllen 
!! (c) DrTob 
!! optimized by thkl
!! changed by wortmann30
!! Seitenzähler von Brufi

!! Das Script holt sich jetzt die Seriennummer des Displays selbst aus der Auslösebedinung des Programms

! Farben
! 0x80 weiß
! 0x81 rot
! 0x82 orange
! 0x83 gelb
! 0x84 gruen
! 0x85 blau 

! Symbole 
! 0x80 AUS
! 0x81 EIN
! 0x82 OFFEN
! 0x83 geschlossen
! 0x84 fehler
! 0x85 alles ok
! 0x86 information
! 0x87 neue nachricht
! 0x88 servicemeldung
! 0x89 Signal grün
! 0x8A Signal gelb
! 0x8B Signal rot

! Zugriff auf vordefinierte Texte
!
! 0x80 Text 0 (Kanal 1 Text Zeile 1)
! 0x81 Text 1 (Kanal 1 Text Zeile 2)
! 0x82 Text 2 (Kanal 2 Text Zeile 3)
! 0x83 Text 3 (Kanal 2 Text Zeile 4)
! 0x84 Text 4 (Kanal 3 Text Zeile 5)
! 0x85 Text 5 (Kanal 3 Text Zeile 6)
! 0x86 Text 6 (Kanal 4 Text Zeile 7)
! 0x87 Text 7 (Kanal 4 Text Zeile 8)
! 0x88 Text 8 (Kanal 5 Text Zeile 9)
! 0x89 Text 9 (Kanal 5 Text Zeile 10)
! 0x8A Text 10 (Kanal 6 Text Zeile 11)
! 0x8B Text 11 (Kanal 6 Text Zeile 12)
! 0x8C Text 12 (Kanal 7 Text Zeile 13)
! 0x8D Text 13 (Kanal 7 Text Zeile 14)
! 0x8E Text 14 (Kanal 8 Text Zeile 15)
! 0x8F Text 15 (Kanal 8 Text Zeile 16)
! 0x90 Text 16 (Kanal 9 Text Zeile 17)
! 0x91 Text 17 (Kanal 9 Text Zeile 18)
! 0x92 Text 18 (Kanal 10 Text Zeile 19)
! 0x93 Text 19 (Kanal 10 Text Zeile 20)

string zeile1 = "";
string color1 = "0x80";
string icon1 = "";

string zeile2 = "";
string color2 = "0x80";
string icon2 = "";

string zeile3 = "";
string color3 = "0x80";
string icon3 = "";

string zeile4 = "";
string color4 = "0x80";
string icon4 = "";

string zeile5 = "";
string color5 = "0x80";
string icon5 = "";

string zeile6 = "";
string color6 = "0x80";
string icon6 = "";

! ####### wie viele Seiten auf dem Display sollen durchlaufen werden? ###########

integer seitenzahl = 6; 

! ###############################################################
  
! ####################### Zähler entsprechend der Anzahl Tastendrücke verändern #################
  

integer obj = dom.GetObject("seitenzaehler01"); ! ######## rausholen

integer xyz = obj.State();


if (xyz == seitenzahl) {
  obj.Variable(1);
}
else {

  xyz = xyz + 1; ! ######## incrementieren
  obj.Variable(xyz); ! ######### reinschreiben
}

! ################################################################################################  
  

  
  
! --------- Anfang Ermitteln der Systemzustände und Zuweisung zu den einzelnen Zeilen -------------

! ### Systemvariable seitenzaehler01 holen ###

var seitenZaehler = dom.GetObject("seitenzaehler01");


! ###################### Seite 1 ######################
if (seitenZaehler.State()==1){
  
! ### Alarmanlage ####
  
zeile1 = "Alarmanlage";
color1 = "0x80";
icon1 = "";  

! #### Zeile 2 und 3 - Scharf oder Unscharf #######


var oSysvar = dom.GetObject("Alarm ist");
if (oSysvar.State()==1){

string zeile2  = "Scharf";
 color2 = "0x81";
icon2 = "";
zeile3 = "";
color3 = "0x81";
icon3 = "";
} 

else {
zeile2 = "Unscharf";
color2 = "0x84";
icon2 = "";
} 


! ### Alarm Bereit ####
  
var oSysvar = dom.GetObject("Alarm Bereit");
if (oSysvar.State()==2){



zeile4 = "Einschalt";
color4="0x81";
icon4 = "";
zeile5 = "Nicht Bereit";
color5="0x81";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";
}
else
{


zeile4 = "Einschalt";
color4="0x84";
icon4 = "";
zeile5 = "Bereit";
color5="0x84";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";
}
}


! ###################### Seite 2 ######################
if (seitenZaehler.State()==2){
  



! ### Meldung ####
  
zeile1 = "Meldung";
color1 = "0x80";
icon1 = "";  

! #### Zeile 2 und 3 - Scharf oder Unscharf #######


var oSysvar = dom.GetObject("Stiller Alarm");
if (oSysvar.State()==1){

string zeile2 = "Lautlos";
 color2 = "0x81";
icon2 = "";
zeile3 = "Achtung!";
color3 = "0x81";
icon3 = "";
zeile4 = "";
color4="0x81";
icon4 = "";
} 

else {
string zeile2 = "Akustisch";
 color2 = "0x84";
icon2 = "";
zeile3 = "Normal";
color3 = "0x84";
icon3 = "";
zeile4 = "";
color4="0x84";
icon4 = "";
} 


! ### Sirene ####
  
var oSysvar = dom.GetObject("Sirene Stumm");
if (oSysvar.State()==2){



zeile5 = "Sirene";
color5="0x80";
icon5 = "";
zeile6 = "-LAUT-";
color6="0x81";
icon6 = "";

}
else
{


zeile5 = "Sirene";
color5="0x80";
icon5 = "";
zeile6 = "-Stumm-";
color6="0x84";
icon6 = "";


}
}
  


! ###################### Seite 3 ######################

if (seitenZaehler.State()==3){

! ### Beleuchtung ####
  
zeile1 = "Beleuchtung";
color1 = "0x80";
icon1 = "";  

! #### Zeile 2 und 3 - Alle Fenster zu? Wie viele sind offen? #######
! # Gewerk mit dem Namen Verschluss wird gezählt

var obj = dom.GetObject("Lichter");
 string itemID;
 var cntopen=0;
 foreach(itemID, obj.EnumUsedIDs()) {
  var item = dom.GetObject(itemID);
  if(item.IsTypeOf(OT_CHANNEL))
  {
   var state=item.DPByHssDP("STATE");
   if(state.Value()<>0)
   {
     cntopen=cntopen+1;
   }
 }
}

if (cntopen>0) {
  zeile2 = cntopen # " Lampen";
  color2 = "0x81";
  icon2 = "";
  zeile3 = "Ein";
  color3 = "0x81";
  icon3 = "";
} 

else {
  zeile2 = "Lampen Aus";
  color2 = "0x84";
  icon2 = "";
} 

! ### Fenster ####
  
zeile4 = "Verschluss";
color4 = "0x80";
icon4 = "";  

! #### Zeile 5 und 6 - Alle Fenster zu? Wie viele sind offen? #######
! # Gewerk mit dem Namen Verschluss wird gezählt

var obj = dom.GetObject("Verschluss");
 string itemID;
 var cntopen=0;
 foreach(itemID, obj.EnumUsedIDs()) {
  var item = dom.GetObject(itemID);
  if(item.IsTypeOf(OT_CHANNEL))
  {
   var state=item.DPByHssDP("STATE");
   if(state.Value()<>0)
   {
     cntopen=cntopen+1;
   }
 }
}

if (cntopen>0) {
  zeile5 = cntopen # " Fenster";
  color5 = "0x81";
  icon5 = "";
  zeile6= "Offen";
  color6 = "0x81";
  icon6 = "";
} 

else {
  zeile5 = "Fenster Zu";
  color5 = "0x84";
  icon5 = "";

} 
} 

! ###################### Seite 4 ######################
if (seitenZaehler.State()==4){

var istTemp = dom.GetObject("BidCos-RF.MEQ0477861:1.TEMPERATURE").State();

string zeile1 = "Wohnzimmer.";
string color1 = "0x80";
string  icon1 = "";

string zeile2 = istTemp.ToString(1) # " C";
if (istTemp >= 0.0)  { string color2 = orange; }
if (istTemp >= 10.0) { string color2 = gelb; }
if (istTemp >= 20.0) { string color2 = rot; }
if (istTemp < 0.0)   { string color2 = weiss; }
if (istTemp < -6.0)  { string color2 = blau; }
string icon2 = "";
! ----------------------------------------------------------------------------------------
var fem = dom.GetObject("Verschluss");
string m;
string listg;
string listo;
string Wo;
integer status = 0;
string nam;
string zeil = "";

listo = "";
listg = "";

foreach(m, fem.EnumUsedIDs())
{
  var item = dom.GetObject(m);
  if(item.IsTypeOf(OT_CHANNEL))
  {
    var dev = dom.GetObject(item.Device());
    if((dev.HssType()=="HM-Sec-RHS"))
    {
      var stat = item.DPByHssDP("STATE");
      if(stat.Value()== '0')               
      {
        status = status + 0;   ! geschlossen
      }
      if (stat.Value()== '1')     
      {
         status = status + 1;   ! gekippt
         Wo = dev.Name();
         Wo = Wo.StrValueByIndex(" ", 1);
         listg = listg + Wo # ",";
      }
      if (stat.Value()== '2')     
      {
         status = status + 1000;   ! offen
         Wo = dev.Name();
         Wo = Wo.StrValueByIndex(" ", 1);
        listo = listo + Wo # ",";
      }
    }
    if((dev.HssType()=="HM-Sec-SCO") || (dev.HssType()=="HM-Sec-SC-2"))
    {
      var stat = item.DPByHssDP("STATE");
      if(stat.Value()== '0')               
      {
        status = status + 0;   ! geschlossen
      }
      if (stat.Value()== '2')     
      {
         status = status + 1000;   ! offen
         Wo = dev.Name();
         Wo = Wo.StrValueByIndex(" ", 1);
        listo = listo + Wo # ",";
      }          
    }
  }
}

string zeile3 = "Verschluss:";
string color3 = "0x80";
string icon3  = "";

! if (status < 1000)
! {   ! mindestens 1 gekippt
!    string zeile4 = "gekippt:";
!    string color4 = "0x83";
!    string icon4  = "";
! } 
! 
! if (status >= 1000)
! {   ! mindestens 1 offen
!    string zeile4 = "offen:";
!    string color4 = "0x81";
!    string icon4  = "";
! }   
string zeile4 = "";
string color4 = "";
string  icon4 = "";

string zeile5 = "";
string color5 = "";
string  icon5 = "";

string zeile6 = "";
string color6 = "";
string  icon6   = "";

if ( status == 0)
{      
   ! alles zu
   string zeile4 = "alles";
   string color4 = gruen;
   string  icon4 = "";
   string zeile5 = "geschlossen";
   string color5 = gruen;
   string icon5 = "";
}
else
{
   ! irgendwo was offen
   integer i = 4;
   foreach (nam, listo.Split(","))
   {
      if ((zeil.Length() + nam.Length()) < 12)
      {
         if (zeil == "")
         {
            zeil = nam;
         } 
         else 
         {
            zeil = zeil # "," # nam;
         }
      }
      else
      {

         if (i == 4)
         {
            string zeile4 = zeil;
            string color4 = rot;
            string  icon4 = "";         
         }
         if (i == 5)
         {
            string zeile5 = zeil;
            string color5 = rot;
            string  icon5 = "";         
         }
         if (i == 6)
         {
            string zeile6 = zeil;
            string color6 = rot;
            string  icon6 = "";         
         }
         zeil = nam;
         i = i + 1;
      }
   }
   if (zeil <> "")
   {
      if (i == 4)
      {
         string zeile4 = zeil;
         string color4 = rot;
         string  icon4 = "";         
      }
      if (i == 5)
      {
         string zeile5 = zeil;
         string color5 = rot;
         string  icon5 = "";         
      }
      if (i == 6)
      {
         string zeile6 = zeil;
         string color6 = rot;
         string  icon6 = "";         
      }
      zeil = "";
      i = i + 1;
      
   }

   foreach (nam, listg.Split(","))
   {
      if ((zeil.Length() + nam.Length()) < 12)
      {
         if (zeil == "")
         {
            zeil = nam;
         } 
         else 
         {
            zeil = zeil # "," # nam;
         }
      }
      else
      {
         if (i == 4)
         {
            string zeile4 = zeil;
            string color4 = gelb;
            string  icon4 = "";         
         }
         if (i == 5)
         {
            string zeile5 = zeil;
            string color5 = gelb;
            string  icon5 = "";         
         }
         if (i == 6)
         {
            string zeile6 = zeil;
            string color6 = gelb;
            string  icon6 = "";         
         }
         zeil = nam;
         i = i + 1;
      }
   }
   if (zeil <> "")
   {
         if (i == 4)
         {
            string zeile4 = zeil;
            string color4 = gelb;
            string  icon4 = "";         
         }
         if (i == 5)
         {
            string zeile5 = zeil;
            string color5 = gelb;
            string  icon5 = "";         
         }
         if (i == 6)
         {
            string zeile6 = zeil;
            string color6 = gelb;
            string  icon6 = "";         
         }
      zeil = "";
      i = i + 1;   
   }
}

! ###################### Seite 5 ######################

if (seitenZaehler.State()==5){

! ### Anwesenheit ####
  
var oSysvar = dom.GetObject("Anwesenheit");
if (oSysvar.State()==1){

string zeile1 = "Anwesenheit:";
 color1 = "0x80";
icon1 = "";
zeile2 = "Anwesend";
color2 = "0x84";
icon2 = "";

} 

else {
string zeile1 = "Abwesenheit:";
color1 = "0x80";
icon1 = "";
zeile2 = "Abwesend";
color2 = "0x81";
icon2 = "";
} 


! ### Gong ####
  
var oSysvar = dom.GetObject("Gong");
if (oSysvar.State()==2){


zeile3 = "";
color3="0x80";
icon3 = "";
zeile4 = "Gong";
color4="0x80";
icon4 = "";
zeile5 = "Aus";
color5 = "0x81";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
color6 = "0x85";
icon6 = "";
}
else
{
zeile3 = "";
color3="0x80";
icon3 = "";
zeile4 = "Gong";
color4="0x80";
icon4 = "";
zeile5 = "Ein";
color5 = "0x84";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
color6 = "0x85";
icon6 = "";
}
}

! ###################### Seite 6 ######################

if (seitenZaehler.State()==6){
  
! ### Schlafen ####
  
zeile1 = "Schlafmodus:";
color1 = "0x80";
icon1 = "";  

! #### Zeile 2 und 3 - Schlafmodus #######


var oSysvar = dom.GetObject("Schlafmodus");
if (oSysvar.State()==1){

string zeile2  = "Schlafen";
 color2 = "0x81";
icon2 = "";
zeile3 = "";
color3 = "0x81";
icon3 = "";
} 

else {
zeile2 = "Wach";
color2 = "0x84";
icon2 = "";
} 


! ### Wecker ####
  
var oSysvar = dom.GetObject("Wecker");
if (oSysvar.State()==2){



zeile4 = "Wecker";
color4="0x80";
icon4 = "";
zeile5 = "Ein";
color5="0x84";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";
}
else
{


zeile4 = "Wecker";
color4="0x80";
icon4 = "";
zeile5 = "Aus";
color5="0x81";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";
}
}



! --------- Ende Ermitteln der Systemzustände und Zuweisung zu den einzelnen Zeilen -------------


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! System Routine do not change anything below !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

string splitter="|";
string msgBuffer = zeile1 # splitter # color1 # splitter # icon1 # "\t";
msgBuffer = msgBuffer # zeile2 # splitter # color2 # splitter # icon2 # "\t";
msgBuffer = msgBuffer # zeile3 # splitter # color3 # splitter # icon3 # "\t";
msgBuffer = msgBuffer # zeile4 # splitter # color4 # splitter # icon4 # "\t";
msgBuffer = msgBuffer # zeile5 # splitter # color5 # splitter # icon5 # "\t";
msgBuffer = msgBuffer # zeile6 # splitter # color6 # splitter # icon6;

string substitutions = "A,0x41\tB,0x42\tC,0x43\tD,0x44\tE,0x45\tF,0x46\tG,0x47\tH,0x48\tI,0x49\tJ,0x4A\tK,0x4B\tL,0x4C\tM,0x4D\tN,0x4E\tO,0x4F\tP,0x50\tQ,0x51\tR,0x52\tS,0x53\tT,0x54\tU,0x55\tV,0x56\tW,0x57\tX,0x58\tY,0x59\tZ,0x5A";
substitutions = substitutions # "\ta,0x61\tb,0x62\tc,0x63\td,0x64\te,0x65\tf,0x66\tg,0x67\th,0x68\ti,0x69\tj,0x6A\tk,0x6B\tl,0x6C\tm,0x6D\tn,0x6E\to,0x6F\tp,0x70\tq,0x71\tr,0x72\ts,0x73\tt,0x74\tu,0x75\tv,0x76\tw,0x77\tx,0x78\ty,0x79\tz,0x7A";
substitutions = substitutions # "\t0,0x30\t1,0x31\t2,0x32\t3,0x33\t4,0x34\t5,0x35\t6,0x36\t7,0x37\t8,0x38\t9,0x39\t ,0x20\t!,0x21\t\",0x22\t%,0x25\t&,0x26\t=,0x27\t(,0x28\t),0x29\t*,0x2A\t+,0x2B\t,,0x2C\t-,0x2D\t.,0x2E\t/,0x2F";
substitutions = substitutions # "\tÄ,0x5B\tÖ,0x23\tÜ,0x24\tä,0x7B\tö,0x7C\tü,0x7D\tß,0x5F\t:,0x3A\t;,0x3B\t@,0x40\t>,0x3E"; 

string bufferLine;
string substEntry;
integer i;
string char;
string line;
string icon;

string command = "0x02";
foreach(bufferLine, msgBuffer) {
   line = bufferLine.StrValueByIndex(splitter, 0);
   icon = bufferLine.StrValueByIndex(splitter, 2);
   if ((line <> "") || (icon <> "")) {
      command = command # ",0x12";
      if ((line.Substr(0,2) == "0x") && (line.Length() == 4)) {
         command = command # "," # line;
         i = 12;
      }
      else {
         i = 0;
      }
      while ((i < line.Length()) && (i < 12)) { 
         char = line.Substr(i, 1);     
         foreach(substEntry, substitutions){
            if (char == substEntry.Substr(0,1)){command = command # substEntry.Substr(1,5);}
         }
         i = i + 1; 
      }
      command = command # ",0x11," # bufferLine.StrValueByIndex(splitter, 1);
      if (icon <> "") {
         command = command # ",0x13," # icon;
      }
   }
   command = command # ",0x0A";
}
command = command # ",0x03";

dom.GetObject("BidCos-RF." # dom.GetObject("$src$").Name().StrValueByIndex(".",1) # ".SUBMIT").State(command);

! ##### FERTIG #####

Ich hoffe es kann damit jemand was anfangen und mir erklären wo da mein Fehler liegt.

Mit freundlichen Gruss Elmo
Devices : 37
Kanäle : 162
Programme : 85
Räume : 8
Variablen : 41


1 x HM-Sec-SC-2 1 x HM-OU-CF-Pl 1 x HM-LC-Sw1-Ba-PCB 1 x HM-LC-Bl1-FM 1 x HM-RCV-50 1 x HM-LC-Sw1-FM 1 x HM-RC-19 1 x HM-OU-LED16 1 x HM-Dis-WM55 2 x HM-PB-6-WM55 1 x HM-TC-IT-WM-W-EU 1 x HM-LC-Dim1T-FM 1 x HM-Sec-Key 4 x HM-Sec-SCo 1 x HM-Sec-RHS 1 x HM-Sec-SD 1 x HM-Sec-SD-Team 1 x HM-Sen-DB-PCB 1 x HM-CC-RT-DN 1 x HM-OU-CM-PCB 2 x HM-Sec-MDIR-2 1 x HM-PBI-4-FM 8 x HM-LC-Sw2-FM 2 x HM-RC-Key4-2

Adrian02
Beiträge: 2
Registriert: 22.12.2015, 21:02

Re: HM-DIS-WM55 Seitenweise blättern und Aktionen ausführen

Beitrag von Adrian02 » 22.12.2015, 21:11

Guten Tag zusammen,


Ich wollte Fragen ob mir jemand bei der Umgestaltung des Scripts helfen könnte, ich möchte das Display zur quasi Szenen Steuerung nutzen, sprich Lichter in einem Raum Ein mit Oben lang und aus mit Unten Lang.
Oder z.b. Rollläden im Raum Zentral Auf mit Oben lang, Zentral zu mit Unten Lang.
Und mit den kurzen Tastendrücken sollte zwischen den beiden zuwählen sein.

Leider funktioniert bei mir da garnichts.....

Nun meine Frage, was muss ich denn da ändern das ich einfach mit Oben ein und mit unten Ausschalten kann?

Danke schonmal im Voraus.



Gruß, Adrian

ElmoS04
Beiträge: 92
Registriert: 20.08.2015, 09:46

Re: HM-DIS-WM55 Seitenweise blättern und Aktionen ausführen

Beitrag von ElmoS04 » 26.12.2015, 13:27

Hallo Adrian.
Ich bin selber nur ein Anfänger und habe keine Ahnung vom programmieren. Bei läuft das Skript aber schon ganz gut. Vielleicht ist dein Problem ja einfach und ich kann helfen.
Kopiere erst mal das die Skripte so wie sie sind in die Programme rein. Erstell dir ein programm zB fenster runter.
Geschaltet über eine Systemvariabel. Den Namen der systemvariabel fügst du dann in das Skript rein. Erst unten und oben kurz. ZB auf Seite 1. steht im Skript

Den Text anpassen.

Dann den Namen im Programm Skript vom oben und unten lang.
Auch auf Seite 1 rein kopieren. Auch Text anpassen.
So ging es bei mir.
Ich hoffe das hilft. Bei größeren Anpassungen bin ich dann nicht der richtige Ansprechpartner. Hihi

Mit freundlichen Gruss Elmo


Gesendet von iPhone mit Tapatalk
Devices : 37
Kanäle : 162
Programme : 85
Räume : 8
Variablen : 41


1 x HM-Sec-SC-2 1 x HM-OU-CF-Pl 1 x HM-LC-Sw1-Ba-PCB 1 x HM-LC-Bl1-FM 1 x HM-RCV-50 1 x HM-LC-Sw1-FM 1 x HM-RC-19 1 x HM-OU-LED16 1 x HM-Dis-WM55 2 x HM-PB-6-WM55 1 x HM-TC-IT-WM-W-EU 1 x HM-LC-Dim1T-FM 1 x HM-Sec-Key 4 x HM-Sec-SCo 1 x HM-Sec-RHS 1 x HM-Sec-SD 1 x HM-Sec-SD-Team 1 x HM-Sen-DB-PCB 1 x HM-CC-RT-DN 1 x HM-OU-CM-PCB 2 x HM-Sec-MDIR-2 1 x HM-PBI-4-FM 8 x HM-LC-Sw2-FM 2 x HM-RC-Key4-2

Adrian02
Beiträge: 2
Registriert: 22.12.2015, 21:02

Re: HM-DIS-WM55 Seitenweise blättern und Aktionen ausführen

Beitrag von Adrian02 » 27.12.2015, 11:16

Also bei mir funktioniert das so halbwegs ich bekomme nur den Tastendruck unten nicht wirklich hin.
kannst du mir mal dein skript vom tastendruck lang unten und lang oben geben.


Gruß, Adrian

ElmoS04
Beiträge: 92
Registriert: 20.08.2015, 09:46

Re: HM-DIS-WM55 Seitenweise blättern und Aktionen ausführen

Beitrag von ElmoS04 » 27.12.2015, 13:10

hallo
Hier ist mein Skript

Code: Alles auswählen

! ### Display Unten Lang 1 ####
! ### Stausanzeige 2 , Vers. 1.0;
! ### Anzeige der Zysternen Füllstand, Zysternen Filter stand, Außentemperatur, Status der Türen, Fenster und Lichter

!! Universalprogramm zum Füllen 
!! (c) DrTob 
!! optimized by thkl
!! changed by wortmann30
!! Seitenzähler von Brufi

!! Das Script holt sich jetzt die Seriennummer des Displays selbst aus der Auslösebedinung des Programms

! Farben
! 0x80 weiß
! 0x81 rot
! 0x82 orange
! 0x83 gelb
! 0x84 gruen
! 0x85 blau 

! Symbole 
! 0x80 AUS
! 0x81 EIN
! 0x82 OFFEN
! 0x83 geschlossen
! 0x84 fehler
! 0x85 alles ok
! 0x86 information
! 0x87 neue nachricht
! 0x88 servicemeldung
! 0x89 Signal grün
! 0x8A Signal gelb
! 0x8B Signal rot

! Zugriff auf vordefinierte Texte
!
! 0x80 Text 0 (Kanal 1 Text Zeile 1)
! 0x81 Text 1 (Kanal 1 Text Zeile 2)
! 0x82 Text 2 (Kanal 2 Text Zeile 3)
! 0x83 Text 3 (Kanal 2 Text Zeile 4)
! 0x84 Text 4 (Kanal 3 Text Zeile 5)
! 0x85 Text 5 (Kanal 3 Text Zeile 6)
! 0x86 Text 6 (Kanal 4 Text Zeile 7)
! 0x87 Text 7 (Kanal 4 Text Zeile 8)
! 0x88 Text 8 (Kanal 5 Text Zeile 9)
! 0x89 Text 9 (Kanal 5 Text Zeile 10)
! 0x8A Text 10 (Kanal 6 Text Zeile 11)
! 0x8B Text 11 (Kanal 6 Text Zeile 12)
! 0x8C Text 12 (Kanal 7 Text Zeile 13)
! 0x8D Text 13 (Kanal 7 Text Zeile 14)
! 0x8E Text 14 (Kanal 8 Text Zeile 15)
! 0x8F Text 15 (Kanal 8 Text Zeile 16)
! 0x90 Text 16 (Kanal 9 Text Zeile 17)
! 0x91 Text 17 (Kanal 9 Text Zeile 18)
! 0x92 Text 18 (Kanal 10 Text Zeile 19)
! 0x93 Text 19 (Kanal 10 Text Zeile 20)

string zeile1 = "";
string color1 = "0x80";
string icon1 = "";

string zeile2 = "";
string color2 = "0x80";
string icon2 = "";

string zeile3 = "";
string color3 = "0x80";
string icon3 = "";

string zeile4 = "";
string color4 = "0x80";
string icon4 = "";

string zeile5 = "";
string color5 = "0x80";
string icon5 = "";

string zeile6 = "";
string color6 = "0x80";
string icon6 = "";

! ####### wie viele Seiten auf dem Display sollen durchlaufen werden? ###########

integer seitenzahl = 6; 

! ###############################################################
  
  
! --------- Anfang Ermitteln der Systemzustände und Zuweisung zu den einzelnen Zeilen -------------

! ### Systemvariable seitenzaehler01 holen ###

var seitenZaehler = dom.GetObject("seitenzaehler01");



! ####### wie viele Seiten auf dem Display sollen durchlaufen werden? ###########

integer seitenzahl = 6; 

! ###############################################################
  
  
! --------- Anfang Ermitteln der Systemzustände und Zuweisung zu den einzelnen Zeilen -------------

! ### Systemvariable seitenzaehler01 holen ###

var seitenZaehler = dom.GetObject("seitenzaehler01");

! ###################### Seite 1 ######################

if (seitenZaehler.State()==1){

! ### Display Ebene ####
  
var oSysvar = dom.GetObject("Display Ebene Umschalten");
if (oSysvar.State()==0){    ! #### Wenn Ebene 2 ausgeschaltet ist
oSysvar.State(1);   ! #### Schalte Ebene 1 aus

zeile1 = "Display:";
color1="0x80";
icon1 = "";
zeile2 = "";
color2="0x80";
icon2 = "";
zeile3 = "Ist Jetzt";
color3="0x84";
icon3 = "";
zeile4 = "Ebene 1";
color4="0x84";
icon4 = "";
zeile5 = "Haus-";
color5="0x80";
icon5 = "";
zeile6 = "steuerung";
color6="0x80";
icon6 = "";
}
else
{
oSysvar.State(0);   ! #### Schalte Sirene Stumm ein

zeile1 = "Display:";
color1="0x80";
icon1 = "";
zeile2 = "";
color2 = "0x80";
icon2 = "";
zeile3 = "Ist Jetzt";
color3 = "0x84";
icon3 = "";
zeile4 = "Ebene 2";
color4 = "0x84";
icon4 = "";
zeile5 = "Licht";
color5="0x80";
icon5 = "";
zeile6 = "Verschluss";
color6 = "0x80";
icon6 = "";
}
}

! ###################### Seite 2 ######################

if (seitenZaehler.State()==2){

! ### Sirene Stumm ####
  
var oSysvar = dom.GetObject("Sirene Stumm");
if (oSysvar.State()==0){    ! #### Wenn Sirene Stumm ausgeschaltet ist
oSysvar.State(1);   ! #### Schalte Sirene Stumm aus

zeile1 = "Sirene:";
color1="0x80";
icon1 = "";
zeile2 = "";
color2="0x80";
icon2 = "";
zeile3 = "Ist Jetzt";
color3="0x81";
icon3 = "";
zeile4 = "An";
color4="0x81";
icon4 = "";
zeile5 = "Achtung";
color5="0x81";
icon5 = "";
zeile6 = "-Laut-";
color6="0x81";
icon6 = "";
}
else
{
oSysvar.State(0);   ! #### Schalte Sirene Stumm ein

zeile1 = "Sirene";
color1="0x80";
icon1 = "";
zeile2 = "";
color2 = "0x80";
icon2 = "";
zeile3 = "Ist Jetzt";
color3 = "0x84";
icon3 = "";
zeile4 = "Aus";
color4 = "0x84";
icon4 = "";
zeile5 = "";
color5="0x84";
icon5 = "";
zeile6 = "-Stumm-";
color6 = "0x80";
icon6 = "";
}
}


! ###################### Seite 4 ######################

if (seitenZaehler.State()==4){

! ### Sirene Stumm ####
  
var oSysvar = dom.GetObject("Treppenhaus Zeitautomatik");
if (oSysvar.State()==0){    ! #### Wenn Zeit Eingeschaltet ist
oSysvar.State(1);   ! #### Schalte Zeit aus

zeile1 = "Treppenhaus-";
color1="0x80";
icon1 = "";
zeile2 = "Beleuchtung:";
color2="0x80";
icon2 = "";
zeile3 = "Zeitschalt.";
color3="0x84";
icon3 = "";
zeile4 = "An";
color4="0x81";
icon4 = "";
zeile5 = "";
color5="0x81";
icon5 = "";
zeile6 = "";
color6="0x81";
icon6 = "";
}
else
{
oSysvar.State(0);   ! #### Schalte Zeitschaltung aus

zeile1 = "Treppenhaus-";
color1="0x80";
icon1 = "";
zeile2 = "Beleuchtung:";
color2="0x80";
icon2 = "";
zeile3 = "Zeitschalt.";
color3="0x84";
icon3 = "";
zeile4 = "Aus";
color4="0x81";
icon4 = "";
zeile5 = "";
color5="0x81";
icon5 = "";
zeile6 = "";
color6="0x81";
icon6 = "";
}
}

! ###################### Seite 6 ######################

if (seitenZaehler.State()==6){

! ### Wecker 6.20 Uhr ####
  
var oSysvar = dom.GetObject("Wecker");
if (oSysvar.State()==0){    ! #### Wenn der 6.20 -Uhr Wecker ausgeschaltet ist
oSysvar.State(1);   ! #### Schalte den 6.20 -Uhr Wecker ein

zeile1 = "";
color1="0x80";
icon1 = "";
zeile2 = "Du wirst um";
color2="0x80";
icon2 = "";
zeile3 = "6.20 Uhr";
color3="0x82";
icon3 = "";
zeile4 = "geweckt!";
color4="0x80";
icon4 = "";
zeile5 = "";
color5="0x80";
icon5 = "";
zeile6 = "";
color6="0x80";
icon6 = "";
}
else
{
oSysvar.State(0);   ! #### Schalte den 6.20 -Uhr Wecker aus

zeile1 = "Der 6.20 Uhr";
color1="0x80";
icon1 = "";
zeile2 = "Wecker";
color2 = "0x80";
icon2 = "";
zeile3 = "wurde";
color3 = "0x80";
icon3 = "";
zeile4 = "ausge-";
color4 = "0x84";
icon4 = "";
zeile5 = "schaltet";
color5="0x84";
icon5 = "";
zeile6 = "";
color6 = "0x80";
icon6 = "";
}
}

! ###################### Seite 5 ######################

if (seitenZaehler.State()==5){

! ### Gong ####
  
var oSysvar = dom.GetObject("Gong");
if (oSysvar.State()==0){    ! #### Wenn der Gong ausgeschaltet ist
oSysvar.State(1);   ! #### Schalte Gong aus

zeile1 = "";
color1="0x80";
icon1 = "";
zeile2 = "Gong";
color2="0x80";
icon2 = "";
zeile3 = "Ist Jetzt";
color3="0x80";
icon3 = "";
zeile4 = "Aus";
color4="0x81";
icon4 = "";
zeile5 = "";
color5="0x80";
icon5 = "";
zeile6 = "";
color6="0x80";
icon6 = "";
}
else
{
oSysvar.State(0);   ! #### Schalte Gong ein

zeile1 = "";
color1="0x80";
icon1 = "";
zeile2 = "Gong";
color2 = "0x80";
icon2 = "";
zeile3 = "Ist Jetzt";
color3 = "0x80";
icon3 = "";
zeile4 = "An";
color4 = "0x84";
icon4 = "";
zeile5 = "";
color5="0x84";
icon5 = "";
zeile6 = "";
color6 = "0x80";
icon6 = "";
}
}

! --------- Ende Ermitteln der Systemzustände und Zuweisung zu den einzelnen Zeilen -------------


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! System Routine do not change anything below !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

string splitter="|";
string msgBuffer = zeile1 # splitter # color1 # splitter # icon1 # "\t";
msgBuffer = msgBuffer # zeile2 # splitter # color2 # splitter # icon2 # "\t";
msgBuffer = msgBuffer # zeile3 # splitter # color3 # splitter # icon3 # "\t";
msgBuffer = msgBuffer # zeile4 # splitter # color4 # splitter # icon4 # "\t";
msgBuffer = msgBuffer # zeile5 # splitter # color5 # splitter # icon5 # "\t";
msgBuffer = msgBuffer # zeile6 # splitter # color6 # splitter # icon6;

string substitutions = "A,0x41\tB,0x42\tC,0x43\tD,0x44\tE,0x45\tF,0x46\tG,0x47\tH,0x48\tI,0x49\tJ,0x4A\tK,0x4B\tL,0x4C\tM,0x4D\tN,0x4E\tO,0x4F\tP,0x50\tQ,0x51\tR,0x52\tS,0x53\tT,0x54\tU,0x55\tV,0x56\tW,0x57\tX,0x58\tY,0x59\tZ,0x5A";
substitutions = substitutions # "\ta,0x61\tb,0x62\tc,0x63\td,0x64\te,0x65\tf,0x66\tg,0x67\th,0x68\ti,0x69\tj,0x6A\tk,0x6B\tl,0x6C\tm,0x6D\tn,0x6E\to,0x6F\tp,0x70\tq,0x71\tr,0x72\ts,0x73\tt,0x74\tu,0x75\tv,0x76\tw,0x77\tx,0x78\ty,0x79\tz,0x7A";
substitutions = substitutions # "\t0,0x30\t1,0x31\t2,0x32\t3,0x33\t4,0x34\t5,0x35\t6,0x36\t7,0x37\t8,0x38\t9,0x39\t ,0x20\t!,0x21\t\",0x22\t%,0x25\t&,0x26\t=,0x27\t(,0x28\t),0x29\t*,0x2A\t+,0x2B\t,,0x2C\t-,0x2D\t.,0x2E\t/,0x2F";
substitutions = substitutions # "\tÄ,0x5B\tÖ,0x23\tÜ,0x24\tä,0x7B\tö,0x7C\tü,0x7D\tß,0x5F\t:,0x3A\t;,0x3B\t@,0x40\t>,0x3E"; 

string bufferLine;
string substEntry;
integer i;
string char;
string line;
string icon;

string command = "0x02";
foreach(bufferLine, msgBuffer) {
   line = bufferLine.StrValueByIndex(splitter, 0);
   icon = bufferLine.StrValueByIndex(splitter, 2);
   if ((line <> "") || (icon <> "")) {
      command = command # ",0x12";
      if ((line.Substr(0,2) == "0x") && (line.Length() == 4)) {
         command = command # "," # line;
         i = 12;
      }
      else {
         i = 0;
      }
      while ((i < line.Length()) && (i < 12)) { 
         char = line.Substr(i, 1);     
         foreach(substEntry, substitutions){
            if (char == substEntry.Substr(0,1)){command = command # substEntry.Substr(1,5);}
         }
         i = i + 1; 
      }
      command = command # ",0x11," # bufferLine.StrValueByIndex(splitter, 1);
      if (icon <> "") {
         command = command # ",0x13," # icon;
      }
   }
   command = command # ",0x0A";
}
command = command # ",0x03";

dom.GetObject("BidCos-RF." # dom.GetObject("$src$").Name().StrValueByIndex(".",1) # ".SUBMIT").State(command);

! ##### FERTIG #####
Ist aber das gleiche wie oben lang.
Hast du auch in dem Programm bei Wenn Display Oben Lang
Dann Skript ?
Devices : 37
Kanäle : 162
Programme : 85
Räume : 8
Variablen : 41


1 x HM-Sec-SC-2 1 x HM-OU-CF-Pl 1 x HM-LC-Sw1-Ba-PCB 1 x HM-LC-Bl1-FM 1 x HM-RCV-50 1 x HM-LC-Sw1-FM 1 x HM-RC-19 1 x HM-OU-LED16 1 x HM-Dis-WM55 2 x HM-PB-6-WM55 1 x HM-TC-IT-WM-W-EU 1 x HM-LC-Dim1T-FM 1 x HM-Sec-Key 4 x HM-Sec-SCo 1 x HM-Sec-RHS 1 x HM-Sec-SD 1 x HM-Sec-SD-Team 1 x HM-Sen-DB-PCB 1 x HM-CC-RT-DN 1 x HM-OU-CM-PCB 2 x HM-Sec-MDIR-2 1 x HM-PBI-4-FM 8 x HM-LC-Sw2-FM 2 x HM-RC-Key4-2

Gluehwurm
Beiträge: 12434
Registriert: 19.03.2014, 00:37
System: in Planung
Hat sich bedankt: 105 Mal
Danksagung erhalten: 380 Mal

Re: HM-DIS-WM55 Seitenweise blättern und Aktionen ausführen

Beitrag von Gluehwurm » 27.12.2015, 14:41

Adrian02 hat geschrieben:bekomme nur den Tastendruck unten nicht wirklich hin
Screenshot des Programms

Gruß
Bruno

gehard2001
Beiträge: 25
Registriert: 29.07.2015, 13:01

Re: HM-DIS-WM55 Seitenweise blättern und Aktionen ausführen

Beitrag von gehard2001 » 07.03.2016, 21:26

habe hier auch einen Mini Bug in meinem Ablauf und finde den Fehler nicht .... :roll:

Alles funktioniert,es wird angezeigt ob alle Fenster geschlossen sind oder wieviele offen sind. Aber die Temperatur (a der Wetterstation bzw. b die Temp. eines Heizkörperthermostates wird nicht angezeigt.

Hier der betreffende Auszug aus dem script:

Code: Alles auswählen

    ! ###################### Seite 1 ######################

   
    if (seitenZaehler.State()==1){
     

    ! ### Übersicht ####
     
    zeile1 = "Übersicht:";
    color1 = "0x80";
    icon1 = ""; 

    ! #### Zeile 2 und 3 - Alle Fenster zu? Wie viele sind offen? #######
    ! # Gewerk mit dem Namen Fenster wird gezählt

    var obj = dom.GetObject("Fenster");
     string itemID;
     var cntopen=0;
     foreach(itemID, obj.EnumUsedIDs()) {
      var item = dom.GetObject(itemID);
      if(item.IsTypeOf(OT_CHANNEL))
      {
       var state=item.DPByHssDP("STATE");
       if(state.Value()<>0)
       {
         cntopen=cntopen+1;
       }
     }
    }

    if (cntopen>0) {
      zeile2 = cntopen # "Fenster";
      color2 = "0x81";
      icon2 = "";
      zeile3 = "offen";
      color3 = "0x81";
      icon3 = "";
    }

    else {
      zeile2 = "Fenster zu";
      color2 = "0x84";
      icon2 = "";
    }

    ! #### Zeile 4 und 5 Temperatur im Schlafzimmer



    var akttemp = dom.GetObject("BidCos-RF.KEQ07xxxxx:4.TEMPERATURE").Value();
    akttemp = akttemp.ToString(1);

    zeile4 = "Schlafzi:";
    color4 = "0x84";
    icon4 = "";
    zeile5 = ""#akttemp#"C";
    color5 = "0x81";
    icon5 = "";


    ! #### Zeile 6 Außentemperatur

var akttemp2 = dom.GetObject("BidCos-RF.LEQ06xxxxx:1.TEMPERATURE").Value();
    string akttemp2 = akttemp2.ToString(1);    


    zeile6 = "A-Temp:";
    color6 = "0x84";
    icon6 = "";
    zeile7 = ""#akttemp2#" C";
    color7 = "0x81";
    icon7 = "";


    }

    ! ###################### Seite 2 ######################
hat jemand eine Idee :idea: ?

DNKE FÜR DIE hILFE1 :D
Zuletzt geändert von alchy am 07.03.2016, 21:37, insgesamt 1-mal geändert.
Grund: Code bitte in Codetags einfügen

Gluehwurm
Beiträge: 12434
Registriert: 19.03.2014, 00:37
System: in Planung
Hat sich bedankt: 105 Mal
Danksagung erhalten: 380 Mal

Re: HM-DIS-WM55 Seitenweise blättern und Aktionen ausführen

Beitrag von Gluehwurm » 07.03.2016, 21:44

Habe keine Ahnung, daher kopiere ich den Teil, der bei meinem läuft :wink:

Code: Alles auswählen

    ! ## Außentemperatur

    var term="JEQ0xxxxxx";
    var channel=dom.GetObject("BidCos-RF."#term#":1.TEMPERATURE");
    var temp = channel.Value();
    var color1 = "0x85"; 

    zeile1 = "AußenT "#temp.ToString(1)#" C";

    if (temp >= 10.0) {color1 = "0x83";}
    if (temp >= 22.0) {color1 = "0x81";}
    icon1 = "0x86";
Gruß
Bruno

alchy
Beiträge: 10754
Registriert: 24.02.2011, 01:34
System: CCU
Hat sich bedankt: 65 Mal
Danksagung erhalten: 673 Mal

Re: HM-DIS-WM55 Seitenweise blättern und Aktionen ausführen

Beitrag von alchy » 07.03.2016, 22:58

Stellt sich die Frage, was du denn wo verwendest?
Im Schlafzimmer wirst du ja den Thermostat verwenden und nicht die Wetterstation? :mrgreen:
Welches der Thermostate denn?
Kopiere den Code aus deinem Script einfach mal in ein "Script testen Fenster" oder in den Script Executer und führe Ihn da aus mit einer WriteLine zeile dran.
z.B.

Code: Alles auswählen

var akttemp = dom.GetObject("BidCos-RF.KEQ07xxxxx:4.TEMPERATURE").Value();
akttemp = akttemp.ToString(1);
WriteLine(akttemp);
Du fragst dort den Kanel 4 ab, ist das so gewollt?

Mal aus dem Gedächnis:

z.B. bei den HM-TC-IT-WM-W-EU
könnte man so nehmen:

Code: Alles auswählen

var akttemp = dom.GetObject("BidCos-RF.LEQ012345678:1.TEMPERATURE").Value();
akttemp = akttemp.ToString(1);
WriteLine(akttemp);
oder auch

Code: Alles auswählen

var akttemp = dom.GetObject("BidCos-RF.LEQ0004240:2.ACTUAL_TEMPERATURE").Value();
akttemp = akttemp.ToString(1);
WriteLine(akttemp);
der HM-CC-TC
hätte soweit ich mich erinner auch:

Code: Alles auswählen

var akttemp = dom.GetObject("BidCos-RF.LEQ012345678:1.TEMPERATURE").Value();
Vermutlich hast du aber einen HM-CC-RT-DN ?
Der müsste dann wieder rum so gehen:

Code: Alles auswählen

var akttemp = dom.GetObject("BidCos-RF.KEQ07xxxxx:4.ACTUAL_TEMPERATURE").Value();
akttemp = akttemp.ToString(1);
WriteLine(akttemp);
Also nachschauen, welcher Datenpunkt denn vorhanden ist, und entsprechend benutzen.
Und vielleicht in Zukunft GLEICH mal die Infos posten, dann muss die Glaskugel nicht so geputzt werden.

Alchy

Blacklist................... almost full
Ignoranz ist die Summe aller Maßnahmen die man ergreift, um bestehende Tatsachen nicht sehen zu müssen.

© Sandra Pulsfort (*1974)

Lies bitte die Logik von WebUI Programmen und die Tipps und Tricks für Anfänger.

Wichtig auch CUxD ersetzt System.exec. Die HM Script Doku (Downloadart Skripte) hilft auch weiter.
Zum Testen von Scripten den >> HomeMatic Script Executor << von Anli benutzen.

gehard2001
Beiträge: 25
Registriert: 29.07.2015, 13:01

Re: HM-DIS-WM55 Seitenweise blättern und Aktionen ausführen

Beitrag von gehard2001 » 20.03.2016, 17:44

Danke für die Unterstützung :lol:
Die Temperatur des Heizkörperthemostates geht jetzt seit ich wie in Deinem Script um "actual" ergänze. Also so:

Code: Alles auswählen

var akttemp = dom.GetObject("BidCos-RF.KEQ1234567:4.ACTUAL_TEMPERATURE").Value();
    akttemp = akttemp.ToString(1);
(Das das der 4 Kanal ist ist mir in einem Diagramm aufgefallen)

Die OC3 Wetterstation (Sorry dass ich das nicht geschrieben hab - hoffe mit OC3 ist klar was gemeint ist) will aber immer noch nicht. Schaut so aus und funzt nicht (auch mit "ACTUAL" ergänzt):

Code: Alles auswählen

  
var A_temp = dom.GetObject("BidCos-RF.LEQ1234567:1.TEMPERATURE").Value();
string A_temp = A_temp.ToString(2);  


Nun habe ich mal folgendes verucht:
eine neue Systemvariable: "A-Temperatur" und folgendes script:

Code: Alles auswählen

    
object dp = dom.GetObject("BidCos-RF.LEQ1234567:1.TEMPERATURE"); 
var temp = dp.Value(); 
object sysvarzumspeichern = dom.GetObject("A-Temperatur"); 
sysvarzumspeichern.State(temp); 
WriteLine("Temperatur von " #temp #" wurde in die Variable  "#sysvarzumspeichern #"  gespeichert"); 
Wenn ich dieses script über ein Programm ausführe landet die Temperatur in der systemvariable.
Also scheint eigentlich alles zu passen

könnte ich die Temperatur aus der Variable wie folgt in das große "blättern-script" einfügen :roll: ?

Code: Alles auswählen

  
A_temp = dom.GetObject("A-Temperatur").Value();
string A_temp = A_temp.ToString(1);    

LG
Zuletzt geändert von alchy am 20.03.2016, 19:22, insgesamt 1-mal geändert.
Grund: Code bitte in Codetags einfügen

Antworten

Zurück zu „HomeMatic Tipps & Tricks - keine Fragen!“