HM-Dis-WM55 (OLED Farbdisplay) - Skript funktioniert nur bis zum Neustart

Allgemeines zur HomeMatic Haussteuerung

Moderator: Co-Administratoren

Antworten
capitaen_z
Beiträge: 130
Registriert: 05.07.2015, 19:34
Wohnort: Hamburg
Danksagung erhalten: 3 Mal

HM-Dis-WM55 (OLED Farbdisplay) - Skript funktioniert nur bis zum Neustart

Beitrag von capitaen_z » 02.11.2018, 18:03

Hallo zusammen,

ein altes Problem ist mit der neuen Raspberrymatic Version wieder aufgekommen und wurde kurz im "falschen" Thema angesprochen.

Ich verwende dieses Skript:

Code: Alles auswählen

                                                                                                                                                !! (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 "Fenster" 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)

    ! ==================================================================================================

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


! ## Außentemperatur

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

zeile1 = "Temp "#temp.ToString(1)#" C";

if (temp >= 20.0) {color1 = "0x81";}
if (temp >= 10.0) {color1 = "0x83";}
if (temp >= 5.0) {color1 = "0x80";}
if (temp < 0.0) {color1 = "0x85";}
if (temp < -5.0) {color1 = "0x85";}
if (temp < -10.0) {color1 = "0x85";}
! icon3 = "0x86";

! ## Luftfeuchte

var term="LEQ0798861";
var channel=dom.GetObject("BidCos-RF."#term#":1.HUMIDITY");
var hum = channel.Value();

zeile2 = "Hum "#hum.ToString(1)#" %";

if (hum >= 40) {color2 = "0x85";}
if (hum >= 50) {color2 = "0x84";}
if (hum >= 60) {color2 = "0x84";}
if (hum >= 70) {color2 = "0x83";}
if (hum >= 80) {color2 = "0x82";}
if (hum >= 90) {color2 = "0x81";}
! icon2 = "0x86";

! Uhrzeit

! var uhr = dom.GetObject("%Uhrzeit%").State();
! zeile4 = "Zeit "#uhr.ToString(0)#" H";
zeile4 = ""# system.Date("%H:%M") #" Uhr";

! var oSysvar = dom.GetObject("Uhrzeit");
! zeile4 = "Time "#Uhrzeit.ToString(0)#" H";


! Fensterprüfung

var oSysvar = dom.GetObject("Fenstervariable");
if (oSysvar.State()==1){
! ## Kanal : MEQ0180208:1 -> Text Zeile 6 , Textfarbe Weiß, Icon
zeile6 = "Fenster zu";
icon6 = "0x83";
color6="0x84";
}
else
{
! ## Kanal : MEQ0180208:1 -> Text Zeile 6 , Textfarbe Rot, Icon
zeile6 = "Fenster auf";
color6 = "0x81";
icon6 = "0x82";
}


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! 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);
Nun ist es so, dass ich zuvor dieses Skript (hier unten) 1x laufen lassen muss, damit das eigentliche Skript (oben) bis zum Neustart des Raspberry/CCU2 funktioniert:

Code: Alles auswählen

                       !! Universalprogramm zum Füllen
!! (c) DrTob
!! optimized by thkl

!! 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 = "Zeile 1";
string color1 = "0x80";
string icon1  = "";

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

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

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

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

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

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! 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);
Alchy hat bereits versucht zu helfen:
alchy hat geschrieben:
02.11.2018, 11:35
WENN
man ein Script ausführt
UND
es macht nicht, was es soll
UND
man will Hilfe..
DANN
postet man das >> Fehlerprotokoll << zur Laufzeit des Scriptes. :twisted:

Trotzdem bleibt der Rat lt. Glaskugel derselbe auch wenn du ihn standhaft ignorierst.
Deklariere in deinem Script die Scriptvariablen welche du verwendest.

Kopiere also die folgende Zeile an den Anfang deines Scriptes

Code: Alles auswählen

string zeile1;string color1;string icon1;string zeile2;string color2;string icon2;string zeile3;string color3;string icon3;string zeile4;string color4;string icon4;string zeile5;string color5;string icon5;string zeile6;string color6;string icon6;
Alchy
Ich habe dann wie von Alchy vorgeschlagen diese Zeile eingefügt:

Code: Alles auswählen

string zeile1;string color1;string icon1;string zeile2;string color2;string icon2;string zeile3;string color3;string icon3;string zeile4;string color4;string icon4;string zeile5;string color5;string icon5;string zeile6;string color6;string icon6;
Leider auch ohne Erfolg.

Reicht ein Ausschnitt vom Log? Das Display hat ca. zwischen 17:16 und 17:18 nicht funktioniert (Anzeige: Keine Daten).

Code: Alles auswählen

Nov 2 17:13:12 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 1. Original time: 1541174890009 
Nov 2 17:13:44 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 2. Original time: 1541174918009 
Nov 2 17:13:54 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 8. Original time: 1541174932009 
Nov 2 17:14:22 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 7. Original time: 1541174962009 
Nov 2 17:15:20 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 6. Original time: 1541175014010 
Nov 2 17:15:32 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 5. Original time: 1541175024009 
Nov 2 17:15:44 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 6. Original time: 1541175034009 
Nov 2 17:16:02 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 3. Original time: 1541175060010 
Nov 2 17:16:02 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 4. Original time: 1541175060010 
Nov 2 17:16:08 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 1. Original time: 1541175066009 
Nov 2 17:16:42 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 2. Original time: 1541175094009 
Nov 2 17:16:46 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 7. Original time: 1541175104010 
Nov 2 17:17:04 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 8. Original time: 1541175122010 
Nov 2 17:17:28 de.eq3.cbcs.server.core.otau.DeviceBackgroundUpdateSubsystem INFO  [vert.x-eventloop-thread-5] SYSTEM: 0 Accesspoints in Queue 
Nov 2 17:17:28 de.eq3.cbcs.server.core.otau.DeviceBackgroundUpdateSubsystem INFO  [vert.x-eventloop-thread-5] SYSTEM: Permanent-/Burstlistener Handler utilization: 0/50 used 
Nov 2 17:17:28 de.eq3.cbcs.server.core.otau.DeviceBackgroundUpdateSubsystem INFO  [vert.x-eventloop-thread-5] SYSTEM: Eventlistener Handler utilization: 0/50 used 
Nov 2 17:18:02 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 6. Original time: 1541175172009 
Nov 2 17:18:04 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 5. Original time: 1541175182009 
Nov 2 17:18:22 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 6. Original time: 1541175192009 
Nov 2 17:18:48 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 3. Original time: 1541175226009 
Nov 2 17:18:48 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 4. Original time: 1541175226009 
Nov 2 17:18:50 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 1. Original time: 1541175228009 
Nov 2 17:18:56 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 7. Original time: 1541175234009 
Nov 2 17:19:18 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 2. Original time: 1541175256009 
Nov 2 17:20:22 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 8. Original time: 1541175312009 
Nov 2 17:20:22 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 6. Original time: 1541175314009 
Nov 2 17:20:24 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 5. Original time: 1541175324009 
Nov 2 17:20:36 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 6. Original time: 1541175334009 
Nov 2 17:21:14 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 1. Original time: 1541175374009 
Nov 2 17:21:18 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 3. Original time: 1541175376009 
Nov 2 17:21:18 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 4. Original time: 1541175376009 
Nov 2 17:21:48 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 2. Original time: 1541175402009 
Nov 2 17:22:28 de.eq3.cbcs.server.core.otau.DeviceBackgroundUpdateSubsystem INFO  [vert.x-eventloop-thread-5] SYSTEM: 0 Accesspoints in Queue 
Nov 2 17:22:28 de.eq3.cbcs.server.core.otau.DeviceBackgroundUpdateSubsystem INFO  [vert.x-eventloop-thread-5] SYSTEM: Permanent-/Burstlistener Handler utilization: 0/50 used 
Nov 2 17:22:28 de.eq3.cbcs.server.core.otau.DeviceBackgroundUpdateSubsystem INFO  [vert.x-eventloop-thread-5] SYSTEM: Eventlistener Handler utilization: 0/50 used 
Nov 2 17:22:34 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 5. Original time: 1541175454009 
Nov 2 17:22:46 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 6. Original time: 1541175464009 
Nov 2 17:23:26 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 8. Original time: 1541175502009 
Nov 2 17:23:32 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 1. Original time: 1541175508009 
Nov 2 17:23:32 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 3. Original time: 1541175512009 
Nov 2 17:23:32 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 4. Original time: 1541175512009 
Nov 2 17:23:58 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 2. Original time: 1541175536010 
Nov 2 17:24:40 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 7. Original time: 1541175574009 
Nov 2 17:25:24 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 6. Original time: 1541175622010 
Nov 2 17:25:34 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 5. Original time: 1541175632009 
Nov 2 17:25:44 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 6. Original time: 1541175642010 
Nov 2 17:26:22 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 3. Original time: 1541175678009 
Nov 2 17:26:22 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 4. Original time: 1541175678009 
Nov 2 17:26:36 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 1. Original time: 1541175690009 
Nov 2 17:26:36 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 8. Original time: 1541175694009 
Nov 2 17:27:00 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 2. Original time: 1541175718009 
Nov 2 17:27:04 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 7. Original time: 1541175724009 
Nov 2 17:27:28 de.eq3.cbcs.server.core.otau.DeviceBackgroundUpdateSubsystem INFO  [vert.x-eventloop-thread-5] SYSTEM: 0 Accesspoints in Queue 
Nov 2 17:27:28 de.eq3.cbcs.server.core.otau.DeviceBackgroundUpdateSubsystem INFO  [vert.x-eventloop-thread-5] SYSTEM: Permanent-/Burstlistener Handler utilization: 0/50 used 
Nov 2 17:27:28 de.eq3.cbcs.server.core.otau.DeviceBackgroundUpdateSubsystem INFO  [vert.x-eventloop-thread-5] SYSTEM: Eventlistener Handler utilization: 0/50 used 
Nov 2 17:28:10 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 6. Original time: 1541175786010 
Nov 2 17:28:14 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 5. Original time: 1541175794009 
Nov 2 17:28:36 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 6. Original time: 1541175806009 
Nov 2 17:28:58 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 3. Original time: 1541175830009 
Nov 2 17:28:58 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 4. Original time: 1541175830009 
Nov 2 17:29:18 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 1. Original time: 1541175858009 
Nov 2 17:29:18 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 7. Original time: 1541175858009 
Nov 2 17:29:50 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 8. Original time: 1541175884009 
Nov 2 17:29:50 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 2. Original time: 1541175886009 
Nov 2 17:30:38 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 6. Original time: 1541175934010 
Nov 2 17:30:58 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 5. Original time: 1541175944009 
Nov 2 17:30:58 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 6. Original time: 1541175954009 
Nov 2 17:31:10 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 3. Original time: 1541175968009 
Nov 2 17:31:10 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 4. Original time: 1541175968009 
Nov 2 17:31:20 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 7. Original time: 1541175978009 
Nov 2 17:31:56 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 1. Original time: 1541176010010 
Nov 2 17:32:22 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 2. Original time: 1541176040009 
Nov 2 17:32:28 de.eq3.cbcs.server.core.otau.DeviceBackgroundUpdateSubsystem INFO  [vert.x-eventloop-thread-5] SYSTEM: 0 Accesspoints in Queue 
Nov 2 17:32:28 de.eq3.cbcs.server.core.otau.DeviceBackgroundUpdateSubsystem INFO  [vert.x-eventloop-thread-5] SYSTEM: Permanent-/Burstlistener Handler utilization: 0/50 used 
Nov 2 17:32:28 de.eq3.cbcs.server.core.otau.DeviceBackgroundUpdateSubsystem INFO  [vert.x-eventloop-thread-5] SYSTEM: Eventlistener Handler utilization: 0/50 used 
Nov 2 17:33:00 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 6. Original time: 1541176070009 
Nov 2 17:33:00 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 8. Original time: 1541176074009 
Nov 2 17:33:00 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 5. Original time: 1541176078009 
Nov 2 17:33:00 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 5. Original time: 1541176080009 
Nov 2 17:33:20 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 3. Original time: 1541176090009 
Nov 2 17:33:20 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 4. Original time: 1541176090009 
Nov 2 17:33:20 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 6. Original time: 1541176090009 
Nov 2 17:34:08 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 7. Original time: 1541176148009 
Nov 2 17:34:14 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 1. Original time: 1541176150009 
Nov 2 17:34:44 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 2. Original time: 1541176178009 
Nov 2 17:34:52 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 6. Original time: 1541176190009 
Nov 2 17:35:00 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 5. Original time: 1541176200009 
Nov 2 17:35:14 de.eq3.lib.measurement.MeasurementService INFO  [Timer-0] Drop unhandled values (timeout) for diagram 6. Original time: 1541176210009 
VG
Leif

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 (OLED Farbdisplay) - Skript funktioniert nur bis zum Neustart

Beitrag von alchy » 02.11.2018, 21:33

Als erstes deaktivier mal deine Diagramme.
Keine deiner Meldungen passt zum eingesetzten Script.

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.

DrTob
Beiträge: 3426
Registriert: 29.10.2010, 08:24
Danksagung erhalten: 5 Mal

Re: HM-Dis-WM55 (OLED Farbdisplay) - Skript funktioniert nur bis zum Neustart

Beitrag von DrTob » 03.11.2018, 21:53

in dem Script fehlen diverse Variablendeklarationen. Durch das Ausführen des original-Scripts werden diese angelegt und dein Script funktioniert bis zum Neustart.

--> Keine Variablendeklarationen entfernen/auskommentieren!

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 (OLED Farbdisplay) - Skript funktioniert nur bis zum Neustart

Beitrag von alchy » 03.11.2018, 22:00

DrTob hat geschrieben:
03.11.2018, 21:53
in dem Script fehlen diverse Variablendeklarationen.

Hatte ich ihm schon geschrieben.

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.

capitaen_z
Beiträge: 130
Registriert: 05.07.2015, 19:34
Wohnort: Hamburg
Danksagung erhalten: 3 Mal

Re: HM-Dis-WM55 (OLED Farbdisplay) - Skript funktioniert nur bis zum Neustart

Beitrag von capitaen_z » 09.11.2018, 19:37

Heute nach einem Neustart vom Raspberry nochmals probiert und getestet:

Nach einem Neustart, sind laut Zentrale Fehler im Code und das Display zeigt: "Keine Daten empfangen"

Code: Alles auswählen

    !! (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 "Fenster" 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)

    ! ==================================================================================================

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


! ## Außentemperatur

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

zeile1 = "Temp "#temp.ToString(1)#" C";

if (temp >= 20.0) {color1 = "0x81";}
if (temp >= 10.0) {color1 = "0x83";}
if (temp >= 5.0) {color1 = "0x80";}
if (temp < 0.0) {color1 = "0x85";}
if (temp < -5.0) {color1 = "0x85";}
if (temp < -10.0) {color1 = "0x85";}
! icon3 = "0x86";

! ## Luftfeuchte

var term="LEQ0798861";
var channel=dom.GetObject("BidCos-RF."#term#":1.HUMIDITY");
var hum = channel.Value();

zeile2 = "Hum "#hum.ToString(1)#" %";

if (hum >= 40) {color2 = "0x85";}
if (hum >= 50) {color2 = "0x84";}
if (hum >= 60) {color2 = "0x84";}
if (hum >= 70) {color2 = "0x83";}
if (hum >= 80) {color2 = "0x82";}
if (hum >= 90) {color2 = "0x81";}
! icon2 = "0x86";

! Uhrzeit

! var uhr = dom.GetObject("%Uhrzeit%").State();
! zeile4 = "Zeit "#uhr.ToString(0)#" H";
zeile4 = ""# system.Date("%H:%M") #" Uhr";

! var oSysvar = dom.GetObject("Uhrzeit");
! zeile4 = "Time "#Uhrzeit.ToString(0)#" H";


! Fensterprüfung

var oSysvar = dom.GetObject("Fenstervariable");
if (oSysvar.State()==1){
! ## Kanal : MEQ0180208:1 -> Text Zeile 6 , Textfarbe Weiß, Icon
zeile6 = "Fenster zu";
icon6 = "0x83";
color6="0x84";
}
else
{
! ## Kanal : MEQ0180208:1 -> Text Zeile 6 , Textfarbe Rot, Icon
zeile6 = "Fenster auf";
color6 = "0x81";
icon6 = "0x82";
}


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! 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);

Also die Zeile Code von Alchy an den Anfang gesetzt:

Code: Alles auswählen

string zeile1;string color1;string icon1;string zeile2;string color2;string icon2;string zeile3;string color3;string icon3;string zeile4;string color4;string icon4;string zeile5;string color5;string icon5;string zeile6;string color6;string icon6; 
Der Code enthält nach einem Test keine Fehler mehr, jedoch zeigt das Display weiterhin: "Keine Daten empfangen".
Erst wenn ich diesen Code einfüge:

Code: Alles auswählen

                       !! Universalprogramm zum Füllen
!! (c) DrTob
!! optimized by thkl

!! 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 = "Zeile 1";
string color1 = "0x80";
string icon1  = "";

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

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

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

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

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

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! 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);
und das Display/den Taster betätige, zeigt das Display etwas an. Anschließend kann ich wieder mein Skript einfügen:

Code: Alles auswählen

    !! (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 "Fenster" 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)

    ! ==================================================================================================

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


! ## Außentemperatur

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

zeile1 = "Temp "#temp.ToString(1)#" C";

if (temp >= 20.0) {color1 = "0x81";}
if (temp >= 10.0) {color1 = "0x83";}
if (temp >= 5.0) {color1 = "0x80";}
if (temp < 0.0) {color1 = "0x85";}
if (temp < -5.0) {color1 = "0x85";}
if (temp < -10.0) {color1 = "0x85";}
! icon3 = "0x86";

! ## Luftfeuchte

var term="LEQ0798861";
var channel=dom.GetObject("BidCos-RF."#term#":1.HUMIDITY");
var hum = channel.Value();

zeile2 = "Hum "#hum.ToString(1)#" %";

if (hum >= 40) {color2 = "0x85";}
if (hum >= 50) {color2 = "0x84";}
if (hum >= 60) {color2 = "0x84";}
if (hum >= 70) {color2 = "0x83";}
if (hum >= 80) {color2 = "0x82";}
if (hum >= 90) {color2 = "0x81";}
! icon2 = "0x86";

! Uhrzeit

! var uhr = dom.GetObject("%Uhrzeit%").State();
! zeile4 = "Zeit "#uhr.ToString(0)#" H";
zeile4 = ""# system.Date("%H:%M") #" Uhr";

! var oSysvar = dom.GetObject("Uhrzeit");
! zeile4 = "Time "#Uhrzeit.ToString(0)#" H";


! Fensterprüfung

var oSysvar = dom.GetObject("Fenstervariable");
if (oSysvar.State()==1){
! ## Kanal : MEQ0180208:1 -> Text Zeile 6 , Textfarbe Weiß, Icon
zeile6 = "Fenster zu";
icon6 = "0x83";
color6="0x84";
}
else
{
! ## Kanal : MEQ0180208:1 -> Text Zeile 6 , Textfarbe Rot, Icon
zeile6 = "Fenster auf";
color6 = "0x81";
icon6 = "0x82";
}


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! 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);
und dieses funktioniert dann auch ohne die Zeile von Alchy!?
Sorry, aber irgendwie verstehe ich das nicht und es ist für mich nicht logisch nachvollziehbar.

Vielleicht hat ja noch jemand eine Idee?

VG
Leif

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 (OLED Farbdisplay) - Skript funktioniert nur bis zum Neustart

Beitrag von alchy » 09.11.2018, 21:18

Aber ich habe dir doch geschrieben, woran es liegt das dein Script nicht funktioniert.
Deklariere in deinem Script die Scriptvariablen welche du verwendest.
Deshalb auch die Zeile von mir. Ob ich da alle erwischt habe, weiß ich nicht. Schau selber !

Der Grund ist ganz einfach. Eine Variable muss dem System erstmal vorgestellt werden, bevor man sie verwenden kann.
Du setzt aber Ausrufezeichen vor die Vorstellung

Code: Alles auswählen

! string zeile2 = "";
was die Vorstellung logischerweise verhindert, weil du das System taub schaltest, versuchst aber später trotzdem auf die Variable zuzugreifen.

Code: Alles auswählen

...
msgBuffer = msgBuffer # zeile2 # splitter # color2 # splitter # icon2 # "\t";
....
Soweit also zum Anfang vom Ende und nur als Beispiel. Schau dein Script selber durch, ob du solche Fehler irgendwo findest.
Und erzähl mir nicht, das das keinen Fehler im Protokoll wirft.

[ERKLÄRBÄRMODUS]

An einem einfachen Beispiel:

Code: Alles auswählen

integer axt  = 1;
! integer beil = 2;
WriteLine(axt+beil);
die 3. Zeile soll was mit beil machen, nämlich addieren und das Ergebnis ausgeben.
Der Interpreter kennt beil aber nicht, da vor Zeile 2 ein ! steht. Die Folge ist ein syntx error und keine Ausgabe.
Nehm ich das ! weg, wird alles funktionieren.


Und jetzt wird es komplizierter. Man hat sich dazu entschlossen die erfolgreichen Vorstellungen in eine globale Liste zu schreiben.....
Aber dazu will ich jetzt nichts mehr sagen.

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.

capitaen_z
Beiträge: 130
Registriert: 05.07.2015, 19:34
Wohnort: Hamburg
Danksagung erhalten: 3 Mal

Re: HM-Dis-WM55 (OLED Farbdisplay) - Skript funktioniert nur bis zum Neustart

Beitrag von capitaen_z » 10.11.2018, 19:45

Hallo Alchy,

danke für deine Geduld/Hilfe.
Ich denke es hat "klick" gemacht und ich werde berichten ob es geklappt hat.

Ein Wort noch zu:
Soweit also zum Anfang vom Ende und nur als Beispiel. Schau dein Script selber durch, ob du solche Fehler irgendwo findest.
Und erzähl mir nicht, das das keinen Fehler im Protokoll wirft.
Wenn die CCU/Raspberry nach dem Test sagt, es seien keine Fehler erkannt, dann kann ich dies auch nur so wiedergeben, denn dann wäre alles andere gelogen und DESWEGEN habe ich mich an das Forum gewendet.
Bitte stecke mich nicht in die gleiche Schublade.

VG
Leif

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 (OLED Farbdisplay) - Skript funktioniert nur bis zum Neustart

Beitrag von alchy » 12.11.2018, 04:42

Nicht Schublade, Fehlerprotokoll.
Wenn du ein Script in ein Programm einfügt und an der Stelle testen drückst, muss das Script nicht zwangsläufig fehlerfrei sein, wenn es dort angezeigt wird.

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.

capitaen_z
Beiträge: 130
Registriert: 05.07.2015, 19:34
Wohnort: Hamburg
Danksagung erhalten: 3 Mal

Re: HM-Dis-WM55 (OLED Farbdisplay) - Skript funktioniert nur bis zum Neustart

Beitrag von capitaen_z » 27.11.2018, 18:01

Hallo zusammen,

das Skript läuft nun.
Danke für die Hilfe.
Was mir das Genick gebrochen hat, ist die Tatsache, dass einmal gesetzte Variablen im Testfenster, erst nach einem Neustart die Gültigkeit verlieren.
Hier nun das Skript wie es läuft:

Code: Alles auswählen

!! Universalprogramm zum Füllen V1.5
!! (c) DrTob 
!! optimized by thkl

!! 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 = "Zeile 1";
string color1 = "0x80";
string icon1  = "";

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

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

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

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

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

!!!!!!!!!!!!!!!!!!!!
! ## Außentemperatur
!!!!!!!!!!!!!!!!!!!!

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

zeile1 = "Temp "#temp.ToString(1)#" C";

if (temp >= 20.0) {color1 = "0x81";}
if (temp >= 10.0) {color1 = "0x83";}
if (temp >= 5.0) {color1 = "0x80";}
if (temp < 0.0) {color1 = "0x85";}
if (temp < -5.0) {color1 = "0x85";}
if (temp < -10.0) {color1 = "0x85";}

!!!!!!!!!!!!!!!!!!!!
! ## Luftfeuchte
!!!!!!!!!!!!!!!!!!!!

var term="LEQ0798861";
var channel=dom.GetObject("BidCos-RF."#term#":1.HUMIDITY");
var hum = channel.Value();

zeile2 = "Hum "#hum.ToString(1)#" %";

if (hum >= 40) {color2 = "0x85";}
if (hum >= 50) {color2 = "0x84";}
if (hum >= 60) {color2 = "0x84";}
if (hum >= 70) {color2 = "0x83";}
if (hum >= 80) {color2 = "0x82";}
if (hum >= 90) {color2 = "0x81";}

!!!!!!!!!!!!!!!!!!!!
! Niederschlag
!!!!!!!!!!!!!!!!!!!!

if (dom.GetObject("BidCos-RF.OEQ2596163:1.STATE").State()==1)
{
string zeile3 = "es regnet!";
string color3 = "0x85";
}
else
{
string zeile3 = "kein Regen!";
string color3 = "0x84";
}

!!!!!!!!!!!!!!!!!!!!
! Uhrzeit
!!!!!!!!!!!!!!!!!!!!

zeile4 = ""# system.Date("%H:%M") #" Uhr";

!!!!!!!!!!!!!!!!!!!!
! Müllabfuhr
!!!!!!!!!!!!!!!!!!!!

var grau_morgen = dom.GetObject("IST-Abfall-Grau-Morgen").Value();
var gelb_morgen = dom.GetObject("IST-Abfall-Gelb-Morgen").Value();
var gruen_morgen = dom.GetObject("IST-Abfall-Grün-Morgen").Value();

if ((grau_morgen == true) || (gelb_morgen == true) || (gruen_morgen == true))
{
string zeile5 = "morgen Müll !";
string color5 = "0x81";
}

var grau_heute = dom.GetObject("IST-Abfall-Grau-Heute").Value();
var gelb_heute = dom.GetObject("IST-Abfall-Gelb-Heute").Value();
var gruen_heute = dom.GetObject("IST-Abfall-Grün-Heute").Value();

if ((grau_heute == true) || (gelb_heute == true) || (gruen_heute == true))
{
string zeile5 = "heute Müll !";
string color5 = "0x81";
}

else
{
string zeile5 = "";
string color5 = "";
}

!!!!!!!!!!!!!!!!!!!!
! Fensterprüfung
!!!!!!!!!!!!!!!!!!!!

var oSysvar = dom.GetObject("Fenstervariable");
if (oSysvar.State()==1){
! ## Kanal : MEQ0180208:1 -> Text Zeile 6 , Textfarbe Weiß, Icon
zeile6 = "Fenster zu";
icon6 = "0x83";
color6="0x84";
}
else
{
! ## Kanal : MEQ0180208:1 -> Text Zeile 6 , Textfarbe Rot, Icon
zeile6 = "Fenster auf";
color6 = "0x81";
icon6 = "0x82";
}

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! 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\t?,0x3f"; 

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);
VG
Leif


Edit: War noch ein kleiner Fehler im Skript (Niederschlag).
Zuletzt geändert von capitaen_z am 15.12.2018, 15:23, insgesamt 1-mal geändert.

ibein
Beiträge: 73
Registriert: 21.01.2015, 14:06

Re: HM-Dis-WM55 (OLED Farbdisplay) - Skript funktioniert nur bis zum Neustart

Beitrag von ibein » 07.12.2018, 23:23

gelöscht

Antworten

Zurück zu „HomeMatic allgemein“