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

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

Moderator: Co-Administratoren

Benutzeravatar
Helikiller
Beiträge: 143
Registriert: 10.09.2014, 06:53
Wohnort: 21438 Brackel

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

Beitrag von Helikiller » 28.09.2015, 19:04

Wo ist mein Fehler? Ich habe 2 Display-Geräte.
Ich habe mir die 4 Systemvariablen angelegt.
Ich bekomme bei "HM Script Executor" immer "INVALID JSON".

Code: Alles auswählen

! ### Homatic-Statusanzeige HM-Dis-WM55 ####
! ### Stausanzeige 2 , Vers. 1.0; Taste_unten_kurz.h
! ### 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 = 4; 

! ###############################################################
  
! ####################### 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){
  
  
! ### Schlafmodus an oder aus? ####
  
var oSysvar = dom.GetObject("Schlafmodus");
if (oSysvar.State()==1){

zeile1 = "";
color1 = "0x80";
icon1 = "";
zeile2 = "Schlafen:";
color2 = "0x80";
icon2 = "";
zeile3 = "";
color3="0x80";
icon3 = "";
zeile4 = "ange-";
color4="0x81";
icon4 = "";
zeile5 = "schaltet";
color5 = "0x81";
icon5 = "";
zeile6 = "";
color6 = "0x80";
icon6 = "";
}
else
{

zeile1 = "";
color1 = "0x80";
icon1 = "";
zeile2 = "Schlafen:";
color2 = "0x80";
icon2 = "";
zeile3 = "";
color3="0x80";
icon3 = "";
zeile4 = "ausge-";
color4 = "0x84";
icon4 = "";
zeile5 = "schaltet";
color5 = "0x84";
icon5 = "";
zeile6 = "";
color6 = "0x80";
icon6 = "";
}
}
! ###################### Seite 2 ######################


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

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

zeile1 = "";
color1 = "0x80";
icon1 = "";
zeile2 = "Wecker:";
color2 = "0x80";
icon2 = "";
zeile3 = "";
color3="0x80";
icon3 = "";
zeile4 = "5 Uhr";
color4="0x85";
icon4 = "";
zeile5 = "einge-";
color5 = "0x81";
icon5 = "";
zeile6 = "schaltet";
color6 = "0x81";
icon6 = "";
}
else
{

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

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


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

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

zeile1 = "";
color1 = "0x80";
icon1 = "";
zeile2 = "Wecker:";
color2 = "0x80";
icon2 = "";
zeile3 = "";
color3="0x80";
icon3 = "";
zeile4 = "8 Uhr";
color4="0x85";
icon4 = "";
zeile5 = "einge-";
color5 = "0x81";
icon5 = "";
zeile6 = "schaltet";
color6 = "0x81";
icon6 = "";
}
else
{

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

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


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

! ### Übersicht ####
  
zeile1 = "Übersicht:";
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("Fav_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.LEQ0594388:1.TEMPERATURE").Value();
akttemp = akttemp.ToString(1);

zeile4 = "Schlafzimmer:";
  color4 = "0x80";
  icon4 = "";
  zeile5 = ""#akttemp#" C";
  color5 = "0x80";
  icon5 = "";


! #### Zeile 6 Außentemperatur

var channel=dom.GetObject("BidCos-RF.LEQ0029732:1.TEMPERATURE").Value();
var temp = channel.Value();
if (temp > -10.0)
{ temp = temp.ToString(1);
  zeile6 = "Außen: "#temp#" C";
  color6 = "0x85";
}
else
{ temp = temp.ToString(1);
  zeile6 = "Außen: "#temp#" C";
}
color6 = "0x80";
icon6 = "";




  
}

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



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


! ### Platz für weiere Seiten...


}



! --------- 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 #####
Dateianhänge
Display-Unten-Kurz.jpg
Display-Unten-Kurz
LG Helikiller
Meine CCU2; 605 Kanäle in 180 Geräten + RaspiMatic P3 98 Kanäle in 31 Geräten

Joe Cooper
Beiträge: 2
Registriert: 17.10.2015, 09:13

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

Beitrag von Joe Cooper » 17.10.2015, 09:22

Hallo,

ich bin ein homematic Neuling und habe ein hm-pb-4dis-wm-2 Display.

Auf diesem Display wollte ich das oben beschriebene Programm durchlaufen lassen.
Ich habe alle Tasten und Variablen nach der Beschreibung eingerichtet.

Leider wird auf dem Display keine Rückmeldung angezeigt. :?

Gluehwurm
Beiträge: 12432
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 » 17.10.2015, 09:31

Ok, falsch, das ist das falsche Display, siehe Überschrift

Gruß
bruno

Joe Cooper
Beiträge: 2
Registriert: 17.10.2015, 09:13

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

Beitrag von Joe Cooper » 17.10.2015, 21:30

Gluehwurm hat geschrieben:Ok, falsch, das ist das falsche Display, siehe Überschrift

Gruß
bruno
Habe ich jetzt auch gemerkt, dass es 2 völlig andere Arten von Display sind.

Benutzeravatar
fuckelkopp
Beiträge: 5
Registriert: 09.09.2015, 14:52

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

Beitrag von fuckelkopp » 17.11.2015, 07:21

Moin zusammen!

vielen Dank allen, die an dieser Umsetzung beteiligt waren!!! Die Scripte kann ich sehr gut gebrauchen! Ich lasse mir damit den Status meiner Alarmanlage anzeigen und schalte diese auch bei Bedarf auf "aktiviert", bzw. "deaktiviert", weitere Dinge wie Status des Garagentores, der Fenster, Türen, Waschmaschine folgen.

Vielen Dank und Grüße aus dem Sauerland!

PS: Das mit dem aktivieren/deaktivieren der Alarmanlage habe ich wieder raus genommen, da als Übertragunsmodus ausschießlich "Standard" und nicht "Gesichert" angeboten wird :-/ Ist wohl so da dieses Gerät eigentlich nur als "passives" Display gedacht ist.

Benutzeravatar
fuckelkopp
Beiträge: 5
Registriert: 09.09.2015, 14:52

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

Beitrag von fuckelkopp » 19.11.2015, 12:36

Hallo zusammen,

ich bastel mir gerade die Abfrage für einen Fensterkontakt zusammen, die Ausgabe "Garage offen" oder "Garage geschlossen" soll später im Display erfolgen. Kann mir bitte jemand bei der Programmierung behilflich sein?

Hier ist mein Ansatz den ich mir ersteimal im WebUI als Test ausgeben lassen möchte:

_______________________________
var garage = dom.GetObject("BidCos-RF.SERIENNUMMER:1.STATE").State(); !### bei SERIENNUMMER steht natürlich die des Kontaktes ;-)
if (garage.State()==0){
WriteLine("zu");
}
else {
WriteLine("auf");
}
_______________________________

Wahrscheinlich programmiere ich hier gerade völligen /&/%$"! zusammen, bin für jede Hilfe dankbar!!!!

Grüße aus dem Sauerland

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

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

Beitrag von ElmoS04 » 22.11.2015, 11:37

Hallo
Erstmal danke. Ich bin Anfänger und habe es bis jetzt alleine hinbekommen mit dem Seitenweise Blättern. Danke.
Jetzt stosse ich aber leider doch an meine Grenze. Es ist schon fast alles Perfekt, nur hätte ich etwas zu noch zu Ändern. Mein Problem liegt in Auf Seite 4 und 5.
Ich hätte gerne aus Seite 4 Die Fenster und Licht. Und Auf Seite 5 Die Wohnzimmertemperatur und wenn es geht die soll Temperatur. Aber ich bekomme das nicht hin. :cry:

Kann mir da wer Helfen . Aber was man nun mit dem Display anstellen kann ist schon erstaunlich.

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 = 9; 

! ###############################################################
  
! ####################### 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){
  
  
! ### Alarm ist ####
  
var oSysvar = dom.GetObject("Alarm ist");
if (oSysvar.State()==1){

string zeile1 = "";
 color1 = "0x85";
icon1 = "";
zeile2 = "Alarmanlage:";
color2 = "0x80";
icon2 = "";
zeile3 = "Scharf";
color3="0x81";
icon3 = "";
zeile4 = "";
color4="0x81";
icon4 = "";
zeile5 = "";
color5 = "0x81";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";

}
else
{

string zeile1 = "";
 color1 = "0x85";
icon1 = "";
zeile2 = "Alarmanlage:";
color2 = "0x80";
icon2 = "";
zeile3 = "Unscharf";
color3="0x84";
icon3 = "";
zeile4 = "";
color4 = "0x84";
icon4 = "";
zeile5 = "";
color5 = "0x84";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";

}

}


! ###################### Seite 2 ######################
if (seitenZaehler.State()==2){
  
  
! ### Alarm ist ####
  
var oSysvar = dom.GetObject("Stiller Alarm");
if (oSysvar.State()==1){

string zeile1 = "Stiller";
 color1 = "0x80";
icon1 = "";
zeile2 = "Alarm:";
color2 = "0x80";
icon2 = "";
zeile3 = "Ein";
color3="0x81";
icon3 = "";
zeile4 = "";
color4="0x81";
icon4 = "";
zeile5 = "";
color5 = "0x81";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";

}
else
{

string zeile1 = "Stiller";
 color1 = "0x80";
icon1 = "";
zeile2 = "Alarm:";
color2 = "0x80";
icon2 = "";
zeile3 = "Aus";
color3="0x84";
icon3 = "";
zeile4 = "";
color4 = "0x84";
icon4 = "";
zeile5 = "";
color5 = "0x84";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";

}

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


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

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


string zeile1 = "";
 color1 = "0x85";
icon1 = "";
zeile2 = "Alarmanlage";
color2 = "0x80";
icon2 = "";
zeile3 = "Einschalt";
color3="0x81";
icon3 = "";
zeile4 = "Nicht Bereit";
color4="0x81";
icon4 = "";
zeile5 = "";
color5 = "0x84";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";
}
else
{

string zeile1 = "";
 color1 = "0x85";
icon1 = "";
zeile2 = "Alarmanlage:";
color2 = "0x80";
icon2 = "";
zeile3 = "Einschalt";
color3="0x84";
icon3 = "";
zeile4 = "Bereit";
color4="0x84";
icon4 = "";
zeile5 = "";
color5 = "0x81";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";
}
}

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


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


! ### Fenster ####
  
zeile1 = "Fenster:";
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("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) {
  zeile2 = cntopen # " Fenster";
  color2 = "0x81";
  icon2 = "";
  zeile3 = "offen";
  color3 = "0x81";
  icon3 = "";
} 

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

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


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

zeile4 = "Wohnzimmer:";
  color4 = "0x80";
  icon4 = "";
  zeile5 = ""#akttemp#" C";
  color5 = "0x81";
  icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";





  
}

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

! ### 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 = "";
} 

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


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

zeile4 = "Wohnzimmer:";
  color4 = "0x80";
  icon4 = "";
  zeile5 = ""#akttemp#" C";
  color5 = "0x81";
  icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";




  
}

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



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


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

string zeile1 = "";
 color1 = "0x85";
icon1 = "";
zeile2 = "Anwesenheit:";
color2 = "0x80";
icon2 = "";
zeile3 = "Anwesend";
color3="0x84";
icon3 = "";
zeile4 = "";
color4="0x81";
icon4 = "";
zeile4 ="";
color5 = "0x81";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";
}
else
{

string zeile1 = "";
color1 = "0x85";
icon1 = "";
zeile2 = "Anwesenheit";
color2 = "0x80";
icon2 = "";
zeile3 = "Abwesend";
color3="0x81";
icon3 = "";
zeile4 ="";
color4 = "0x84";
icon4 = "";
zeile5 = "";
color5 = "0x84";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";
}
}

! ###################### Seite 7 ######################

if (seitenZaehler.State()==7){
  
  
! ### Schlafmodus an oder aus? ####
  
var oSysvar = dom.GetObject("Schlafmodus");
if (oSysvar.State()==1){

zeile1 = "";
color1 = "0x80";
icon1 = "";
zeile2 = "Schlafen:";
color2 = "0x80";
icon2 = "";
zeile3 = "Schlafen";
color3="0x81";
icon3 = "";
zeile4 = "";
color4="0x81";
icon4 = "";
zeile5 = "";
color5 = "0x81";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";
}
else
{

zeile1 = "";
color1 = "0x80";
icon1 = "";
zeile2 = "Schlafen:";
color2 = "0x80";
icon2 = "";
zeile3 = "Wach";
color3="0x84";
icon3 = "";
zeile4 = "";
color4 = "0x84";
icon4 = "";
zeile5 = "";
color5 = "0x84";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";
}
}


! ###################### Seite 8 ######################


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

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

zeile1 = "";
color1 = "0x80";
icon1 = "";
zeile2 = "Wecker:";
color2 = "0x80";
icon2 = "";
zeile3 = "Ein";
color3="0x81";
icon3 = "";
zeile4 = "";
color4="0x81";
icon4 = "";
zeile5 = "";
color5 = "0x81";
icon5 = "";
string zeile6 = system.Date("%H:%M Uhr");
 color6 = "0x85";
icon6 = "";
}
else
{

zeile1 = "";
color1 = "0x80";
icon1 = "";
zeile2 = "Wecker:";
color2 = "0x80";
icon2 = "";
zeile3 = "Aus";
color3="0x84";
icon3 = "";
zeile4 = "";
color4="0x84";
icon4 = "";

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


! ###################### Seite 9 ######################


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

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

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

zeile1 = "";
color1 = "0x80";
icon1 = "";
zeile2 = "Gong:";
color2 = "0x80";
icon2 = "";
zeile3 = "An";
color3="0x84";
icon3 = "";
zeile4 = "";
color4="0x84";
icon4 = "";

zeile5 = "";
color5 = "0x84";
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 #####
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

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

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

Beitrag von ElmoS04 » 25.11.2015, 21:55

Hallo liebe Mitglieder
Ich habe noch eine Frage zu diesem Skript.
Wenn ich mit dem seitenweise blättern z.b. auf Seite 4 bin kann ich mit dem Langen tasten druck eine SystemVar verstellen. Aber nur war oder Falsch. Ich kann ja nicht in eine 1;2;3;4; has ändern. Richtig?
Und wie könnte ich z.b. ein Skript ausführen ? Ich hätte gerne wenn Licht ein Angezeigt wird. Das ich mit langen Tasten druck alle lichter aus schalte. Das Skript alle Lichter aus habe ich schon in Verwendung. Aber wie bekomme ich das in die Taste Oben Lang Var eingepflegt?

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

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.11.2015, 12:37

Hat sich erledigt. [emoji322][emoji322][emoji322][emoji322]
Habe es nach Tagen endlich geschafft.


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

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

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

Beitrag von gehard2001 » 26.11.2015, 19:04

Wow! Was für ein geniales script. :!:
Zuletzt geändert von gehard2001 am 07.03.2016, 21:52, insgesamt 1-mal geändert.

Antworten

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