Link/Skript-Sammlung

Einrichtung, Anschluss und Programmierung der HomeMatic CCU

Moderator: Co-Administratoren

Benutzeravatar
AndiN
Beiträge: 2621
Registriert: 10.06.2015, 08:54
Wohnort: Hennef
Hat sich bedankt: 10 Mal
Danksagung erhalten: 28 Mal

Link/Skript-Sammlung

Beitrag von AndiN » 24.11.2015, 18:50

Zuletzt geändert von AndiN am 21.01.2020, 18:38, insgesamt 88-mal geändert.
Andi (Greenhorn)

Letzter Reboot: 17.03.24 => FW Update (Uptime:Rekord:153 Tage)
Systeminfos: Raspberry Pi3 Firmware: 3.75.6.20240316 142 Geräte
System angebunden: 3 Roomba 650 - Sprachausgabe via Home24 Media - Pocket Control
- Zentrale: Asus TF103 mit Home24 Tablet
Addons: Drucken 2.5 - HQ WebUI 2.5.9 - XML-API 1.22 - CUx-Daemon 2.9.3 - E-Mail 1.7.4 - hm_pdetect 1.11 - VPN cloudmatic
Diverse Links

Benutzeravatar
AndiN
Beiträge: 2621
Registriert: 10.06.2015, 08:54
Wohnort: Hennef
Hat sich bedankt: 10 Mal
Danksagung erhalten: 28 Mal

Re: Script Probleme (überarbeitete Skripts)

Beitrag von AndiN » 24.11.2015, 18:52

[...]
Zuletzt geändert von AndiN am 12.08.2016, 09:01, insgesamt 23-mal geändert.
Andi (Greenhorn)

Letzter Reboot: 17.03.24 => FW Update (Uptime:Rekord:153 Tage)
Systeminfos: Raspberry Pi3 Firmware: 3.75.6.20240316 142 Geräte
System angebunden: 3 Roomba 650 - Sprachausgabe via Home24 Media - Pocket Control
- Zentrale: Asus TF103 mit Home24 Tablet
Addons: Drucken 2.5 - HQ WebUI 2.5.9 - XML-API 1.22 - CUx-Daemon 2.9.3 - E-Mail 1.7.4 - hm_pdetect 1.11 - VPN cloudmatic
Diverse Links

Benutzeravatar
AndiN
Beiträge: 2621
Registriert: 10.06.2015, 08:54
Wohnort: Hennef
Hat sich bedankt: 10 Mal
Danksagung erhalten: 28 Mal

Re: Script Probleme (überarbeitete Skripts)

Beitrag von AndiN » 24.11.2015, 18:55

Wunderground Wetter (http://homematic-forum.de/forum/viewtop ... 31&t=10071) durch Luckysnooze weiter optimierte Version

Code: Alles auswählen

! Wetter_Daten_holen V1.04_tmp
! ---------------- Modify by Luckysnooze---------------
! -------------------- Anpassungen --------------------
!  Zugangsdaten Wetterdienst Wunderground.com
var tmpA1 = "0123456789ABCDEF"; ! (Persoenlicher Api-Key)
var tmpA2 = "Germany/Hannover"; ! (Hier Ort eintragen)
!var tmpA2 = "pws:INIEDERS579"; ! (oder: Wetterstation direkt eintragen)
! ----------------- Ende Anpassungen -------------------
!
! Suchwort,kuerze vorne,kuerze hinten,Datenart,Systemvariable
string tmpA = "station_id,1,2,1,WD_Station,";!Zeichenkette
string tmpB = "observation_time_rfc822,6,11,1,WD_Zeit,";!Zeichenkette
string tmpC = "weather,1,2,1,WD_Allgemein,";!Zeichenkette
string tmpD = "UV,1,2,3,WD_UV,";!Zahl
string tmpE = "temp_c,1,2,3,WD_Temperatur,";!Zahl °C
string tmpF = "dewpoint_c,1,2,3,WD_Taupunkt,";!Zahl °C
string tmpG = "pressure_mb,1,2,2,WD_Luftdruck,";!Zahl mbar
string tmpH = "pressure_trend,1,2,1,WD_Luftdruck Trend,";!Zeichenkette
string tmpI = "relative_humidity,1,2,2,WD_Luftfeuchte,";!Zahl %
string tmpJ = "precip_1hr_in,1,2,4,WD_Regen Stunde,";!Zahl mm
string tmpK = "precip_today_in,1,2,4,WD_Regen Heute,";!Zahl mm
string tmpL= "wind_degrees,1,2,5,WD_Windrichtung 1,";!Zeichenkette
string tmpM = "wind_degrees,1,2,2,WD_Windrichtung 2,";!Zahl °
string tmpN = "wind_kph,1,2,3,WD_Windstaerke,";!Zahl km/h
string tmpO = "wind_gust_kph,1,2,3,WD_Windboeen,";!Zahl km/h
string tmpP = tmpA#tmpB#tmpC#tmpD#tmpE#tmpF#tmpG#tmpH#tmpI#tmpJ#tmpK#tmpL#tmpM#tmpN#tmpO;
! Kurz- oder Langform: Variable tmpR in Zeile 72 anpassen
string tmpQ ="N,NNO,NO,ONO,O,OSO,SO,SSO,S,SSW,SW,WSW,W,WNW,NW,NNW,N";
string tmpR ="Nord,Nord-Nordost,Nordost,Ost-Nordost,Ost,Ost-Südost,Südost,Süd-Südost,Süd,Süd-Südwest,Südwest,West-Südwest,West,West-Nordwest,Nordwest,Nord-Nordwest,Nord";
string tmpS;
string tmpT;
string tmpU;
integer tmpV;
integer tmpW;
integer tmpX;
string tmpY;
integer tmpZ;
integer tmpB1;
string tmpC1;
integer tmpD1;
real tmpE1;

! URL zusammensetzen und Wetterdaten.xml von Wunderground holen
tmpS = "http://api.wunderground.com/api/" # tmpA1 # "/conditions/lang:DL/q/" # tmpA2 # ".xml";
dom.GetObject("CUxD.CUX2801001:2.CMD_SETS").State("wget -q -O - '" # tmpS # "'");
dom.GetObject("CUxD.CUX2801001:2.CMD_QUERY_RET").State(1);
tmpT = dom.GetObject("CUxD.CUX2801001:2.CMD_RETS").State();

! Wetterdaten um Header kuerzen
tmpZ = tmpT.Length();
tmpB1 = tmpT.Find("station_id");
tmpT = tmpT.Substr(tmpB1, (tmpZ - tmpB1));

! Daten aus XML-File ausfiltern und in Systemvariablen speichern
tmpD1 = 0;
while(tmpD1 < 75) {;
tmpU = tmpP.StrValueByIndex(",", tmpD1);
tmpV = tmpP.StrValueByIndex(",", tmpD1 + 1);
tmpW = tmpP.StrValueByIndex(",", tmpD1 + 2);
tmpX = tmpP.StrValueByIndex(",", tmpD1 + 3);
tmpY = tmpP.StrValueByIndex(",", tmpD1 + 4);
tmpZ = tmpU.Length();
tmpB1 = tmpT.Find(tmpU);
tmpC1 = tmpT.Substr((tmpB1 + tmpZ + tmpV.ToInteger()), 100);
tmpB1 = tmpC1.Find(tmpU);
tmpC1 = tmpC1.Substr(0, (tmpB1 - tmpW.ToInteger()));
if (tmpX == 1) {string tmpF1 = tmpC1;}
if (tmpX == 2) {integer tmpF1 = tmpC1.ToInteger();}
if (tmpX == 3) {real tmpF1 = tmpC1.ToFloat();}
if (tmpX == 4) {real tmpF1 = tmpC1.ToFloat() * 25.4;}
if (tmpX == 5) {tmpE1 = tmpC1.ToFloat() /22.5;
               string tmpF1 = tmpR.StrValueByIndex(",", tmpE1.ToString(0));}
dom.GetObject(tmpY).State(tmpF1);
tmpD1 = tmpD1 + 5;}
Zuletzt geändert von AndiN am 10.08.2016, 15:23, insgesamt 18-mal geändert.
Andi (Greenhorn)

Letzter Reboot: 17.03.24 => FW Update (Uptime:Rekord:153 Tage)
Systeminfos: Raspberry Pi3 Firmware: 3.75.6.20240316 142 Geräte
System angebunden: 3 Roomba 650 - Sprachausgabe via Home24 Media - Pocket Control
- Zentrale: Asus TF103 mit Home24 Tablet
Addons: Drucken 2.5 - HQ WebUI 2.5.9 - XML-API 1.22 - CUx-Daemon 2.9.3 - E-Mail 1.7.4 - hm_pdetect 1.11 - VPN cloudmatic
Diverse Links

Benutzeravatar
AndiN
Beiträge: 2621
Registriert: 10.06.2015, 08:54
Wohnort: Hennef
Hat sich bedankt: 10 Mal
Danksagung erhalten: 28 Mal

Re: Script Probleme (überarbeitete Skripts)

Beitrag von AndiN » 24.11.2015, 18:58

Servicemeldungen von alchy und dtp (http://homematic-forum.de/forum/viewtop ... 31&t=24618) überarbeitet von Papi

Code: Alles auswählen

! nServicemeldungen auslesen und weiter verarbeiten
! v1.8 (c) by alchy
! von AndiN auf tmp-Variablen umgeschrieben auf v2.2.8 (Stand: 26.05.2017) 

!++++++ SETUP ++++++
! Bitte in Ruhe die naechsten Zeilen durcharbeiten
var tmpA = "ja"; ! Wenn ja, wird die Alarmzeit Zeit mitgesendet
! +++++ Servicemeldungen "Kommunikation war gestoert" bestaetigen? ++++++
var tmpB = "ja"; ! ja oder nein, um anstehende "war Kommunikationsstoerungen" zu bestaetigen
! HM Geraet, wessen Systemmeldungen nicht verschickt werden sollen
var tmpC = "JEQ009311 NEP987654321"; ! Seriennummern von Geraeten, welche durch das Script ignoriert werden sollen

!++++++ PUSHBULLET +++++++++
var tmpD = "nein"; ! ja oder nein fuer die Verwendung PUSHBULLET direkt im Script;
var tmpE ="++++++++++++++++++++"; ! selbsterklaerend
var tmpF = "+++++++++++++++++++";
var tmpG = "CUX2801001:4"; !welches CUXD.EXEC Geraet mit Kanal soll verwendet werden ?
var tmpH = "Homematic"; !kann jeder nennen wie er will

!++++++ TELEGRAM +++++++++
var tmpI = "nein"; ! ja oder nein fuer die Verwendung TELEGRAM direkt im Script;
var tmpJ = "+++++++++++"; ! selbsterklärend
var tmpK = "+++++++++++++++++++"; ! dito
var tmpL = "CUX2801001:2"; !welches CUXD.EXEC Geraet mit Kanal soll verwendet werden ?

!++++++ Prowl Setup fuer die Apfeljuenger +++++++++
! 1. Prowl einrichten ( http://homematic-forum.de/forum/viewtopic.php?f=19&t=7797 )
! 2. cuxd Installation erforderlich
var tmpM = "nein"; ! ja oder nein fuer die Verwendung prowl direkt im Script;
var tmpN ="DEIN API KEY"; ! selbsterklaerend
var tmpO = "CUX2801001:3"; !welches CUXD.EXEC Geraet mit Kanal soll verwendet werden ?
var tmpP = "Homematic"; !kann jeder nennen wie er will
var tmpQ ="Servicemeldung"; !kann jeder nennen wie er will
var tmpR = "10";

!+++++++ Pushover Setup ++++++
! 1. pushover einrichten ( http://homematic-forum.de/forum/viewtopic.php?f=31&t=11579 )
! 2. cuxd Installation erforderlich
var tmpS = "nein"; ! das Übliche
var tmpT = "CUX2801001:2"; !welches CUXD.EXEC Geraet mit Kanal soll verwendet werden ?
var tmpU = "++++++++++++++++++";
var tmpV = "+++++++++++++++++";
var tmpW = ""; ! welches eingerichtete Gerät soll die Meldung bekommen? leer = alle Geraete sonst Namen komma separiert
var tmpX = "30"; !wiederholungen des Alarm bei prio >1
var tmpY = "120"; ! wie lange bis verfaellt
var tmpZ = "siren"; !Sound nach wahl siehe "https://pushover.net/api#sounds"
var tmpA1 ="1"; ! 1 use html codes at the tmpR2
var tmpB1 = "1";
var tmpC1 = "-2"; ! siehe http://homematic-forum.de/forum/viewtopic.php?f=31&t=24618&start=530#p288205

!+++++++ Setup Mail verschicken mit CUXD und Emailaddon ++++++
! 1. CUXD incl. exec Geraet sind installiert ( http://homematic-forum.de/forum/viewtopic.php?f=37&t=15298 )
! 2. Mailaddon ist installiert eingestellt und funktioniert ( http://www.homematic-inside.de/software/email )
! 3. Im TCL Reiter im MailAddon wird als erste Zeile "set serviceliste [encoding convertfrom utf-8 [ltmpO2 $argv 1]]" ohne Anfuehrungsstriche eingegeben
! 4. in Mailvorlage Nr deiner Wahl wird "$serviceliste" ohne Anfuehrungsstriche im Mailtextfeld eingegeben (was da noch steht ist uninteressant)
var tmpD1 = "ja"; !   ja / nein schicken einer Mail direkt ueber das Script
var tmpE1 = "02"; !  die VORHER praeparierte Mailvorlage 01 - 50 in der aktuellen Version des mailaddon
var tmpF1 = "CUX2801001:14"; !   die Serial des EXEC Geraete - wer nicht weiss was ich meine, einfach so lassen ist die Standard

!+++++++ Systemvariablen Setup ++++++
! 1. Vor Benutzung Systemvariable vom Typ Zeichenkette in CCU anlegen,
var tmpG1 = "ja"; ! ja / nein Speichern der Ausgabe des Scriptes in Systemvariable
var tmpH1 = "SV_System_Meldung"; ! hier den Namen dieser Variablen eintragen


!+++++++ Eigentlich schon fertig mit dem Setup +++++++++++
!+++++ Batteriezuweisungen inklusive Anzahl !Bitte helfen und fehlende Geraete posten ++++++++++++++++
!+++++ noch nicht integrierte Geraete werden mit unbekannt ausgegeben ++++++++++++++++
string tmpI1 = "HM-RC-4\tHM-RC-4-B\tHM-RC-Key3\tHM-RC-Key3-B\tHM-RC-P1\tHM-RC-Sec3\tHM-RC-Sec3-B";
string tmpJ1 = "HM-PB-2-WM\tHM-PB-4-WM\tHM-PBI-4-FM\tHM-SCI-3-FM\tHM-Sec-TiS\tHM-SwI-3-FM\tHM-Sec-TiS";
string tmpK1 = "HM-Sec-Sir-WM\tHM-OU-CFM-TW";
string tmpL1 = "HM-Sec-SC\tHM-Sec-SC2\tHM-Sec-SC-2\tHM-Sec-RHS";
string tmpM1 = "HM-CC-VD\tHM-CC-RT-DN\tHM-Sec-WDS\tHM-Sec-WDS-2\tHM-CC-TC\tHM-Dis-TD-T\tHB-UW-Sen-THPL-I\tHM-TC-IT-WM-W-EU\tHM-WDS40-TH-I\tHM-WDS40-TH-I-2\tHM-WDS10-TH-O\tHmIP-SMI\tHMIP-eTRV\tHM-WDS30-OT2-SM-2\tHmIP-SMO\tHmIP-SMO-A\tHmIP-SPI\tHmIP-STHD";
string tmpN1 = "HM-Sec-MDIR\tHM-Sec-MDIR-2\tHM-Sec-SD\tHM-Sec-Key\tHM-Sec-Key-S\tHM-Sec-Key-O\tHM-Sen-Wa-Od\tHM-Sen-MDIR\tHM-Sen-MDIR-O\tHM-Sen-MDIR-O-2\tHM-WDS100-C6-O\tHM-WDS100-C6-O-2\tHM-WDS100-C6-O-2\tHmIP-ASIR";
string tmpO1 = "HM-CCU-1\tHM-ES-TX-WM\tHM-WDC7000";
string tmpP1 = "HM-RC-4-2\tHM-RC-4-3\tHM-RC-Key4-2\tHM-RC-Key4-3\tHM-RC-Sec4-2\tHM-RC-Sec4-3\tHM-Sec-RHS-2\tHM-Sec-SCo\tHmIP-KRC4\tHmIP-KRCA\tHmIP-RC8\tHmIP-SRH\tHMIP-SWDO";
string tmpQ1 = "HM-Dis-WM55\tHM-Dis-EP-WM55\tHM-PB-2-WM55\tHM-PB-2-WM55-2\tHM-PB-6-WM55\tHM-PBI-2-FM\tHM-RC-8\tHM-Sen-DB-PCB\tHM-Sen-EP\tHM-Sen-MDIR-SM\tHM-Sen-MDIR-WM55\tHM-TC-IT-WM-W-EU\tHM-WDS30-T-O\tHM-WDS30-OT2-SM\tHmIP-STH\tHMIP-WRC2\tHMIP-WRC6\tHMIP-WTH\tHMIP-WTH-2";
string tmpR1 = "HM-PB-4Dis-WM\tHM-PB-4Dis-WM-2\tHM-RC-Dis-H-x-EU\tHM-Sen-LI-O";
string tmpS1 = "HM-RC-19\tHM-RC-19-B\tHM-RC-12\tHM-RC-12-B\tHM-RC-12-W";
string tmpT1 = "HM-LC-Sw1-Ba-PCB\tHM-LC-Sw4-PCB\tHM-MOD-EM-8\tHM-MOD-Re-8\tHM-Sen-RD-O\tHM-OU-CM-PCB\tHM-LC-Sw4-WM";
string tmpU1 = "HM-Sec-SD-2\tHMIP-SWSD";
string tmpV1 = "HM-Sec-Win";


!+++++++++ Setup nun aber wirklich zu Ende - ab hier Finger weg ;-) ++++++++++++++++++
if ( (dom.GetObject(ID_DATAPOINTS)).Get("CUxD.CUX2801001:1.CMD_EXEC")) { (dom.GetObject(ID_DATAPOINTS)).Get("CUxD.CUX2801001:1.CMD_EXEC").State("logger -t script -p user.debug [ALCHY ALLINScript START]"); } else {string tmpY1;string tmpZ1; system.Exec("logger -t script -p user.debug [ALCHY ALLINScript se START]", &tmpY1, &tmpZ1);}
if  ( dom.GetObject(41).Value() > dom.GetObject(41).LastValue() )   { boolean tmpW1 = true; string tmpX1 = "NEUE Servicemeldung\n" ;} else { string tmpX1 = "ALTE Servicemeldung\n";boolean tmpW1 = false; }

object tmpA2 = dom.GetObject(ID_SERVICES);
if(tmpA2) {
string tmpB2;
string tmpC2;
string tmpD2;
foreach(tmpB2, tmpA2.EnumIDs()) {
        object tmpE2 = dom.GetObject(tmpB2);
           if (tmpE2) {
         if(tmpE2.IsTypeOf(OT_ALARMDP) && (tmpE2.AlState() == asOncoming)) {
         boolean tmpF2 = true;
           object tmpG2 = dom.GetObject(tmpE2.AlTriggerDP());
           object tmpH2 = dom.GetObject((tmpG2.Channel()));
           object tmpI2 = dom.GetObject((tmpH2.Device()));
           var tmpJ2 = tmpG2.Value();
           time tmpK2 = tmpE2.AlOccurrenceTime(); ! erste Meldezeit
         time tmpL2 = tmpE2.LastTriggerTime(); !letze Meldezeit
      var tmpC2 = tmpG2.HssType();
      var tmpM2 = tmpI2.Address();
if ((tmpC2 == "STICKY_UNREACH") && (tmpB == "ja")) { tmpE2.AlReceipt(); tmpF2 = false;}
! Testausgabe
tmpD2 = tmpD2 #"tmpE2:" #tmpE2 # "\r\t tmpG2: " #tmpG2 #"\r\t Kanal:" #tmpH2.Name() #"\r\t Gerät:" #tmpI2.Name() #"\r\t tmpJ2:" #tmpJ2 #"\r\t erste Meldezeit:" #tmpK2 #"\r\t letzte Meldezeit: "# tmpL2 #"\r\t tmpC2:" #tmpC2 #"\r\t tmpM2:" #tmpM2#"\r\n";

if ( (tmpC.Find(tmpM2)<0)  && (tmpF2) ) {

      ! Uebersetzen der Fehlermeldungen
       
      if (tmpC2 == "CONFIG_PENDING") {tmpC2 = "Konfigurationsdaten stehen zum Transfer an"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
      if (tmpC2 == "LOWBAT") {tmpC2 = "Batteriestand niedrig"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
      if (tmpC2 == "STICKY_UNREACH") {tmpC2 = "hatte Kommunikationsfehler"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
      if (tmpC2 == "UNREACH") {tmpC2 = "hat Kommunikationsfehler"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
      if (tmpC2 == "DEVICE_IN_BOOTLOADER"){tmpC2 = "Device startet neu"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
      if (tmpC2 == "UPDATE_PENDING") {tmpC2 = "Update verfuegbar"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
      if (tmpC2 == "U_SOURCE_FAIL") {tmpC2 = "Netzteil ausgefallen"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
      if (tmpC2 == "USBH_POWERFAIL") {tmpC2 = "USB-Host deaktiviert"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
      if (tmpC2 == "ERROR_SABOTAGE") {tmpC2 = "Sabotage"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
      if (tmpC2 == "STICKY_SABOTAGE") {tmpC2 = "hatte Sabotagemeldung"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
      if (tmpC2 == "ERROR_REDUCED"){tmpC2 = "Temperatur kritisch (Lastabsenkung)."; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}

        ! Sonderfehler
        if (tmpC2 == "ERROR") {
        if((tmpI2.HssType()=="HM-Sec-RHS") || (tmpI2.HssType()=="HM-Sec-SC") || (tmpI2.HssType()=="HM-Sec-SC-2") || (tmpI2.HssType()=="HM-Sec-SCo") || (tmpI2.HssType()=="HM-Sec-MD") || (tmpI2.HssType()=="HM-Sec-MDIR") || (tmpI2.HssType()=="HM-Sec-MDIR-2") || (tmpI2.HssType()=="HM-Sec-Sir-WM"))
           {
              if (tmpJ2 == 7){tmpC2 = "Sabotage"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
            }
            if ((tmpI2.HssType()=="HM-Sec-Key") || (tmpI2.HssType()=="HM-Sec-Key-S") || (tmpI2.HssType()=="HM-Sec-Key-O"))
            {
              if (tmpJ2 == 1){tmpC2 = "Einkuppeln fehlgeschlagen"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
              if (tmpJ2 == 2){tmpC2 = "Motorlauf abgebrochen"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
            }
           if (tmpI2.HssType()=="HM-CC-VD")
           {
              if (tmpJ2 == 1){tmpC2 = "Ventil Antrieb tmpCiert"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
              if (tmpJ2 == 2){tmpC2 = "Ventil nicht montiert"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
              if (tmpJ2 == 3){tmpC2 = "Stellbereich zu klein"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
              if (tmpJ2 == 4){tmpC2 = "Batteriestand niedrig"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
           }
        }

        if (tmpC2 == "FAULT_REPORTING") {
           if (tmpI2.HssType()=="HM-CC-RT-DN")
           {
              if (tmpJ2 == 1) {tmpC2 = "Ventil blockiert."; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
              if (tmpJ2 == 2) {tmpC2 = "Einstellbereich Ventil zu gross"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
              if (tmpJ2 == 3) {tmpC2 = "Einstellbereich Ventil zu klein"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
              if (tmpJ2 == 4) {tmpC2 = "Kommunikationsfehler"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
              if (tmpJ2 == 6) {tmpC2 = "Batteriestand niedrig"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
              if (tmpJ2 == 7) {tmpC2 = "Fehlstellung Ventil"; tmpB1 = 1; if (tmpB1 >= tmpC1){tmpC1 = tmpB1;}}
           }
        }
        if (tmpC2 == "Batteriestand niedrig") {
           string tmpN2 = "unbekannt";
           string tmpO2;
           foreach (tmpO2, tmpI1) {if (tmpO2 == tmpI2.HssType()) {tmpN2 = "1x leere CR2016";}}
           foreach (tmpO2, tmpJ1) {if (tmpO2 == tmpI2.HssType()) {tmpN2 = "1x leere CR2032";}}
           foreach (tmpO2, tmpK1) {if (tmpO2 == tmpI2.HssType()) {tmpN2 = "2x leere LR14";}}
           foreach (tmpO2, tmpL1) {if (tmpO2 == tmpI2.HssType()) {tmpN2 = "2x leere LR44/AG13";}}
           foreach (tmpO2, tmpM1) {if (tmpO2 == tmpI2.HssType()) {tmpN2 = "2x leere LR6/AA";}}
           foreach (tmpO2, tmpN1) {if (tmpO2 == tmpI2.HssType()) {tmpN2 = "3x leere LR6/AA";}}
           foreach (tmpO2, tmpO1) {if (tmpO2 == tmpI2.HssType()) {tmpN2 = "4x leere LR6/AA";}}
           foreach (tmpO2, tmpP1) {if (tmpO2 == tmpI2.HssType()) {tmpN2 = "1x leere LR3/AAA";}}
           foreach (tmpO2, tmpQ1) {if (tmpO2 == tmpI2.HssType()) {tmpN2 = "2x leere LR3/AAA";}}
           foreach (tmpO2, tmpR1) {if (tmpO2 == tmpI2.HssType()) {tmpN2 = "3x leere LR3/AAA";}}
           foreach (tmpO2, tmpS1) {if (tmpO2 == tmpI2.HssType()) {tmpN2 = "3x leere AAA Akkus - bitte laden";}}
           foreach (tmpO2, tmpT1) {if (tmpO2 == tmpI2.HssType()) {tmpN2 = "9Volt tmpC leer oder unbestimmt";}}
           foreach (tmpO2, tmpU1) {if (tmpO2 == tmpI2.HssType()) {tmpN2 = "Festbatterie leer";}}
           foreach (tmpO2, tmpV1) {if (tmpO2 == tmpI2.HssType()) {tmpN2 = "Akku entladen - bitte aufladen";}}
         
   
       tmpX1 = tmpX1  #"\n"  #tmpI2.Name() # " : " # tmpN2; if ( tmpA == "ja") { tmpX1 = tmpX1 #" seit: "#tmpK2 #"("#tmpL2#")";}
       }
       else
       {
       tmpX1 = tmpX1  #"\n"  #tmpI2.Name() # " : " # tmpC2; if ( tmpA == "ja") { tmpX1 = tmpX1 #" seit: "#tmpK2 #"("#tmpL2#")" ;}
      }
    
}
} } }


! 04.04.2017
! alte langsame Uebersetzung entfernt Leerzeichen kein Problem mehr bei Mail/Pushover/Telegram/ aber bei Pushbullet & Prowl?
! Sonderzeichen u.U. problematisch bei Pushover & Telegram daher Texte umgestellt
! 02.05.2017 neue Uebersetzung hinzugefügt
string tmpP2 = " ;ü;ä;ö;Ü;Ä;Ö;ß";
string tmpQ2 = "%20;%C3%BC;%C3%A4;%C3%B6;%C3%9C;%C3%84;%C3%9F";
string tmpR2 = tmpX1;integer Pos = 0;integer Index = 0;string Split = "";boolean Loop = true;
foreach (Split, tmpP2.Split(";")) {
Loop = true;
while (Loop) {
Pos = tmpR2.Find(Split);
if (Pos == -1) { Loop = false;
}else{tmpR2 = tmpR2.Substr(0,Pos) # tmpQ2.StrValueByIndex(";",Index)  # tmpR2.Substr(Pos + Split.Length() , ((tmpR2.Length() - Pos) - Split.Length())  );
}}
Index = Index + 1;
}

! Verarbeiten der Daten zum Versand
if (tmpW1)  {
if ( (tmpD1 == "ja")&&( (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpF1#".CMD_EXEC")) ) { (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpF1#".CMD_EXEC").State("/etc/config/addons/email/email "#tmpE1#" '"#tmpX1#"'"); }
if ( (tmpS == "ja") &&( (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpT#".CMD_EXEC")) ){ (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpT#".CMD_EXEC").State("/usr/local/addons/cuxd/extra/curl -s -k -d token='"#tmpV#"' -d user='"#tmpU#"' -d device='"#tmpW#"' -d html='"#tmpA1#"' -d tmpR2='"#tmpR2#"' -d priority='"#tmpC1#"' -d sound='"#tmpZ#"' -d retry='"#tmpX#"' -d expire='"#tmpY#"' https://api.pushover.net/1/tmpR2s.json"); }
if ( (tmpD == "ja") &&( (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpG#".CMD_EXEC")) ){ (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpG#".CMD_EXEC").State("/usr/local/addons/cuxd/extra/curl -u '"#tmpE#"' -k -d device_iden='"#tmpF#"' -d type=note -d title='"#tmpH#"' -d body='"#tmpX1#"' https://api.pushbullet.com/api/pushes"); }
if ( (tmpI == "ja") &&( (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpL#".CMD_EXEC")) ){ (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpL#".CMD_EXEC").State("/usr/local/addons/cuxd/extra/curl -s -k https://api.telegram.org/bot"#tmpK#"/sendMessage -d text='"#tmpR2#"' -d chat_id="#tmpJ); }
if ( (tmpM == "ja") && ( (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpO#".CMD_EXEC")) ){ string tmpS2="http://prowl.weks.net/publicapi/add?apikey="#tmpN#"&application="#tmpP#"&event="#tmpQ#"&priority="#tmpC1#"&description="#tmpX1#"&timeout="#tmpR#""; (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpO#".CMD_EXEC").State("wget -q -O - '"#tmpS2#"'"); }
if ( (tmpG1 == "ja") && (dom.GetObject(ID_SYSTEM_VARIABLES)).Get(tmpH1) ){ (dom.GetObject(ID_SYSTEM_VARIABLES)).Get(tmpH1).State(tmpX1); }
} else { if ( (tmpG1 == "ja") && (dom.GetObject(ID_SYSTEM_VARIABLES)).Get(tmpH1) ){ (dom.GetObject(ID_SYSTEM_VARIABLES)).Get(tmpH1).State(tmpX1); }}
if ( (dom.GetObject(ID_DATAPOINTS)).Get("CUxD.CUX2801001:1.CMD_EXEC")) { (dom.GetObject(ID_DATAPOINTS)).Get("CUxD.CUX2801001:1.CMD_EXEC").State("logger -t script -p user.debug [ALCHY ALLINScript ENDE]"); } else {string tmpY1;string tmpZ1; system.Exec("logger -t script -p user.debug [ALCHY ALLINScript se ENDE]", &tmpY1, &tmpZ1);}
}

Code: Alles auswählen

! Servicemeldungen auslesen und weiter verarbeiten zusammengetragen von Alchy & dtp
! v1.6 (c) by alchy
! Zum Benutzen: Neues Programm in der CCU wie folgt erstellen:
! WENN Systemzustand: Servicemeldungen im Wertebereich groesser als 0 bei Aktualisierung ausloesen
! DANN mit einer Sekunde Verzögerung Skript (und dann dieses Script komplett einfuegen und mit o.k. bestaetigen
! In den ersten Zeilen des Scriptes Setup durchfuehren !

! ++++++ Allgemeine Infos ++++++
! Servicemeldungen bei Kommunikationsstoerungen "war gestoert" wird durch das Script bestaetigt (konfigurierbar)
! Im Falle einer Batterieleermeldung, wird der Geraetename und der Batterietyp sowie die Anzahl der Batterien ,
! sonst bei einer anderen Servicemeldung wird der Geraetename und der Fehler (uebersetzt) entweder
! ausgegeben / in Variable gespeichert / per prowl / pushover versendet und / oder per Mail verschickt
! das Ganze sollte sowohl als auch funktionieren.
! Bitte Infos bei den Setup durchlesen und beachten, im Zweifelsfalle einfach nachfragen.
! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

! ++++++ ToDo ++++++
! Fehlermeldungen - Batterietypen aktualisieren

!++++++ SETUP ++++++
! Bitte in Ruhe die naechsten Zeilen durcharbeiten
var tmpA = "ja"; ! Wenn ja, wird die Alarmzeit Zeit mitgesendet
! +++++ Servicemeldungen "Kommunikation war gestoert" bestaetigen? ++++++
var tmpB = "nein"; ! ja oder nein, um anstehende "war Kommunikationsstoerungen" zu bestaetigen
! HM Geraet, wessen Systemmeldungen nicht verschickt werden sollen
var tmpC = "JEQ012345678 NEP987654321"; ! Seriennummern von Geraeten, welche durch das Script ignoriert werden sollen

!++++++ PUSHBULLET +++++++++
var tmpD = "nein"; ! ja oder nein fuer die Verwendung PUSHBULLET direkt im Script;
var tmpE ="++++++++++++++++++++"; ! selbsterklaerend
var tmpF = "+++++++++++++++++++";
var tmpG = "CUX2801001:4"; !welches CUXD.EXEC Geraet mit Kanal soll verwendet werden ?
var tmpH = "Homematic"; !kann jeder nennen wie er will

!++++++ TELEGRAM +++++++++
var tmpI = "nein"; ! ja oder nein fuer die Verwendung TELEGRAM direkt im Script;
var tmpJ = "+++++++++"; ! selbsterklaerend
var tmpK = "+++++++++++++++++++"; ! dito
var tmpL = "CUX2801001:2"; !welches CUXD.EXEC Geraet mit Kanal soll verwendet werden ?

!++++++ Prowl Setup fuer die Apfeljuenger +++++++++
! 1. Prowl einrichten ( http://homematic-forum.de/forum/viewtopic.php?f=19&t=7797 )
! 2. cuxd Installation erforderlich
var tmpM = "nein"; ! ja oder nein fuer die Verwendung prowl direkt im Script;
var tmpN ="DEIN API KEY"; ! selbsterklaerend
var tmpO = "CUX2801001:3"; !welches CUXD.EXEC Geraet mit Kanal soll verwendet werden ?
var tmpO = "Homematic"; !kann jeder nennen wie er will
var tmpP ="Servicemeldung"; !kann jeder nennen wie er will
var tmpQ = "10";

!+++++++ Pushover Setup ++++++
! 1. pushover einrichten ( http://homematic-forum.de/forum/viewtopic.php?f=31&t=11579 )
! 2. cuxd Installation erforderlich
var tmpR = "nein"; ! das Uebliche
var tmpS = "CUX2801001:2"; !welches CUXD.EXEC Geraet mit Kanal soll verwendet werden ?
var tmpT = "++++++++++++++++";
var tmpU = "+++++++++++++++";
var tmpV = ""; ! welches eingerichtete Geraet soll die Meldung bekommen? leer = alle Geraete sonst Namen komma separiert
var tmpW = "30"; !wiederholungen des Alarm bei prio >1
var tmpX = "120"; ! wie lange bis verfaellt
var tmpY = "siren"; !Sound nach wahl siehe "https://pushover.net/api#sounds"
var tmpZ ="1"; ! 1 use html codes at the message
var tmpA1 = "1";
var tmpB1 = "-2"; ! siehe http://homematic-forum.de/forum/viewtopic.php?f=31&t=24618&start=530#p288205

!+++++++ Setup Mail verschicken mit CUXD und Emailaddon ++++++
! 1. CUXD incl. exec Geraet sind installiert ( http://homematic-forum.de/forum/viewtopic.php?f=37&t=15298 )
! 2. Mailaddon ist installiert eingestellt und funktioniert ( http://www.homematic-inside.de/software/email )
! 3. Im TCL Reiter im MailAddon wird als erste Zeile "set serviceliste [encoding convertfrom utf-8 [ltmpI2 $argv 1]]" ohne Anfuehrungsstriche eingegeben
! 4. in Mailvorlage Nr deiner Wahl wird "$serviceliste" ohne Anfuehrungsstriche im Mailtextfeld eingegeben (was da noch steht ist uninteressant)
var tmpC1 = "nein"; !   ja / nein schicken einer Mail direkt ueber das Script
var tmpD1 = "01"; !  die VORHER praeparierte Mailvorlage 01 - 50 in der aktuellen Version des mailaddon
var tmpE1 = "CUX2801001:1"; !   die Serial des EXEC Geraete - wer nicht weiss was ich meine, einfach so lassen ist die Standard

!+++++++ Systemvariablen Setup ++++++
! 1. Vor Benutzung Systemvariable vom Typ Zeichenkette in CCU anlegen,
var tmpF1 = "nein"; ! ja / nein Speichern der Ausgabe des Scriptes in Systemvariable
var tmpG1 = "NAME DER SYSTEMVARIABLE"; ! hier den Namen dieser Variablen eintragen


!+++++++ Eigentlich schon fertig mit dem Setup +++++++++++
!+++++ Batteriezuweisungen inklusive Anzahl !Bitte helfen und fehlende Geraete posten ++++++++++++++++
!+++++ noch nicht integrierte Geraete werden mit unbekannt ausgegeben ++++++++++++++++
string tmpH1 = "HM-RC-4\tHM-RC-4-B\tHM-RC-Sec3\tHM-RC-Sec3-B\tHM-RC-P1\tHM-RC-Key3\tHM-RC-Key3-B\tZEL_STG_RM_HS_4";
string tmpI1 = "HM-SCI-3-FM\tHM-PBI-4-FM\tHM-PB-2-WM\tHM-SwI-3-FM\tHM-PBI-4-FM\tHM-Sec-TiS";
string tmpJ1 = "HM-Sec-Sir-WM\tHM-OU-CFM-TW";
string tmpK1 = "HM-Sec-SC\tHM-Sec-SC2\tHM-Sec-SC-2\tHM-Sec-RHS";
string tmpL1 = "HM-CC-VD\tHM-CC-RT-DN\tHM-Sec-WDS\tHM-Sec-WDS-2\tHM-CC-TC\tHM-Dis-TD-T\tHB-UW-Sen-THPL-I\tHM-TC-IT-WM-W-EU\tHM-WDS40-TH-I\tHM-WDS40-TH-I-2\tHM-WDS10-TH-O\tHmIP-SMI\tHMIP-eTRV\tHM-WDS30-OT2-SM-2";
string tmpM1 = "HM-Sec-MDIR\tHM-Sec-MDIR-2\tHM-Sec-SD\tHM-Sec-Key\tHM-Sec-Key-S\tHM-Sec-Key-O\tHM-Sen-Wa-Od\tHM-Sen-MDIR\tHM-Sen-MDIR-O\tHM-Sen-MDIR-O-2\tHM-WDS100-C6-O\tHM-WDS100-C6-O-2";
string tmpN1 = "HM-ES-TX-WM\tHM-CCU-1";
string tmpO1 = "HMIP-SWDO\tHM-Sec-SCo\tHM-RC-4-2\tHM-RC-Key4-2\tHM-RC-Sec4-2\tHM-RC-Sec4-3\tHmIP-KRCA\tHMIP-SWDO";
string tmpP1 = "HM-Dis-EP-WM55\tHM-PB-6-WM55\tHM-Sen-MDIR-WM55\tHM-PBI-2-FM\tHM-RC-8\tHM-Sen-DB-PCB\tHB-UW-Sen-THPL-O\tHM-Sen-EP\tHM-WDS30-T-O\tHM-WDS30-OT2-SM\tHM-TC-IT-WM-W-EU\tHM-Dis-WM55\tHM-PB-2-WM55\tHM-PB-2-WM55-2\tHM-Sen-MDIR-SM\tHMIP-WTH\tHMIP-WRC2";
string tmpQ1 = "HM-PB-4Dis-WM\tHM-Sen-LI-O\tHM-RC-Dis-H-x-EU";
string tmpR1 = "HM-RC-19\tHM-RC-19-B\tHM-RC-12\tHM-RC-12-B\tHM-RC-12-W";
string tmpS1 = "HM-LC-Sw1-Ba-PCB\tHM-LC-Sw4-PCB\tHM-MOD-EM-8\tHM-MOD-Re-8\tHM-Sen-RD-O\tHM-OU-CM-PCB\tHM-LC-Sw4-WM";

!+++++++++ Setup nun aber wirklich zu Ende - ab hier Finger weg ;-) ++++++++++++++++++
boolean tmpT1 = false;
if ( (dom.GetObject(ID_DATAPOINTS)).Get("CUxD.CUX2801001:1.CMD_EXEC")) { (dom.GetObject(ID_DATAPOINTS)).Get("CUxD.CUX2801001:1.CMD_EXEC").State("logger -t script -p user.debug [ALCHY ALLINScript START]"); } else {string stdout;string stderr; system.Exec("logger -t script -p user.debug [ALCHY ALLINScript se START]", &stdout, &stderr);}

! ausgelagert:  Quittieren der war gestoert Meldungen
object tmpU1 = dom.GetObject(ID_SERVICES);
              if(tmpU1) {
                 string tmpA2;
                 string tmpY1;
                 string tmpB2;
                 string tmpC2;
        foreach(tmpA2, tmpU1.EnumIDs()) {
           object tmpV1 = dom.GetObject(tmpA2);
           if (tmpV1){
           if(tmpV1.IsTypeOf(OT_ALARMDP) && (tmpV1.AlState() == asOncoming)) {
              var tmpW1 = dom.GetObject(tmpV1.AlTriggerDP());
              var tmpX1 = dom.GetObject(tmpW1.Channel());
              var tmpY1 = dom.GetObject(tmpX1.Device());
              var tmpZ1 = tmpW1.Value();
              var tmpB2 = tmpW1.AlDestMapDP().Name().StrValueByIndex(".", 2);
var tmpD2 = system.Date("%F %T").ToTime().ToInteger()- tmpW1.Timestamp().ToInteger();
           if ( tmpD2 < 5 ) { tmpT1 = true;}
              if ((tmpB2 == "STICKY_UNREACH") && (tmpB == "ja")) { tmpV1.AlReceipt();}   
        } } } }

! Ende Auslagerung war gestoert Meldung

string tmpE2 = "";
if ( (dom.GetObject(41).Value() > dom.GetObject(41).LastValue()) || (tmpT1) )  { 
boolean tmpF2 = true; string tmpE2 = "NEUE Servicemeldung " ;} else { string tmpE2 = "ALTE Servicemeldung ";}

! wird ab 1.0 immer abgearbeitet 
      foreach(tmpA2, tmpU1.EnumIDs()) {
        object tmpV1 = dom.GetObject(tmpA2);
           if (tmpV1) {
           if(tmpV1.IsTypeOf(OT_ALARMDP) && (tmpV1.AlState() == asOncoming)) {
           var tmpW1 = dom.GetObject(tmpV1.AlTriggerDP());
           var tmpX1 = dom.GetObject(tmpW1.Channel());
           var tmpY1 = dom.GetObject(tmpX1.Device());
           var tmpZ1 = tmpW1.Value();
           var tmpK2 = tmpX1.LastTimestamp().ToString("%d.%m.%y %H:%M Uhr");
           var tmpB2 = tmpW1.AlDestMapDP().Name().StrValueByIndex(".", 2);
           var tmpG2 = (tmpW1.AlDestMapDP().Name().StrValueByIndex(".", 1)).StrValueByIndex(":", 0);
           var tmpD2 = system.Date("%F %T").ToTime().ToInteger()- tmpW1.Timestamp().ToInteger();


if (tmpC.Find(tmpG2)<0) {
 
      ! Uebersetzen der Fehlermeldungen
       
      if (tmpB2 == "CONFIG_PENDING") {tmpB2 = "Konfigurationsdaten stehen zum Transfer an"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
      if (tmpB2 == "LOWBAT") {tmpB2 = "Batteriestand niedrig"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
      if (tmpB2 == "STICKY_UNREACH") {tmpB2 = "hatte Kommunikationsfehler"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
      if (tmpB2 == "UNREACH") {tmpB2 = "hat Kommunikationsfehler"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
      if (tmpB2 == "DEVICE_IN_BOOTLOADER"){tmpB2 = "Device startet neu"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
      if (tmpB2 == "UPDATE_PENDING") {tmpB2 = "Update verfuegbar"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
      if (tmpB2 == "U_SOURCE_FAIL") {tmpB2 = "Netzteil ausgefallen"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
      if (tmpB2 == "USBH_POWERFAIL") {tmpB2 = "USB-Host deaktiviert"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
      if (tmpB2 == "ERROR_SABOTAGE") {tmpB2 = "Sabotage"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
      if (tmpB2 == "STICKY_SABOTAGE") {tmpB2 = "hatte Sabotagemeldung"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
      if (tmpB2 == "ERROR_REDUCED"){tmpB2 = "Temperatur kritisch (Lastabsenkung)."; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}

        ! Sonderfehler
        if (tmpB2 == "ERROR") {
        if((tmpY1.HssType()=="HM-Sec-RHS") || (tmpY1.HssType()=="HM-Sec-SC") || (tmpY1.HssType()=="HM-Sec-SC-2") || (tmpY1.HssType()=="HM-Sec-SCo") || (tmpY1.HssType()=="HM-Sec-MD") || (tmpY1.HssType()=="HM-Sec-MDIR") || (tmpY1.HssType()=="HM-Sec-MDIR-2") || (tmpY1.HssType()=="HM-Sec-Sir-WM"))
           {
              if (tmpZ1 == 7){tmpB2 = "Sabotage"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
            }
            if ((tmpY1.HssType()=="HM-Sec-Key") || (tmpY1.HssType()=="HM-Sec-Key-S") || (tmpY1.HssType()=="HM-Sec-Key-O"))
            {
              if (tmpZ1 == 1){tmpB2 = "Einkuppeln fehlgeschlagen"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
              if (tmpZ1 == 2){tmpB2 = "Motorlauf abgebrochen"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
            }
           if (tmpY1.HssType()=="HM-CC-VD")
           {
              if (tmpZ1 == 1){tmpB2 = "Ventil Antrieb blockiert"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
              if (tmpZ1 == 2){tmpB2 = "Ventil nicht montiert"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
              if (tmpZ1 == 3){tmpB2 = "Stellbereich zu klein"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
              if (tmpZ1 == 4){tmpB2 = "Batteriestand niedrig"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
           }
        }

        if (tmpB2 == "FAULT_REPORTING") {
           if (tmpY1.HssType()=="HM-CC-RT-DN")
           {
              if (tmpZ1 == 1) {tmpB2 = "Ventil blockiert."; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
              if (tmpZ1 == 2) {tmpB2 = "Einstellbereich Ventil zu gross"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
              if (tmpZ1 == 3) {tmpB2 = "Einstellbereich Ventil zu klein"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
              if (tmpZ1 == 4) {tmpB2 = "Kommunikationsfehler"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
              if (tmpZ1 == 6) {tmpB2 = "Batteriestand niedrig"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
              if (tmpZ1 == 7) {tmpB2 = "Fehlstellung Ventil"; tmpA1 = 1; if (tmpA1 >= tmpB1){tmpB1 = tmpA1;}}
           }
        }
        if (tmpB2 == "Batteriestand niedrig") {
           string tmpH2 = "unbekannt";
           string tmpI2;
           foreach (tmpI2, tmpH1) {if (tmpI2 == tmpY1.HssType()) {tmpH2 = "1x leere CR2016";}}
           foreach (tmpI2, tmpI1) {if (tmpI2 == tmpY1.HssType()) {tmpH2 = "1x leere CR2032";}}
           foreach (tmpI2, tmpJ1) {if (tmpI2 == tmpY1.HssType()) {tmpH2 = "2x leere LR14";}}
           foreach (tmpI2, tmpK1) {if (tmpI2 == tmpY1.HssType()) {tmpH2 = "2x leere LR44/AG13";}}
           foreach (tmpI2, tmpL1) {if (tmpI2 == tmpY1.HssType()) {tmpH2 = "2x leere LR6/AA";}}
           foreach (tmpI2, tmpM1) {if (tmpI2 == tmpY1.HssType()) {tmpH2 = "3x leere LR6/AA";}}
           foreach (tmpI2, tmpN1) {if (tmpI2 == tmpY1.HssType()) {tmpH2 = "4x leere LR6/AA";}}
           foreach (tmpI2, tmpO1) {if (tmpI2 == tmpY1.HssType()) {tmpH2 = "1x leere LR3/AAA";}}
           foreach (tmpI2, tmpP1) {if (tmpI2 == tmpY1.HssType()) {tmpH2 = "2x leere LR3/AAA";}}
           foreach (tmpI2, tmpQ1) {if (tmpI2 == tmpY1.HssType()) {tmpH2 = "3x leere LR3/AAA";}}
           foreach (tmpI2, tmpR1) {if (tmpI2 == tmpY1.HssType()) {tmpH2 = "3x leere AAA Akkus - bitte laden";}}
           foreach (tmpI2, tmpS1) {if (tmpI2 == tmpY1.HssType()) {tmpH2 = "9Volt Block leer oder unbestimmt";}}
       tmpE2 = tmpE2  #" "  #tmpY1.Name() # " : " # tmpH2; if ( tmpA == "ja") { tmpE2 = tmpE2 #" seit: "#tmpK2 ;}
       }
       else
       {
       tmpE2 = tmpE2  #" "  #tmpY1.Name() # " : " # tmpB2; if ( tmpA == "ja") { tmpE2 = tmpE2 #" seit: "#tmpK2  ;}
      }
} } } }
! 04.04.2017
! Uebersetzung entfernt Leerzeichen kein Problem mehr bei Mail/Pushover/Telegram/ aber bei Pushbullet & Prowl?
! Sonderzeichen u.U. problematisch bei Pushover & Telegram daher Texte umgestellt
if (tmpF2)  {
if ( (tmpC1 == "ja")&&( (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpE1#".CMD_EXEC")) ) { (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpE1#".CMD_EXEC").State("/etc/config/addons/email/email "#tmpD1#" '"#tmpE2#"'"); }
if ( (tmpR == "ja") &&( (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpS#".CMD_EXEC")) ){ (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpS#".CMD_EXEC").State("/usr/local/addons/cuxd/extra/curl -s -k -d token='"#tmpU#"' -d user='"#tmpT#"' -d device='"#tmpV#"' -d html='"#tmpZ#"' -d message='"#tmpE2#"' -d priority='"#tmpB1#"' -d sound='"#tmpY#"' -d retry='"#tmpW#"' -d expire='"#tmpX#"' https://api.pushover.net/1/messages.json"); }
if ( (tmpD == "ja") &&( (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpG#".CMD_EXEC")) ){ (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpG#".CMD_EXEC").State("/usr/local/addons/cuxd/extra/curl -u '"#tmpE#"' -k -d device_iden='"#tmpF#"' -d type=note -d title='"#tmpH#"' -d body='"#tmpE2#"' https://api.pushbullet.com/api/pushes"); }
if ( (tmpI == "ja") &&( (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpL#".CMD_EXEC")) ){ (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpL#".CMD_EXEC").State("/usr/local/addons/cuxd/extra/curl -s -k https://api.telegram.org/bot"#tmpK#"/sendMessage -d text='"#tmpE2#"' -d chat_id="#tmpJ); }
if ( (tmpM == "ja") && ( (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpO#".CMD_EXEC")) ){ string tmpJ2="http://prowl.weks.net/publicapi/add?apikey="#tmpN#"&application="#tmpO#"&event="#tmpP#"&priority="#tmpB1#"&description="#tmpE2#"&timeout="#tmpQ#""; (dom.GetObject(ID_DATAPOINTS)).Get("CUxD."#tmpO#".CMD_EXEC").State("wget -q -O - '"#tmpJ2#"'"); }
if ( (tmpF1 == "ja") && (dom.GetObject(ID_SYSTEM_VARIABLES)).Get(tmpG1) ){ (dom.GetObject(ID_SYSTEM_VARIABLES)).Get(tmpG1).State(tmpE2); }
} else { if ( (tmpF1 == "ja") && (dom.GetObject(ID_SYSTEM_VARIABLES)).Get(tmpG1) ){ (dom.GetObject(ID_SYSTEM_VARIABLES)).Get(tmpG1).State(tmpE2); }}
if ( (dom.GetObject(ID_DATAPOINTS)).Get("CUxD.CUX2801001:1.CMD_EXEC")) { (dom.GetObject(ID_DATAPOINTS)).Get("CUxD.CUX2801001:1.CMD_EXEC").State("logger -t script -p user.debug [ALCHY ALLINScript ENDE]"); } else {string stdout;string stderr; system.Exec("logger -t script -p user.debug [ALCHY ALLINScript se ENDE]", &stdout, &stderr);}
Zuletzt geändert von AndiN am 26.05.2017, 17:57, insgesamt 21-mal geändert.
Andi (Greenhorn)

Letzter Reboot: 17.03.24 => FW Update (Uptime:Rekord:153 Tage)
Systeminfos: Raspberry Pi3 Firmware: 3.75.6.20240316 142 Geräte
System angebunden: 3 Roomba 650 - Sprachausgabe via Home24 Media - Pocket Control
- Zentrale: Asus TF103 mit Home24 Tablet
Addons: Drucken 2.5 - HQ WebUI 2.5.9 - XML-API 1.22 - CUx-Daemon 2.9.3 - E-Mail 1.7.4 - hm_pdetect 1.11 - VPN cloudmatic
Diverse Links

Benutzeravatar
AndiN
Beiträge: 2621
Registriert: 10.06.2015, 08:54
Wohnort: Hennef
Hat sich bedankt: 10 Mal
Danksagung erhalten: 28 Mal

Re: Script Probleme (überarbeitete Skripts)

Beitrag von AndiN » 24.11.2015, 19:01

Wettervorhersage Version 1 von ldittmar (http://homematic-forum.de/forum/viewtop ... 31&t=24663)

Code: Alles auswählen

! Idtittmar entwickelt 
! von AndiN auf tmp-Variablen umgeschrieben v2.0.0 (Stand: 25.11.2015)

!-----------------------------------------------------------------------------
! Hier alle was man verändern kann/muss
! Voraussetzung: CUxD und ein Wetter.com Account
!-----------------------------------------------------------------------------

! Hier die MD5 Checksumme aus ProjektName APIKey CityCode eintragen
string tmpA = "XXXXXXX";

! Hier der City Code
string tmpB = "XXXXXXX";

! Meine Projektnummer
string tmpC = "XXXXXXX";

var tmpD = "CUxD.CUX2801001:10"; !CUxD Virtuelles Gerät

!Wetter heute Variablen-Namen (alles optional)
string tmpH = "SV_Wetter_heute_zustand"; !Zahl 0 - 999
string tmpI = "SV_Wetter_heute_tempMax"; !Zahl -50 - 50 °C
string tmpJ = "SV_Wetter_heute_tempMin"; !Zahl -50 - 50 °C
string tmpK = "SV_Wetter_heute_wind"; !Zahl 0 - 200 km/h
string tmpL = "SV_Wetter_heute_zustand_txt"; !Zeichenkette
string tmpM = "SV_Wetter_heute_regen"; !Logikwert
string tmpN = "SV_Wetter_heute_regen_proz"; !Zahl 0 - 100 %

string tmpO = "SV_Wetter_morgen_zustand"; !Zahl 0 - 999
string tmpS = "SV_Wetter_morgen_tempMax"; !Zahl -50 - 50 °C
string tmpT = "SV_Wetter_morgen_tempMin"; !Zahl -50 - 50 °C
string tmpU = "SV_Wetter_morgen_wind"; !Zahl 0 - 200 km/h
string tmpV = "SV_Wetter_morgen_zustand_txt"; !Zeichenkette
string tmpW = "SV_Wetter_morgen_regen"; !Logikwert
string tmpX = "SV_Wetter_morgen_regen_proz"; !Zahl 0 - 100 %

!-----------------------------------------------------------------------------
! Ab hier muss man nichts mehr beachten
!-----------------------------------------------------------------------------
   
string tmpE = "http://api.wetter.com/forecast/weather/city/" + tmpB +"/project/" + tmpC + "/cs/" + tmpA + "/output/json";

var stdout;
var tmpPosStart;
var tmpPosEnd;
var tmpL1;
var tmpF;
var tmpG;
var tmpY;
var tmpZ;
var tmpA1 = "\"23:00\"";
var tmpB1 = "},";

var tmpC1 = system.Date("%F");
var tmpK1= system.Date("%F ")#"00:00:00";
tmpK1 = tmpK1.ToTime().ToInteger() + 86400;
var tmpE1 = tmpK1.ToTime().Format("%F");
tmpK1 = tmpK1.ToTime().ToInteger() + 86400;
var tmpD1 = tmpK1.ToTime().Format("%F");
   
dom.GetObject(tmpD # ".CMD_SETS").State("wget -q -O - " # tmpE);
dom.GetObject(tmpD # ".CMD_QUERY_RET").State(1);
stdout = dom.GetObject(tmpD # ".CMD_RETS").State();

!-----------------------------------------------------------------------------
! Dekodierung der Umlaute
!-----------------------------------------------------------------------------
   
string tmpF1;
string tmpG1;
foreach(tmpG1, stdout.Split("Ã")){
   tmpF1 = tmpF1+ tmpG1 + "";
}
stdout = tmpF1;
tmpF1 = "";
foreach(tmpG1, stdout.Split("¤")){
   tmpF1 = tmpF1 + tmpG1 + "ä";
}
stdout = tmpF1;
tmpF1 = "";
foreach(tmpG1, stdout.Split("¶")){
   tmpF1 = tmpF1 + tmpG1 + "ö";
}
stdout = tmpF1;
tmpF1 = "";
foreach(tmpG1, stdout.Split("¼")){
   tmpF1 = tmpF1 + tmpG1 + "ü";
}
stdout = tmpF1;
tmpF1 = "";

!-----------------------------------------------------------------------------
! HEUTE
!-----------------------------------------------------------------------------

boolean tmpH1 = false;
tmpPosStart = "\"" + tmpC1 + "\":{";
tmpPosEnd = "\"" + tmpE1 + "\":{";
tmpF = stdout.Substr(stdout.Find(tmpPosStart), stdout.Find(tmpPosEnd));

!Wetterzustand
tmpG = "\"w\":\"";
tmpY = "\",";
tmpZ = tmpF.Find(tmpG) + tmpG.Length();
tmpL1 = tmpF.Substr(tmpZ, 5).StrValueByIndex(tmpY, 0);
integer tmpE = tmpL1.ToInteger();
if(dom.GetObject(tmpH).IsTypeOf(OT_VARDP)){
   dom.GetObject(tmpH).State(tmpE);
}
tmpH1 = ((tmpE > 5) && (tmpE < 10)) || (tmpE > 59);

!Maximaltemperatur
if(dom.GetObject(tmpI).IsTypeOf(OT_VARDP)){
   tmpG = "\"tx\":\"";
   tmpY = "\",";
   tmpZ = tmpF.Find(tmpG) + tmpG.Length();
   tmpL1 = tmpF.Substr(tmpZ, 5).StrValueByIndex(tmpY, 0);
   dom.GetObject(tmpI).State(tmpL1.ToInteger());
}

!Regenwahrscheinlichkeit
if(dom.GetObject(tmpN).IsTypeOf(OT_VARDP)){
   tmpG = "\"pc\":\"";
   tmpY = "\",";
   tmpZ = tmpF.Find(tmpG) + tmpG.Length();
   tmpL1 = tmpF.Substr(tmpZ, 5).StrValueByIndex(tmpY, 0);
   dom.GetObject(tmpN).State(tmpL1.ToInteger());
}

!Wird überhaupt regnen
if(dom.GetObject(tmpM).IsTypeOf(OT_VARDP)){
   if(!tmpH1){
      var tmpJ1 = "\"06:00\"";
      var tmpI1 = tmpF.Substr(tmpF.Find(tmpJ1), tmpF.Length());
      tmpG = "\"w\":\"";
      tmpY = "\",";
      tmpZ = tmpI1.Find(tmpG) + tmpG.Length();
      tmpE = tmpI1.Substr(tmpZ, 5).StrValueByIndex(tmpY, 0).ToInteger();
      tmpH1 = ((tmpE > 5) && (tmpE < 10)) || (tmpE > 59);
      if(!tmpH1){
         tmpJ1 = "\"11:00\"";
         tmpI1 = tmpF.Substr(tmpF.Find(tmpJ1), tmpF.Length());
         tmpG = "\"w\":\"";
         tmpY = "\",";
         tmpZ = tmpI1.Find(tmpG) + tmpG.Length();
         tmpE = tmpI1.Substr(tmpZ, 5).StrValueByIndex(tmpY, 0).ToInteger();
         tmpH1 = ((tmpE > 5) && (tmpE < 10)) || (tmpE > 59);
         if(!tmpH1){
            tmpJ1 = "\"17:00\"";
            tmpI1 = tmpF.Substr(tmpF.Find(tmpJ1), tmpF.Length());
            tmpG = "\"w\":\"";
            tmpY = "\",";
            tmpZ = tmpI1.Find(tmpG) + tmpG.Length();
            tmpE = tmpI1.Substr(tmpZ, 5).StrValueByIndex(tmpY, 0).ToInteger();
            tmpH1 = ((tmpE > 5) && (tmpE < 10)) || (tmpE > 59);
            if(!tmpH1){
               tmpJ1 = "\"23:00\"";
               tmpI1 = tmpF.Substr(tmpF.Find(tmpJ1), tmpF.Length());
               tmpG = "\"w\":\"";
               tmpY = "\",";
               tmpZ = tmpI1.Find(tmpG) + tmpG.Length();
               tmpE = tmpI1.Substr(tmpZ, 5).StrValueByIndex(tmpY, 0).ToInteger();
               tmpH1 = ((tmpE > 5) && (tmpE < 10)) || (tmpE > 59);      
            }
         }
      }
   }
   dom.GetObject(tmpM).State(tmpH1);
}

tmpF = tmpF.Substr(tmpF .Find(tmpA1), tmpF.Length());
tmpF = tmpF.Substr(tmpF .Find(tmpB1), tmpF.Length());

!Minimaltemperatur
if(dom.GetObject(tmpJ).IsTypeOf(OT_VARDP)){
   tmpG = "\"tn\":\"";
   tmpY = "\",";
   tmpZ = tmpF.Find(tmpG) + tmpG.Length();
   tmpL1 = tmpF.Substr(tmpZ, 5).StrValueByIndex(tmpY, 0);
   dom.GetObject(tmpJ).State(tmpL1.ToInteger());
}

!Windgeschwindigkeit
if(dom.GetObject(tmpK).IsTypeOf(OT_VARDP)){
   tmpG = "\"ws\":\"";
   tmpY = "\",";
   tmpZ = tmpF.Find(tmpG) + tmpG.Length();
   tmpL1 = tmpF.Substr(tmpZ, 5).StrValueByIndex(tmpY, 0);
   dom.GetObject(tmpK).State(tmpL1.ToInteger());
}

!Wetterzustand Text
if(dom.GetObject(tmpL).IsTypeOf(OT_VARDP)){
   tmpG = "\"w_txt\":\"";
   tmpY = "\"},";
   tmpZ = tmpF.Find(tmpG) + tmpG.Length();
   tmpL1 = tmpF.Substr(tmpZ, 20).StrValueByIndex(tmpY, 0);
   dom.GetObject(tmpL).State(tmpL1);
}


!-----------------------------------------------------------------------------
! MORGEN
!-----------------------------------------------------------------------------

tmpH1 = false;
tmpPosStart = "\"" + tmpE1 + "\":{";
tmpPosEnd = "\"" + tmpD1 + "\":{";
tmpF = stdout.Substr(stdout.Find(tmpPosStart), stdout.Find(tmpPosEnd));

!Wetterzustand
tmpG = "\"w\":\"";
tmpY = "\",";
tmpZ = tmpF.Find(tmpG) + tmpG.Length();
tmpL1 = tmpF.Substr(tmpZ, 5).StrValueByIndex(tmpY, 0);
integer tmpE = tmpL1.ToInteger();
if(dom.GetObject(tmpO).IsTypeOf(OT_VARDP)){
   dom.GetObject(tmpO).State(tmpE);
}
tmpH1 = ((tmpE > 5) && (tmpE < 10)) || (tmpE > 59);

!Maximaltemperatur
if(dom.GetObject(tmpS).IsTypeOf(OT_VARDP)){
   tmpG = "\"tx\":\"";
   tmpY = "\",";
   tmpZ = tmpF.Find(tmpG) + tmpG.Length();
   tmpL1 = tmpF.Substr(tmpZ, 5).StrValueByIndex(tmpY, 0);
   dom.GetObject(tmpS).State(tmpL1.ToInteger());
}

!Regenwahrscheinlichkeit
if(dom.GetObject(tmpX).IsTypeOf(OT_VARDP)){
   tmpG = "\"pc\":\"";
   tmpY = "\",";
   tmpZ = tmpF.Find(tmpG) + tmpG.Length();
   tmpL1 = tmpF.Substr(tmpZ, 5).StrValueByIndex(tmpY, 0);
   dom.GetObject(tmpX).State(tmpL1.ToInteger());
}

!Wird überhaupt regnen
if(dom.GetObject(tmpW).IsTypeOf(OT_VARDP)){
   if(!tmpH1){
      var tmpJ1 = "\"06:00\"";
      var tmpI1 = tmpF.Substr(tmpF.Find(tmpJ1), tmpF.Length());
      tmpG = "\"w\":\"";
      tmpY = "\",";
      tmpZ = tmpI1.Find(tmpG) + tmpG.Length();
      tmpE = tmpI1.Substr(tmpZ, 5).StrValueByIndex(tmpY, 0).ToInteger();
      tmpH1 = ((tmpE > 5) && (tmpE < 10)) || (tmpE > 59);
      if(!tmpH1){
         tmpJ1 = "\"11:00\"";
         tmpI1 = tmpF.Substr(tmpF.Find(tmpJ1), tmpF.Length());
         tmpG = "\"w\":\"";
         tmpY = "\",";
         tmpZ = tmpI1.Find(tmpG) + tmpG.Length();
         tmpE = tmpI1.Substr(tmpZ, 5).StrValueByIndex(tmpY, 0).ToInteger();
         tmpH1 = ((tmpE > 5) && (tmpE < 10)) || (tmpE > 59);
         if(!tmpH1){
            tmpJ1 = "\"17:00\"";
            tmpI1 = tmpF.Substr(tmpF.Find(tmpJ1), tmpF.Length());
            tmpG = "\"w\":\"";
            tmpY = "\",";
            tmpZ = tmpI1.Find(tmpG) + tmpG.Length();
            tmpE = tmpI1.Substr(tmpZ, 5).StrValueByIndex(tmpY, 0).ToInteger();
            tmpH1 = ((tmpE > 5) && (tmpE < 10)) || (tmpE > 59);
            if(!tmpH1){
               tmpJ1 = "\"23:00\"";
               tmpI1 = tmpF.Substr(tmpF.Find(tmpJ1), tmpF.Length());
               tmpG = "\"w\":\"";
               tmpY = "\",";
               tmpZ = tmpI1.Find(tmpG) + tmpG.Length();
               tmpE = tmpI1.Substr(tmpZ, 5).StrValueByIndex(tmpY, 0).ToInteger();
               tmpH1 = ((tmpE > 5) && (tmpE < 10)) || (tmpE > 59);      
            }
         }
      }
   }
   dom.GetObject(tmpW).State(tmpH1);
}

tmpF = tmpF .Substr(tmpF .Find(tmpA1), tmpF.Length());
tmpF = tmpF .Substr(tmpF .Find(tmpB1), tmpF.Length());

!Minimaltemperatur
if(dom.GetObject(tmpT).IsTypeOf(OT_VARDP)){
   tmpG = "\"tn\":\"";
   tmpY = "\",";
   tmpZ = tmpF.Find(tmpG) + tmpG.Length();
   tmpL1 = tmpF.Substr(tmpZ, 5).StrValueByIndex(tmpY, 0);
   dom.GetObject(tmpT).State(tmpL1.ToInteger());
}

!Windgeschwindigkeit
if(dom.GetObject(tmpU).IsTypeOf(OT_VARDP)){
   tmpG = "\"ws\":\"";
   tmpY = "\",";
   tmpZ = tmpF.Find(tmpG) + tmpG.Length();
   tmpL1 = tmpF.Substr(tmpZ, 5).StrValueByIndex(tmpY, 0);
   dom.GetObject(tmpU).State(tmpL1.ToInteger());
}

!Wetterzustand Text
if(dom.GetObject(tmpV).IsTypeOf(OT_VARDP)){
   tmpG = "\"w_txt\":\"";
   tmpY = "\"},";
   tmpZ = tmpF.Find(tmpG) + tmpG.Length();
   tmpL1 = tmpF.Substr(tmpZ, 20).StrValueByIndex(tmpY, 0);
   dom.GetObject(tmpV).State(tmpL1);
}


Wettervorhersage Version 2 von ldittmar (http://homematic-forum.de/forum/viewtop ... 31&t=24663) umgeschrieben von homematic-fan. Hier gibt es noch vier Tageszeiten und deren Wettervorhersage.

Code: Alles auswählen

    !-Wetterdaten Abholen-----------------------------------------------------
    ! Entwickelt von Idittmar, auf tmp-Variablen umgeschrieben von Homematic-Fan
    ! Zusätzlich geändert: Alle Zustandsvariablen Zeichenkette statt Zahl -> wegen Mediola-Statusbildern
    ! Hier alle was man verändern kann/muss
    ! Voraussetzung: CUxD und ein Wetter.com Account
    !-----------------------------------------------------------------------------

    ! Hier die MD5 Checksumme aus ProjektName APIKey CityCode eintragen
    string tmpA = "xxxxxxxxxxxxxxxx";

    ! Hier der City Code
    string tmpB = " xxxxxxxxxxxxxxxx ";

    ! Meine Projektnummer
    string tmpC = " xxxxxxxxxxxxxxxx ";

    var tmpD = "CUxD.CUX2801001:10"; !CUxD Virtuelles Gerät

    !Wetter heute Variablen-Namen (alles optional)
    string tmpV = "Wetter_heute_6_zustand" ; !Zeichenkette
    string tmpW = "Wetter_heute_6_tempMax" ; !Zahl -50 - 50 °C
    string tmpX = "Wetter_heute_6_tempMin" ; !Zahl -50 - 50 °C
    string tmpY = "Wetter_heute_6_regen_proz" ; !Zahl 0 - 100 %
    string tmpZ = "Wetter_heute_11_zustand" ; !Zeichenkette
    string tmpA1 = "Wetter_heute_11_tempMax" ; !Zahl -50 - 50 °C
    string tmpB1 = "Wetter_heute_11_tempMin" ; !Zahl -50 - 50 °C
    string tmpC1 = "Wetter_heute_11_regen_proz" ; !Zahl 0 - 100 %
    string tmpD1 = "Wetter_heute_17_zustand" ; !Zeichenkette
    string tmpE1 = "Wetter_heute_17_tempMax" ; !Zahl -50 - 50 °C
    string tmpF1 = "Wetter_heute_17_tempMin" ; !Zahl -50 - 50 °C
    string tmpG1 = "Wetter_heute_17_regen_proz" ; !Zahl 0 - 100 %
    string tmpH1 = "Wetter_heute_23_zustand" ; !Zeichenkette
    string tmpI1 = "Wetter_heute_23_tempMax" ; !Zahl -50 - 50
    string tmpJ1 = "Wetter_heute_23_tempMin" ; !Zahl -50 - 50 °C
    string tmpK1 = "Wetter_heute_23_regen_proz" ; !Zahl 0 - 100 %

    !Wetter morgen Variablen-Namen (alles optional)
    string tmpL1 = "Wetter_morgen_6_zustand" ; !Zeichenkette
    string tmpM1 = "Wetter_morgen_6_tempMax" ; !Zahl -50 - 50 °C
    string tmpN1= "Wetter_morgen_6_tempMin" ; !Zahl -50 - 50 °C
    string tmpO1 = "Wetter_morgen_6_regen_proz" ; !Zahl 0 - 100 %
    string tmpP1 = "Wetter_morgen_11_zustand" ; !Zeichenkette
    string tmpQ1 = "Wetter_morgen_11_tempMax" ; !Zahl -50 - 50 °C
    string tmpR1 = "Wetter_morgen_11_tempMin" ; !Zahl -50 - 50 °C
    string tmpS1 = "Wetter_morgen_11_regen_proz" ; !Zahl 0 - 100 %
    string tmpT1 = "Wetter_morgen_17_zustand" ; !Zeichenkette
    string tmpU1 = "Wetter_morgen_17_tempMax" ; !Zahl -50 - 50 °C
    string tmpV1 = "Wetter_morgen_17_tempMin" ; !Zahl -50 - 50 °C
    string tmpW1 = "Wetter_morgen_17_regen_proz" ; !Zahl 0 - 100 %
    string tmpX1 = "Wetter_morgen_23_zustand" ; !Zeichenkette
    string tmpY1 = "Wetter_morgen_23_tempMax" ; !Zahl -50 - 50
    string tmpZ1 = "Wetter_morgen_23_tempMin" ; !Zahl -50 - 50 °C
    string tmpA2 = "Wetter_morgen_23_regen_proz" ; !Zahl 0 - 100 %

    !Wetter übermorgen Variablen-Namen (alles optional)
    string tmpB2 = "Wetter_morgen2_6_zustand" ; !Zeichenkette
    string tmpC2 = "Wetter_morgen2_6_tempMax" ; !Zahl -50 - 50 °C
    string tmpD2 = "Wetter_morgen2_6_tempMin" ; !Zahl -50 - 50 °C
    string tmpE2 = "Wetter_morgen2_6_regen_proz" ; !Zahl 0 - 100 %
    string tmpF2 = "Wetter_morgen2_11_zustand" ; !Zeichenkette
    string tmpG2 = "Wetter_morgen2_11_tempMax" ; !Zahl -50 - 50 °C
    string tmpH2 = "Wetter_morgen2_11_tempMin" ; !Zahl -50 - 50 °C
    string tmpI2 = "Wetter_morgen2_11_regen_proz" ; !Zahl 0 - 100 %
    string tmpJ2 = "Wetter_morgen2_17_zustand" ; !Zeichenkette
    string tmpK2 = "Wetter_morgen2_17_tempMax" ; !Zahl -50 - 50 °C
    string tmpL2 = "Wetter_morgen2_17_tempMin" ; !Zahl -50 - 50 °C
    string tmpM2 = "Wetter_morgen2_17_regen_proz" ; !Zahl 0 - 100 %
    string tmpN2 = "Wetter_morgen2_23_zustand" ; !Zeichenkette
    string tmpO2 = "Wetter_morgen2_23_tempMax" ; !Zahl -50 - 50
    string tmpP2 = "Wetter_morgen2_23_tempMin" ; !Zahl -50 - 50 °C
    string tmpQ2 = "Wetter_morgen2_23_regen_proz" ; !Zahl 0 - 100 %

    !-----------------------------------------------------------------------------
    ! Ab hier muss man nichts mehr beachten
    !-----------------------------------------------------------------------------

    string tmpE = "http://api.wetter.com/forecast/weather/city/" + tmpB +"/project/" + tmpC + "/cs/" + tmpA + "/output/json";

    var tmpF;
    var tmpG;
    var tmpH;
    var tmpI;
    var tmpJ;
    var tmpK;
    var tmpL;
    var tmpM;
    var tmpN;
    var tmpO = "\"23:00\"";
    var tmpP = "},";
    integer tmpQ;

    var tmpR = system.Date("%F");
    var tmpS = system.Date("%F ")#"00:00:00";
    tmpS = tmpS.ToTime().ToInteger() + 86400;
    var tmpT = tmpS.ToTime().Format("%F");
    tmpS = tmpS.ToTime().ToInteger() + 86400;
    var tmpU = tmpS.ToTime().Format("%F");
       
    dom.GetObject(tmpD # ".CMD_SETS").State("wget -q -O - " # tmpE);
    dom.GetObject(tmpD # ".CMD_QUERY_RET").State(1);
    tmpF = dom.GetObject(tmpD # ".CMD_RETS").State();
       
    !-----------------------------------------------------------------------------
    ! HEUTE
    !-----------------------------------------------------------------------------

    tmpG = "\"" + tmpR + "\":{";
    tmpH = "\"" + tmpT + "\":{";
    tmpJ = tmpF.Substr(tmpF.Find(tmpG), tmpF.Find(tmpH));

    !06:00 Uhr
    tmpQ = tmpJ.Find("06:00");
    tmpK = tmpJ.Substr(tmpQ, tmpJ.Find("11:00") - tmpQ);

    !Wetterzustand
    if(dom.GetObject(tmpV).IsTypeOf(OT_VARDP)){
       tmpL = "\"w\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpV).State(tmpI.ToInteger());
    }

    !Maximaltemperatur
    if(dom.GetObject(tmpW).IsTypeOf(OT_VARDP)){
       tmpL = "\"tx\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpW).State(tmpI.ToInteger());
    }

    !Regenwahrscheinlichkeit
    if(dom.GetObject(tmpY).IsTypeOf(OT_VARDP)){
       tmpL = "\"pc\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpY).State(tmpI.ToInteger());
    }

    !Minimaltemperatur
    if(dom.GetObject(tmpX).IsTypeOf(OT_VARDP)){
       tmpL = "\"tn\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpX).State(tmpI.ToInteger());
    }

    !11:00 Uhr
    tmpQ = tmpJ.Find("11:00");
    tmpK = tmpJ.Substr(tmpQ, tmpJ.Find("17:00") - tmpQ);

    !Wetterzustand
    if(dom.GetObject(tmpZ).IsTypeOf(OT_VARDP)){
       tmpL = "\"w\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpZ).State(tmpI.ToInteger());
    }

    !Maximaltemperatur
    if(dom.GetObject(tmpA1).IsTypeOf(OT_VARDP)){
       tmpL = "\"tx\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpA1).State(tmpI.ToInteger());
    }

    !Regenwahrscheinlichkeit
    if(dom.GetObject(tmpC1).IsTypeOf(OT_VARDP)){
       tmpL = "\"pc\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpC1).State(tmpI.ToInteger());
    }

    !Minimaltemperatur
    if(dom.GetObject(tmpB1).IsTypeOf(OT_VARDP)){
       tmpL = "\"tn\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpB1).State(tmpI.ToInteger());
    }

    !17:00 Uhr
    tmpQ = tmpJ.Find("17:00");
    tmpK = tmpJ.Substr(tmpQ, tmpJ.Find("23:00") - tmpQ);

    !Wetterzustand
    if(dom.GetObject(tmpD1).IsTypeOf(OT_VARDP)){
       tmpL = "\"w\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpD1).State(tmpI.ToInteger());
    }

    !Maximaltemperatur
    if(dom.GetObject(tmpE1).IsTypeOf(OT_VARDP)){
       tmpL = "\"tx\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpE1).State(tmpI.ToInteger());
    }

    !Regenwahrscheinlichkeit
    if(dom.GetObject(tmpG1).IsTypeOf(OT_VARDP)){
       tmpL = "\"pc\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpG1).State(tmpI.ToInteger());
    }

    !Minimaltemperatur
    if(dom.GetObject(tmpF1).IsTypeOf(OT_VARDP)){
       tmpL = "\"tn\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpF1).State(tmpI.ToInteger());
    }
    !23:00 Uhr
    tmpQ = tmpJ.Find("23:00");
    tmpK = tmpJ.Substr(tmpQ, tmpJ.Length() - tmpQ);

    !Wetterzustand
    if(dom.GetObject(tmpH1).IsTypeOf(OT_VARDP)){
       tmpL = "\"w\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpH1).State(tmpI.ToInteger());
    }

    !Maximaltemperatur
    if(dom.GetObject(tmpI1).IsTypeOf(OT_VARDP)){
       tmpL = "\"tx\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpI1).State(tmpI.ToInteger());
    }

    !Regenwahrscheinlichkeit
    if(dom.GetObject(tmpK1).IsTypeOf(OT_VARDP)){
       tmpL = "\"pc\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpK1).State(tmpI.ToInteger());
    }

    !Minimaltemperatur
    if(dom.GetObject(tmpJ1).IsTypeOf(OT_VARDP)){
       tmpL = "\"tn\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpJ1).State(tmpI.ToInteger());
    }


    !-----------------------------------------------------------------------------
    ! MORGEN
    !-----------------------------------------------------------------------------

    tmpG = "\"" + tmpT + "\":{";
    tmpH = "\"" + tmpU + "\":{";
    tmpJ = tmpF.Substr(tmpF.Find(tmpG), tmpF.Find(tmpH));

    !06:00 Uhr
    tmpQ = tmpJ.Find("06:00");
    tmpK = tmpJ.Substr(tmpQ, tmpJ.Find("11:00") - tmpQ);

    !Wetterzustand
    if(dom.GetObject(tmpL1).IsTypeOf(OT_VARDP)){
       tmpL = "\"w\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpL1).State(tmpI.ToInteger());
    }

    !Maximaltemperatur
    if(dom.GetObject(tmpM1).IsTypeOf(OT_VARDP)){
       tmpL = "\"tx\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpM1).State(tmpI.ToInteger());
    }

    !Regenwahrscheinlichkeit
    if(dom.GetObject(tmpO1).IsTypeOf(OT_VARDP)){
       tmpL = "\"pc\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpO1).State(tmpI.ToInteger());
    }

    !Minimaltemperatur
    if(dom.GetObject(tmpN1).IsTypeOf(OT_VARDP)){
       tmpL = "\"tn\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpN1).State(tmpI.ToInteger());
    }

    !11:00 Uhr
    tmpQ = tmpJ.Find("11:00");
    tmpK = tmpJ.Substr(tmpQ, tmpJ.Find("17:00") - tmpQ);

    !Wetterzustand
    if(dom.GetObject(tmpP1).IsTypeOf(OT_VARDP)){
       tmpL = "\"w\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpP1).State(tmpI.ToInteger());
    }

    !Maximaltemperatur
    if(dom.GetObject(tmpQ1).IsTypeOf(OT_VARDP)){
       tmpL = "\"tx\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpQ1).State(tmpI.ToInteger());
    }

    !Regenwahrscheinlichkeit
    if(dom.GetObject(tmpS1).IsTypeOf(OT_VARDP)){
       tmpL = "\"pc\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpS1).State(tmpI.ToInteger());
    }

    !Minimaltemperatur
    if(dom.GetObject(tmpR1).IsTypeOf(OT_VARDP)){
       tmpL = "\"tn\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpR1).State(tmpI.ToInteger());
    }

    !17:00 Uhr
    tmpQ = tmpJ.Find("17:00");
    tmpK = tmpJ.Substr(tmpQ, tmpJ.Find("23:00") - tmpQ);

    !Wetterzustand
    if(dom.GetObject(tmpT1).IsTypeOf(OT_VARDP)){
       tmpL = "\"w\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpT1).State(tmpI.ToInteger());
    }

    !Maximaltemperatur
    if(dom.GetObject(tmpU1).IsTypeOf(OT_VARDP)){
       tmpL = "\"tx\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpU1).State(tmpI.ToInteger());
    }

    !Regenwahrscheinlichkeit
    if(dom.GetObject(tmpW1).IsTypeOf(OT_VARDP)){
       tmpL = "\"pc\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpW1).State(tmpI.ToInteger());
    }

    !Minimaltemperatur
    if(dom.GetObject(tmpV1).IsTypeOf(OT_VARDP)){
       tmpL = "\"tn\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpV1).State(tmpI.ToInteger());
    }
    !23:00 Uhr
    tmpQ = tmpJ.Find("23:00");
    tmpK = tmpJ.Substr(tmpQ, tmpJ.Length() - tmpQ);

    !Wetterzustand
    if(dom.GetObject(tmpX1).IsTypeOf(OT_VARDP)){
       tmpL = "\"w\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpX1).State(tmpI.ToInteger());
    }

    !Maximaltemperatur
    if(dom.GetObject(tmpY1).IsTypeOf(OT_VARDP)){
       tmpL = "\"tx\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpY1).State(tmpI.ToInteger());
    }

    !Regenwahrscheinlichkeit
    if(dom.GetObject(tmpA2).IsTypeOf(OT_VARDP)){
       tmpL = "\"pc\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpA2).State(tmpI.ToInteger());
    }

    !Minimaltemperatur
    if(dom.GetObject(tmpZ1).IsTypeOf(OT_VARDP)){
       tmpL = "\"tn\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpZ1).State(tmpI.ToInteger());
    }

    !-----------------------------------------------------------------------------
    ! ÜBERMORGEN
    !-----------------------------------------------------------------------------

    tmpG = "\"" + tmpU + "\":{";
    tmpH = "}}";
    tmpJ = tmpF.Substr(tmpF.Find(tmpG), tmpF.Find(tmpH));

    !Wetterzustand
    if(dom.GetObject(tmpB2).IsTypeOf(OT_VARDP)){
       tmpL = "\"w\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpB2).State(tmpI.ToInteger());
    }

    !Maximaltemperatur
    if(dom.GetObject(tmpC2).IsTypeOf(OT_VARDP)){
       tmpL = "\"tx\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpC2).State(tmpI.ToInteger());
    }

    !Regenwahrscheinlichkeit
    if(dom.GetObject(tmpE2).IsTypeOf(OT_VARDP)){
       tmpL = "\"pc\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpE2).State(tmpI.ToInteger());
    }

    !Minimaltemperatur
    if(dom.GetObject(tmpD2).IsTypeOf(OT_VARDP)){
       tmpL = "\"tn\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpD2).State(tmpI.ToInteger());
    }

    !11:00 Uhr
    tmpQ = tmpJ.Find("11:00");
    tmpK = tmpJ.Substr(tmpQ, tmpJ.Find("17:00") - tmpQ);

    !Wetterzustand
    if(dom.GetObject(tmpF2).IsTypeOf(OT_VARDP)){
       tmpL = "\"w\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpF2).State(tmpI.ToInteger());
    }

    !Maximaltemperatur
    if(dom.GetObject(tmpG2).IsTypeOf(OT_VARDP)){
       tmpL = "\"tx\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpG2).State(tmpI.ToInteger());
    }

    !Regenwahrscheinlichkeit
    if(dom.GetObject(tmpI2).IsTypeOf(OT_VARDP)){
       tmpL = "\"pc\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpI2).State(tmpI.ToInteger());
    }

    !Minimaltemperatur
    if(dom.GetObject(tmpH2).IsTypeOf(OT_VARDP)){
       tmpL = "\"tn\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpH2).State(tmpI.ToInteger());
    }

    !17:00 Uhr
    tmpQ = tmpJ.Find("17:00");
    tmpK = tmpJ.Substr(tmpQ, tmpJ.Find("23:00") - tmpQ);

    !Wetterzustand
    if(dom.GetObject(tmpJ2).IsTypeOf(OT_VARDP)){
       tmpL = "\"w\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpJ2).State(tmpI.ToInteger());
    }

    !Maximaltemperatur
    if(dom.GetObject(tmpK2).IsTypeOf(OT_VARDP)){
       tmpL = "\"tx\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpK2).State(tmpI.ToInteger());
    }

    !Regenwahrscheinlichkeit
    if(dom.GetObject(tmpM2).IsTypeOf(OT_VARDP)){
       tmpL = "\"pc\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpM2).State(tmpI.ToInteger());
    }

    !Minimaltemperatur
    if(dom.GetObject(tmpL2).IsTypeOf(OT_VARDP)){
       tmpL = "\"tn\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpL2).State(tmpI.ToInteger());
    }
    !23:00 Uhr
    tmpQ = tmpJ.Find("23:00");
    tmpK = tmpJ.Substr(tmpQ, tmpJ.Length() - tmpQ);

    !Wetterzustand
    if(dom.GetObject(tmpN2).IsTypeOf(OT_VARDP)){
       tmpL = "\"w\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpN2).State(tmpI.ToInteger());
    }

    !Maximaltemperatur
    if(dom.GetObject(tmpO2).IsTypeOf(OT_VARDP)){
       tmpL = "\"tx\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpO2).State(tmpI.ToInteger());
    }

    !Regenwahrscheinlichkeit
    if(dom.GetObject(tmpQ2).IsTypeOf(OT_VARDP)){
       tmpL = "\"pc\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpQ2).State(tmpI.ToInteger());
    }

    !Minimaltemperatur
    if(dom.GetObject(tmpP2).IsTypeOf(OT_VARDP)){
       tmpL = "\"tn\":\"";
       tmpM = "\",";
       tmpN = tmpK.Find(tmpL) + tmpL.Length();
       tmpI = tmpK.Substr(tmpN, 5).StrValueByIndex(tmpM, 0);
       dom.GetObject(tmpP2).State(tmpI.ToInteger());
    };
Zuletzt geändert von AndiN am 09.08.2016, 06:56, insgesamt 4-mal geändert.
Andi (Greenhorn)

Letzter Reboot: 17.03.24 => FW Update (Uptime:Rekord:153 Tage)
Systeminfos: Raspberry Pi3 Firmware: 3.75.6.20240316 142 Geräte
System angebunden: 3 Roomba 650 - Sprachausgabe via Home24 Media - Pocket Control
- Zentrale: Asus TF103 mit Home24 Tablet
Addons: Drucken 2.5 - HQ WebUI 2.5.9 - XML-API 1.22 - CUx-Daemon 2.9.3 - E-Mail 1.7.4 - hm_pdetect 1.11 - VPN cloudmatic
Diverse Links

Benutzeravatar
AndiN
Beiträge: 2621
Registriert: 10.06.2015, 08:54
Wohnort: Hennef
Hat sich bedankt: 10 Mal
Danksagung erhalten: 28 Mal

Re: Script Probleme (überarbeitete Skripts)

Beitrag von AndiN » 24.11.2015, 19:26

Kalender Berechnung Univeralscript von BadenPower Urpsrungsskript hier

Code: Alles auswählen

!Kalendertag-Berechnung Version 2.0.1
!*********************************
!www.homematic-forum.de (c) by BadenPower
string tmpA="D";
string tmpB="keine Auswahl";
string tmpC="nicht benannt";
string tmpD="Kalendertag-Berechnung Version 2.0.1";
string tmpE="";
if(system.IsVar("tmpE")){
tmpE=tmpE#"Protokoll;Landeskennung;Jahr;Jahr-Schaltjahr;Jahr-Tag;Jahr-Woche-ISO8601;Jahr-Woche-Beginn1Sonntag;Jahr-Woche-Beginn1Montag;Jahr-Woche-GeradeISO8601;Jahr-Woche-GeradeBeginn1Sonntag;Jahr-Woche-GeradeBeginn1Montag;Monat-Auswahl;Monat-Name;Monat-Zahl;Monat-Tag;Wochentag-Auswahl;Wochentag-Name;Wochentag-ZahlBeginn1Montag;Wochentag-ZahlBeginn1Sonntag;Wochentag-ZahlBeginn0Sonntag";
tmpE=tmpE#";Wochenende-Heute;Wochenende-Morgen;Wochenende-Gestern;Wochenende-Tage-Beginn;Wochenende-Tage-Ende;Werktag-Mo-Fr-Heute;Werktag-Mo-Fr-Morgen;Werktag-Mo-Fr-Gestern;Werktag-Mo-Sa-Heute;Werktag-Mo-Sa-Morgen;Werktag-Mo-Sa-Gestern;Sommerzeit;Sommerzeit-TageBeginn;Sommerzeit-TageEnde;Sommerzeit-TageUmstellung;Sommerzeit-DatumBeginn;Sommerzeit-DatumEnde;Sommerzeit-DatumUmstellung;Jahreszeit-Kalendarisch;Jahreszeit-Meteorologisch";
tmpE=tmpE#";Feiertag-TermineZusatz;Feiertag-Entfernen;Feiertag-Heute;Feiertag-Heute-Auswahl;Feiertag-Heute-Name;Feiertag-Morgen;Feiertag-Morgen-Auswahl;Feiertag-Morgen-Name;Feiertag-Gestern;Feiertag-Gestern-Auswahl;Feiertag-Gestern-Name;Feiertag-Übermorgen;Feiertag-Übermorgen-Auswahl;Feiertag-Übermorgen-Name;Feiertag-Vorgestern;Feiertag-Vorgestern-Auswahl;Feiertag-Vorgestern-Name;Feiertag-Nächster-Tage;Feiertag-Nächster-Auswahl;Feiertag-Nächster-Datum;Feiertag-Nächster-Name";
tmpE=tmpE#";Festtag-Termine;Festtag-Heute;Festtag-Heute-Auswahl;Festtag-Heute-Name;Festtag-Morgen;Festtag-Morgen-Auswahl;Festtag-Morgen-Name;Festtag-Gestern;Festtag-Gestern-Auswahl;Festtag-Gestern-Name;Festtag-Übermorgen;Festtag-Übermorgen-Auswahl;Festtag-Übermorgen-Name;Festtag-Vorgestern;Festtag-Vorgestern-Auswahl;Festtag-Vorgestern-Name;Festtag-Nächster-Tage;Festtag-Nächster-Auswahl;Festtag-Nächster-Datum;Festtag-Nächster-Name";
tmpE=tmpE#";Brauchtum-Termine;Brauchtum-Heute;Brauchtum-Heute-Auswahl;Brauchtum-Heute-Name;Brauchtum-Morgen;Brauchtum-Morgen-Auswahl;Brauchtum-Morgen-Name;Brauchtum-Gestern;Brauchtum-Gestern-Auswahl;Brauchtum-Gestern-Name;Brauchtum-Übermorgen;Brauchtum-Übermorgen-Auswahl;Brauchtum-Übermorgen-Name;Brauchtum-Vorgestern;Brauchtum-Vorgestern-Auswahl;Brauchtum-Vorgestern-Name;Brauchtum-Nächster-Tage;Brauchtum-Nächster-Auswahl;Brauchtum-Nächster-Datum;Brauchtum-Nächster-Name";
tmpE=tmpE#";XTag-Termine;XTag-Heute;XTag-Heute-Auswahl;XTag-Heute-Name;XTag-Morgen;XTag-Morgen-Auswahl;XTag-Morgen-Name;XTag-Gestern;XTag-Gestern-Auswahl;XTag-Gestern-Name;XTag-Übermorgen;XTag-Übermorgen-Auswahl;XTag-Übermorgen-Name;XTag-Vorgestern;XTag-Vorgestern-Auswahl;XTag-Vorgestern-Name;XTag-Nächster-Tage;XTag-Nächster-Auswahl;XTag-Nächster-Datum;XTag-Nächster-Name";
tmpE=tmpE#";Sondertag-Heute;Sondertag-Morgen;Sondertag-Gestern;Sondertag-Übermorgen;Sondertag-Vorgestern;Brückentag-Mo-Fr-WE-FT-Heute;Brückentag-Mo-Fr-WE-FT-Morgen;Brückentag-Mo-Fr-WE-FT-Gestern;Brückentag-Mo-Fr-WE-FT-FT-Heute;Brückentag-Mo-Fr-WE-FT-FT-Morgen;Brückentag-Mo-Fr-WE-FT-FT-Gestern;Brückentag-Mo-Sa-WE-FT-Heute;Brückentag-Mo-Sa-WE-FT-Morgen;Brückentag-Mo-Sa-WE-FT-Gestern;Brückentag-Mo-Sa-WE-FT-FT-Heute;Brückentag-Mo-Sa-WE-FT-FT-Morgen;Brückentag-Mo-Sa-WE-FT-FT-Gestern";
tmpE=tmpE#";Urlaub-01-Termine;Urlaub-01-Heute;Urlaub-01-Morgen;Urlaub-01-Gestern;Urlaub-01-TageBeginn;Urlaub-01-Anwesend-Heute;Urlaub-01-Anwesend-Morgen;Urlaub-01-Anwesend-Gestern;Urlaub-01-Anwesend-TageBeginn;Urlaub-01-Anwesend-TageEnde;Urlaub-01-Anwesend-Datum;Urlaub-01-Abwesend-Heute;Urlaub-01-Abwesend-Morgen;Urlaub-01-Abwesend-Gestern;Urlaub-01-Abwesend-TageBeginn;Urlaub-01-Abwesend-TageEnde;Urlaub-01-Abwesend-Datum";
tmpE=tmpE#";Urlaub-02-Termine;Urlaub-02-Heute;Urlaub-02-Morgen;Urlaub-02-Gestern;Urlaub-02-TageBeginn;Urlaub-02-Anwesend-Heute;Urlaub-02-Anwesend-Morgen;Urlaub-02-Anwesend-Gestern;Urlaub-02-Anwesend-TageBeginn;Urlaub-02-Anwesend-TageEnde;Urlaub-02-Anwesend-Datum;Urlaub-02-Abwesend-Heute;Urlaub-02-Abwesend-Morgen;Urlaub-02-Abwesend-Gestern;Urlaub-02-Abwesend-TageBeginn;Urlaub-02-Abwesend-TageEnde;Urlaub-02-Abwesend-Datum";
tmpE=tmpE#";Urlaub-03-Termine;Urlaub-03-Heute;Urlaub-03-Morgen;Urlaub-03-Gestern;Urlaub-03-TageBeginn;Urlaub-03-Anwesend-Heute;Urlaub-03-Anwesend-Morgen;Urlaub-03-Anwesend-Gestern;Urlaub-03-Anwesend-TageBeginn;Urlaub-03-Anwesend-TageEnde;Urlaub-03-Anwesend-Datum;Urlaub-03-Abwesend-Heute;Urlaub-03-Abwesend-Morgen;Urlaub-03-Abwesend-Gestern;Urlaub-03-Abwesend-TageBeginn;Urlaub-03-Abwesend-TageEnde;Urlaub-03-Abwesend-Datum";
tmpE=tmpE#";Urlaub-04-Termine;Urlaub-04-Heute;Urlaub-04-Morgen;Urlaub-04-Gestern;Urlaub-04-TageBeginn;Urlaub-04-Anwesend-Heute;Urlaub-04-Anwesend-Morgen;Urlaub-04-Anwesend-Gestern;Urlaub-04-Anwesend-TageBeginn;Urlaub-04-Anwesend-TageEnde;Urlaub-04-Anwesend-Datum;Urlaub-04-Abwesend-Heute;Urlaub-04-Abwesend-Morgen;Urlaub-04-Abwesend-Gestern;Urlaub-04-Abwesend-TageBeginn;Urlaub-04-Abwesend-TageEnde;Urlaub-04-Abwesend-Datum";
tmpE=tmpE#";Urlaub-05-Termine;Urlaub-05-Heute;Urlaub-05-Morgen;Urlaub-05-Gestern;Urlaub-05-TageBeginn;Urlaub-05-Anwesend-Heute;Urlaub-05-Anwesend-Morgen;Urlaub-05-Anwesend-Gestern;Urlaub-05-Anwesend-TageBeginn;Urlaub-05-Anwesend-TageEnde;Urlaub-05-Anwesend-Datum;Urlaub-05-Abwesend-Heute;Urlaub-05-Abwesend-Morgen;Urlaub-05-Abwesend-Gestern;Urlaub-05-Abwesend-TageBeginn;Urlaub-05-Abwesend-TageEnde;Urlaub-05-Abwesend-Datum";
tmpE=tmpE#";Urlaub-Heute;Urlaub-Morgen;Urlaub-Gestern;Urlaub-TageBeginn";
tmpE=tmpE#";Ferien-01-Termine;Ferien-01-Heute;Ferien-01-Morgen;Ferien-01-Gestern;Ferien-01-TageBeginn;Ferien-01-Anwesend-Heute;Ferien-01-Anwesend-Morgen;Ferien-01-Anwesend-Gestern;Ferien-01-Anwesend-TageBeginn;Ferien-01-Anwesend-TageEnde;Ferien-01-Anwesend-Datum;Ferien-01-Abwesend-Heute;Ferien-01-Abwesend-Morgen;Ferien-01-Abwesend-Gestern;Ferien-01-Abwesend-TageBeginn;Ferien-01-Abwesend-TageEnde;Ferien-01-Abwesend-Datum";
tmpE=tmpE#";Ferien-02-Termine;Ferien-02-Heute;Ferien-02-Morgen;Ferien-02-Gestern;Ferien-02-TageBeginn;Ferien-02-Anwesend-Heute;Ferien-02-Anwesend-Morgen;Ferien-02-Anwesend-Gestern;Ferien-02-Anwesend-TageBeginn;Ferien-02-Anwesend-TageEnde;Ferien-02-Anwesend-Datum;Ferien-02-Abwesend-Heute;Ferien-02-Abwesend-Morgen;Ferien-02-Abwesend-Gestern;Ferien-02-Abwesend-TageBeginn;Ferien-02-Abwesend-TageEnde;Ferien-02-Abwesend-Datum";
tmpE=tmpE#";Ferien-03-Termine;Ferien-03-Heute;Ferien-03-Morgen;Ferien-03-Gestern;Ferien-03-TageBeginn;Ferien-03-Anwesend-Heute;Ferien-03-Anwesend-Morgen;Ferien-03-Anwesend-Gestern;Ferien-03-Anwesend-TageBeginn;Ferien-03-Anwesend-TageEnde;Ferien-03-Anwesend-Datum;Ferien-03-Abwesend-Heute;Ferien-03-Abwesend-Morgen;Ferien-03-Abwesend-Gestern;Ferien-03-Abwesend-TageBeginn;Ferien-03-Abwesend-TageEnde;Ferien-03-Abwesend-Datum";
tmpE=tmpE#";Ferien-04-Termine;Ferien-04-Heute;Ferien-04-Morgen;Ferien-04-Gestern;Ferien-04-TageBeginn;Ferien-04-Anwesend-Heute;Ferien-04-Anwesend-Morgen;Ferien-04-Anwesend-Gestern;Ferien-04-Anwesend-TageBeginn;Ferien-04-Anwesend-TageEnde;Ferien-04-Anwesend-Datum;Ferien-04-Abwesend-Heute;Ferien-04-Abwesend-Morgen;Ferien-04-Abwesend-Gestern;Ferien-04-Abwesend-TageBeginn;Ferien-04-Abwesend-TageEnde;Ferien-04-Abwesend-Datum";
tmpE=tmpE#";Ferien-05-Termine;Ferien-05-Heute;Ferien-05-Morgen;Ferien-05-Gestern;Ferien-05-TageBeginn;Ferien-05-Anwesend-Heute;Ferien-05-Anwesend-Morgen;Ferien-05-Anwesend-Gestern;Ferien-05-Anwesend-TageBeginn;Ferien-05-Anwesend-TageEnde;Ferien-05-Anwesend-Datum;Ferien-05-Abwesend-Heute;Ferien-05-Abwesend-Morgen;Ferien-05-Abwesend-Gestern;Ferien-05-Abwesend-TageBeginn;Ferien-05-Abwesend-TageEnde;Ferien-05-Abwesend-Datum";
tmpE=tmpE#";Ferien-Heute;Ferien-Morgen;Ferien-Gestern;Ferien-TageBeginn";
tmpE=tmpE#";Abfall-Grau-Termine;Abfall-Grau-Heute;Abfall-Grau-Morgen;Abfall-Grau-Tage;Abfall-Grau-Datum";
tmpE=tmpE#";Abfall-Grün-Termine;Abfall-Grün-Heute;Abfall-Grün-Morgen;Abfall-Grün-Tage;Abfall-Grün-Datum";
tmpE=tmpE#";Abfall-Gelb-Termine;Abfall-Gelb-Heute;Abfall-Gelb-Morgen;Abfall-Gelb-Tage;Abfall-Gelb-Datum";
tmpE=tmpE#";Abfall-Braun-Termine;Abfall-Braun-Heute;Abfall-Braun-Morgen;Abfall-Braun-Tage;Abfall-Braun-Datum";
tmpE=tmpE#";Abfall-Blau-Termine;Abfall-Blau-Heute;Abfall-Blau-Morgen;Abfall-Blau-Tage;Abfall-Blau-Datum";
tmpE=tmpE#";Abfall-Rot-Termine;Abfall-Rot-Heute;Abfall-Rot-Morgen;Abfall-Rot-Tage;Abfall-Rot-Datum";
tmpE=tmpE#";Abfall-Glas-Termine;Abfall-Glas-Heute;Abfall-Glas-Morgen;Abfall-Glas-Tage;Abfall-Glas-Datum";
tmpE=tmpE#";Abfall-Sondermüll-Termine;Abfall-Sondermüll-Heute;Abfall-Sondermüll-Morgen;Abfall-Sondermüll-Tage;Abfall-Sondermüll-Datum";
tmpE=tmpE#";Abfall-Sperrmüll-Termine;Abfall-Sperrmüll-Heute;Abfall-Sperrmüll-Morgen;Abfall-Sperrmüll-Tage;Abfall-Sperrmüll-Datum";
tmpE=tmpE#";Abfall-Sonstiges-Termine;Abfall-Sonstiges-Heute;Abfall-Sonstiges-Morgen;Abfall-Sonstiges-Tage;Abfall-Sonstiges-Datum";
tmpE=tmpE#";Abfall-Heute;Abfall-Morgen";
tmpE=tmpE#";Zeitspanne-01-Termine;Zeitspanne-01-Heute;Zeitspanne-01-Morgen;Zeitspanne-01-Gestern;Zeitspanne-01-TageBeginn;Zeitspanne-01-TageEnde;Zeitspanne-01-Datum";
tmpE=tmpE#";Zeitspanne-02-Termine;Zeitspanne-02-Heute;Zeitspanne-02-Morgen;Zeitspanne-02-Gestern;Zeitspanne-02-TageBeginn;Zeitspanne-02-TageEnde;Zeitspanne-02-Datum";
tmpE=tmpE#";Zeitspanne-03-Termine;Zeitspanne-03-Heute;Zeitspanne-03-Morgen;Zeitspanne-03-Gestern;Zeitspanne-03-TageBeginn;Zeitspanne-03-TageEnde;Zeitspanne-03-Datum";
tmpE=tmpE#";Zeitspanne-04-Termine;Zeitspanne-04-Heute;Zeitspanne-04-Morgen;Zeitspanne-04-Gestern;Zeitspanne-04-TageBeginn;Zeitspanne-04-TageEnde;Zeitspanne-04-Datum";
tmpE=tmpE#";Zeitspanne-05-Termine;Zeitspanne-05-Heute;Zeitspanne-05-Morgen;Zeitspanne-05-Gestern;Zeitspanne-05-TageBeginn;Zeitspanne-05-TageEnde;Zeitspanne-05-Datum";
tmpE=tmpE#";Zeitspanne-06-Termine;Zeitspanne-06-Heute;Zeitspanne-06-Morgen;Zeitspanne-06-Gestern;Zeitspanne-06-TageBeginn;Zeitspanne-06-TageEnde;Zeitspanne-06-Datum";
tmpE=tmpE#";Zeitspanne-07-Termine;Zeitspanne-07-Heute;Zeitspanne-07-Morgen;Zeitspanne-07-Gestern;Zeitspanne-07-TageBeginn;Zeitspanne-07-TageEnde;Zeitspanne-07-Datum";
tmpE=tmpE#";Zeitspanne-08-Termine;Zeitspanne-08-Heute;Zeitspanne-08-Morgen;Zeitspanne-08-Gestern;Zeitspanne-08-TageBeginn;Zeitspanne-08-TageEnde;Zeitspanne-08-Datum";
tmpE=tmpE#";Zeitspanne-09-Termine;Zeitspanne-09-Heute;Zeitspanne-09-Morgen;Zeitspanne-09-Gestern;Zeitspanne-09-TageBeginn;Zeitspanne-09-TageEnde;Zeitspanne-09-Datum";
tmpE=tmpE#";Zeitspanne-10-Termine;Zeitspanne-10-Heute;Zeitspanne-10-Morgen;Zeitspanne-10-Gestern;Zeitspanne-10-TageBeginn;Zeitspanne-10-TageEnde;Zeitspanne-10-Datum";
tmpE=tmpE#";Countdown-01-Termin;Countdown-01-Heute;Countdown-01-Morgen;Countdown-01-Gestern;Countdown-01-Tage;Countdown-01-Datum";
tmpE=tmpE#";Countdown-02-Termin;Countdown-02-Heute;Countdown-02-Morgen;Countdown-02-Gestern;Countdown-02-Tage;Countdown-02-Datum";
tmpE=tmpE#";Countdown-03-Termin;Countdown-03-Heute;Countdown-03-Morgen;Countdown-03-Gestern;Countdown-03-Tage;Countdown-03-Datum";
tmpE=tmpE#";Countdown-04-Termin;Countdown-04-Heute;Countdown-04-Morgen;Countdown-04-Gestern;Countdown-04-Tage;Countdown-04-Datum";
tmpE=tmpE#";Countdown-05-Termin;Countdown-05-Heute;Countdown-05-Morgen;Countdown-05-Gestern;Countdown-05-Tage;Countdown-05-Datum";
tmpE=tmpE#";Countdown-06-Termin;Countdown-06-Heute;Countdown-06-Morgen;Countdown-06-Gestern;Countdown-06-Tage;Countdown-06-Datum";
tmpE=tmpE#";Countdown-07-Termin;Countdown-07-Heute;Countdown-07-Morgen;Countdown-07-Gestern;Countdown-07-Tage;Countdown-07-Datum";
tmpE=tmpE#";Countdown-08-Termin;Countdown-08-Heute;Countdown-08-Morgen;Countdown-08-Gestern;Countdown-08-Tage;Countdown-08-Datum";
tmpE=tmpE#";Countdown-09-Termin;Countdown-09-Heute;Countdown-09-Morgen;Countdown-09-Gestern;Countdown-09-Tage;Countdown-09-Datum";
tmpE=tmpE#";Countdown-10-Termin;Countdown-10-Heute;Countdown-10-Morgen;Countdown-10-Gestern;Countdown-10-Tage;Countdown-10-Datum";
}

!-----Variabeln deklarieren
string tmpC1="";time tmpD1=(system.Date("%F %X")).ToTime();boolean tmpE1=true;string tmpQ2;string tmpR2;time tmpI1=(tmpD1.Format("%F")#" 06:00:00").ToTime();integer tmpJ1=-1;
string tmpK1="";string tmpL1="";string tmpM1="";string tmpN1="";string tmpO1="";string tmpP1="";string tmpQ1="";string tmpR1="";string tmpS1="Sonntag;Montag;Dienstag;Mittwoch;Donnerstag;Freitag;Samstag";string tmpA1="Januar;Februar;März;April;Mai;Juni;Juli;August;September;Oktober;November;Dezember";integer tmpX=0;integer tmpY=0;integer tmpZ=0;string tmpF1="";string tmpG1="";string tmpH1="";
boolean tmpT1=false;boolean tmpU1=false;boolean tmpV1=false;boolean tmpW1=false;boolean tmpX1=false;boolean tmpY1=false;boolean tmpZ1=false;time tmpA2;time tmpB2;time tmpC2;integer tmpF=0;integer tmpG=0;integer tmpH=0;integer tmpI=0;integer tmpJ=0;integer tmpK=0;integer tmpL=0;integer tmpM=0;integer tmpN=0;integer tmpB1=0;
string tmpD2="";string tmpE2="";string tmpF2="";string tmpG2="";string tmpH2="";string tmpI2="";string tmpJ2="";object tmpK2=null;object tmpL2=null;object tmpM2=null;object tmpN2=null;object tmpO2=null;string tmpO="";string tmpP="";string tmpQ="";string tmpR="";string tmpS="";string tmpT="";string tmpU="";string tmpV="";string tmpW="";var tmpP2;
string tmpS2="";

if((system.IsVar("tmpS2"))&&(system.IsVar("tmpF1"))){
tmpS2="tmpD;tmpE;tmpC1;tmpD1;tmpE1;tmpX;tmpY;tmpZ;tmpF1;tmpG1;tmpH1;tmpI1;tmpJ1;tmpK1;tmpL1;tmpM1;tmpN1;tmpO1;tmpP1;tmpQ1;tmpR1;tmpS1;tmpA1;tmpA;tmpB;tmpC;tmpT1;tmpU1;tmpV1;tmpW1;tmpX1;tmpY1;tmpZ1;tmpA2;tmpB2;tmpC2;tmpF;tmpG;tmpH;tmpI;tmpJ;tmpK;tmpL;tmpM;tmpN;tmpB1;tmpD2;tmpE2;tmpF2;tmpG2;tmpH2;tmpI2;tmpJ2;tmpK2;tmpL2;tmpM2;tmpN2;tmpO2;tmpO;tmpP;tmpQ;tmpR;tmpS;tmpT;tmpU;tmpV;tmpW;tmpP2;tmpQ2;tmpR2";
if(tmpS2.VarType()==4){foreach(tmpF1,tmpS2.Split(";")){if(system.IsVar(tmpF1)==false){if(system.IsVar("tmpE")){if(tmpE.StrValueByIndex(";",0)<>""){if(dom.GetObject(tmpE.StrValueByIndex(";",0))){(dom.GetObject(tmpE.StrValueByIndex(";",0))).State("ACHTUNG: Skript-Variabel-Überlauf");}}}quit;}}}else{quit;}}else{quit;}
tmpX=0;foreach(tmpF1,tmpE.Split(";")){tmpO="0-0-0";if(tmpF1<>""){tmpK2=dom.GetObject(tmpF1);if(tmpK2){if(tmpX==-1){tmpO="1";if((tmpK2.Value()==null)||(tmpK2.Value()=="")||(tmpK2.Value()=="???")){tmpO=tmpO#"-0";}else{tmpO=tmpO#"-1";}tmpO=tmpO#"-0";}else{tmpO="1-0-0";}}}if(tmpX>0){tmpC1=tmpC1#";";}tmpC1=tmpC1#tmpO;tmpX=tmpX+1;}
tmpD2="2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36;37;38;39";tmpT1=false;tmpL=tmpI1.Year();if((tmpL%400)==0){tmpT1=true;}else{if((tmpL%100)==0){tmpT1=false;}else{if((tmpL%4)==0){tmpT1=true;}}}
tmpU1=(tmpD1.IsDST()==1);tmpA2=(tmpI1.Format("%Y")#"-03-31 06:00:00").ToTime();tmpL=(tmpA2.Format("%w")).ToInteger();tmpB2=((tmpA2-(tmpL*86400)).Format("%F")#" 06:00:00").ToTime();if(tmpI1>tmpB2){tmpA2=((tmpI1.Year()+1).ToString(0)#"-03-31 06:00:00").ToTime();tmpL=(tmpA2.Format("%w")).ToInteger();tmpB2=((tmpA2-(tmpL*86400)).Format("%F")#" 06:00:00").ToTime();}
tmpA2=(tmpI1.Format("%Y")#"-10-31 06:00:00").ToTime();tmpL=(tmpA2.Format("%w")).ToInteger();tmpC2=((tmpA2-(tmpL*86400)).Format("%F")#" 06:00:00").ToTime();if(tmpI1>tmpC2){tmpA2=((tmpI1.Year()+1).ToString(0)#"-10-31 06:00:00").ToTime();tmpL=(tmpA2.Format("%w")).ToInteger();tmpC2=((tmpA2-(tmpL*86400)).Format("%F")#" 06:00:00").ToTime();}
tmpG=(((tmpB2+86400)-(tmpI1)).ToInteger()/86400).ToInteger()-1;tmpH=(((tmpC2+86400)-(tmpI1)).ToInteger()/86400).ToInteger()-1;tmpF=tmpG;tmpP=tmpB2.Format("%d.%m.%Y");tmpQ=tmpC2.Format("%d.%m.%Y");tmpO=tmpP;if(tmpG>tmpH){tmpF=tmpH;tmpO=tmpQ;}tmpI=(tmpI1.Format("%w")).ToInteger();tmpJ=(tmpI1.Format("%u")).ToInteger();tmpK=tmpI1.Month();
tmpX=0;while(tmpX<38){tmpL=(tmpD2.StrValueByIndex(";",tmpX)).ToInteger();if(((tmpC1.StrValueByIndex(";",tmpL)).StrValueByIndex("-",0)).ToInteger()>0){tmpK2=dom.GetObject(tmpE.StrValueByIndex(";",tmpL));if(tmpL==2){tmpP2=tmpI1.Year();}if(tmpL==4){tmpP2=tmpI1.Yearday();}if(tmpL==5){tmpP2=(tmpI1.Format("%V")).ToInteger();}if(tmpL==6){tmpP2=(tmpI1.Format("%U")).ToInteger();}if(tmpL==7){tmpP2=(tmpI1.Format("%W")).ToInteger();}if(tmpL==12){tmpP2=tmpA1.StrValueByIndex(";",(tmpK-1));}if(tmpL==13){tmpP2=tmpK;}if(tmpL==14){tmpP2=tmpI1.Day();}
if(tmpL==16){tmpP2=tmpS1.StrValueByIndex(";",tmpI);}if(tmpL==17){tmpP2=tmpJ;}if(tmpL==18){tmpP2=tmpI+1;}if(tmpL==19){tmpP2=tmpI;}if(tmpL==23){tmpP2=6-tmpJ;if(tmpP2<0){tmpP2=0;}}if(tmpL==24){tmpP2=7-tmpJ;}if(tmpL==32){tmpP2=tmpG;}if(tmpL==33){tmpP2=tmpH;}if(tmpL==34){tmpP2=tmpF;}if(tmpL==35){tmpP2=tmpP;}if(tmpL==36){tmpP2=tmpQ;}if(tmpL==37){tmpP2=tmpO;}if((tmpL==3)||(tmpL==8)||(tmpL==9)||(tmpL==10)||(tmpL==11)||(tmpL==15)||(tmpL==20)||(tmpL==21)||(tmpL==22)||(tmpL==25)||(tmpL==26)||(tmpL==27)||(tmpL==28)||(tmpL==29)||(tmpL==30)||(tmpL==31)||(tmpL==38)||(tmpL==39)){tmpM=2;tmpP2=0;
if(tmpL==3){if(tmpT1){tmpP2=1;}}if(tmpL==8){if(((tmpI1.Format("%V")).ToInteger()%2)==0){tmpP2=1;}}if(tmpL==9){if(((tmpI1.Format("%U")).ToInteger()%2)==0){tmpP2=1;}}if(tmpL==10){if(((tmpI1.Format("%W")).ToInteger()%2)==0){tmpP2=1;}}if(tmpL==11){tmpM=12;tmpP2=tmpK-1;}if(tmpL==15){tmpM=7;tmpP2=tmpJ-1;}if(tmpL==20){if((tmpJ==6)||(tmpJ==7)){tmpP2=1;}}if(tmpL==21){if((tmpJ==5)||(tmpJ==6)){tmpP2=1;}}if(tmpL==22){if((tmpJ==7)||(tmpJ==1)){tmpP2=1;}}if(tmpL==25){if((tmpJ<>6)&&(tmpJ<>7)){tmpP2=1;}}if(tmpL==26){if((tmpJ<>5)&&(tmpJ<>6)){tmpP2=1;}}if(tmpL==27){if((tmpJ<>1)&&(tmpJ<>7)){tmpP2=1;}}if(tmpL==28){if(tmpJ<>7){tmpP2=1;}}if(tmpL==29){if(tmpJ<>6){tmpP2=1;}}if(tmpL==30){if(tmpJ<>1){tmpP2=1;}}if(tmpL==31){if(tmpU1){tmpP2=1;}}
if(tmpL==38){tmpN=tmpI1.Year()-2000;tmpB1=tmpI1.Day();if((tmpK==1)||(tmpK==2)){tmpP2=3;}if(tmpK==3){tmpP2=0;tmpM=20;tmpE2="48;52;56;60;64;68;72;76;80;81;84;85;88;89;92;93;96;97";foreach(tmpF1,tmpE2.Split(";")){if(tmpN==tmpF1.ToInteger()){tmpM=19;}}tmpE2="3;7;11";foreach(tmpF1,tmpE2.Split(";")){if(tmpN==tmpF1.ToInteger()){
tmpM=21;}}if(tmpB1<tmpM){tmpP2=3;}}if((tmpK==4)||(tmpK==5)){tmpP2=0;}if(tmpK==6){tmpP2=1;tmpM=21;tmpE2="20;24;28;32;36;40;44;48;49;52;53;56;57;60;61;64;65;68;69;72;73;76;77;78;80;81;82;84;85;86;88;89;90;92;93;94;96;97;98";foreach(tmpF1,tmpE2.Split(";")){if(tmpN==tmpF1.ToInteger()){tmpM=20;}}if(tmpB1<tmpM){tmpP2=0;}}
if((tmpK==7)||(tmpK==8)){tmpP2=1;}if(tmpK==9){tmpP2=2;tmpM=22;tmpE2="1;2;3;5;6;7;10;11;14;15;18;19;22;23;26;27;30;31;34;35;38;39;43;47;51;55;59;63;67";foreach(tmpF1,tmpE2.Split(";")){if(tmpN==tmpF1.ToInteger()){tmpM=23;}}if(tmpB1<tmpM){tmpP2=1;}}if((tmpK==10)||(tmpK==11)){tmpP2=2;}if(tmpK==12){tmpP2=3;tmpM=21;tmpE2="84;88;92;96";
foreach(tmpF1,tmpE2.Split(";")){if(tmpN==tmpF1.ToInteger()){tmpM=20;}}tmpE2="2;3;6;7;10;11;14;15;19;23;27;31;35;39;43;47";foreach(tmpF1,tmpE2.Split(";")){if(tmpN==tmpF1.ToInteger()){tmpM=22;}}if(tmpB1<tmpM){tmpP2=2;}}tmpM=4;}
if(tmpL==39){tmpM=4;tmpN=(tmpI1.Month()*100)+tmpI1.Day();tmpP2=3;if((tmpN>=301)&&(tmpN<601)){tmpP2=0;}if((tmpN>=601)&&(tmpN<901)){tmpP2=1;}if((tmpN>=901)&&(tmpN<1201)){tmpP2=2;}}if(tmpK2.ValueType()==ivtInteger){if((web.webGetValueListCount(tmpK2.ValueList())).ToInteger()>tmpM){tmpP2=tmpP2+1;}}}tmpK2.State(tmpP2);}tmpX=tmpX+1;}
if(((tmpC1.StrValueByIndex(";",31)).StrValueByIndex("-",0)).ToInteger()>0){tmpK2=dom.GetObject(tmpE.StrValueByIndex(";",31));tmpL=0;tmpM=(tmpD1.Hour()*3600)+(tmpD1.Minute()*60)+tmpD1.Second();tmpV1=false;tmpW1=false;tmpA2=("1970-01-02 00:00:00").ToTime();if(((tmpG==0)&&(tmpU1==false))||((tmpG==1)&&(tmpM>7200))){tmpV1=true;tmpW1=true;
if(tmpG==0){tmpL=7200-tmpM;}else{tmpL=93600-tmpM;}tmpA2=tmpA2+tmpL;}if(((tmpH==0)&&(tmpU1))||((tmpH==1)&&(tmpM>10800))){tmpV1=true;if(tmpH==0){tmpL=10800-tmpM;}else{tmpL=97200-tmpM;}tmpA2=tmpA2+tmpL;}if(tmpV1){tmpL=0;if(tmpW1){tmpL=1;}if(tmpK2.ValueType()==ivtInteger){if((web.webGetValueListCount(tmpK2.ValueList())).ToInteger()>2){tmpL=tmpL+1;}}
tmpL2=dom.CreateObject(OT_PROGRAM);tmpL2.Name("AutoCreateTrigger");tmpM2=tmpL2.Rule();tmpN2=tmpM2.RuleDestination();tmpN2.BreakOnRestart(true);tmpO2=tmpN2.DestAddSingle();tmpO2.DestinationParam(19);tmpO2.DestinationDP(tmpK2.ID());tmpO2.DestinationValueType(tmpK2.ValueType());tmpO2.DestinationValue(tmpL);tmpO2.DestinationValueParamType(ivtDelay);tmpO2.DestinationValueParam(tmpA2.ToString());tmpL2.ProgramExecute();dom.DeleteObject(tmpL2.ID());}}

if(((tmpC1.StrValueByIndex(";",1)).StrValueByIndex("-",0)).ToInteger()>0){tmpO="";tmpK2=dom.GetObject(tmpE.StrValueByIndex(";",1));if(tmpK2.ValueType()==ivtString){tmpO=tmpK2.Value();}else{if((tmpK2.ValueType()==ivtInteger)&&(tmpK2.ValueSubType()==istEnum)){tmpO=(tmpK2.ValueList()).StrValueByIndex(";",tmpK2.Value());}}}else{tmpO=tmpA;}if(tmpO==""){tmpQ="";tmpR="";tmpS="";}else{tmpF=tmpO.Find("-");if(tmpF>=0){tmpQ=tmpO.Substr(0,tmpF);tmpP=tmpO.Substr(tmpF+1,((tmpO.Length()-1)-tmpF));tmpG=tmpP.Find("-");if(tmpG>=0){tmpR=tmpO.Substr(0,tmpF+tmpG+1);tmpS=tmpO;}else{tmpR=tmpO;tmpS="";}}else{tmpQ=tmpO;tmpR="";tmpS="";}}
tmpK1=tmpK1#";01.01.";tmpL1=tmpL1#";Neujahr,Neujahrstag,01.01.";if((tmpQ=="A")||(tmpR=="D-BW")||(tmpR=="D-BY")){tmpM1=tmpM1#";0";}else{tmpM1=tmpM1#";1";}if((tmpQ=="D")||(tmpQ=="A")||(tmpQ=="CH")){tmpN1=tmpN1#";0";}
tmpK1=tmpK1#";02.01.";tmpL1=tmpL1#";Berchtoldstag,02.01.";tmpM1=tmpM1#";-1";if((tmpR=="CH-BE")||(tmpR=="CH-TG")||(tmpR=="CH-VD")||(tmpR=="CH-JU")||(tmpR=="CH-FR")||(tmpR=="CH-GE")||(tmpR=="CH-GL")||(tmpR=="CH-LU")||(tmpR=="CH-OW")||(tmpR=="CH-SH")||(tmpR=="CH-SO")||(tmpR=="CH-ZG")||(tmpR=="CH-ZH")){tmpN1=tmpN1#";1";}
tmpK1=tmpK1#";06.01.";tmpL1=tmpL1#";Heilige Drei Könige,Erscheinungsfest,06.01.";if(tmpR=="D-BW"){tmpM1=tmpM1#";1";}else{tmpM1=tmpM1#";0";}if((tmpQ=="A")||(tmpR=="D-BW")||(tmpR=="D-BY")||(tmpR=="D-ST")||(tmpR=="CH-TI")||(tmpR=="CH-SZ")||(tmpR=="CH-UR")){tmpN1=tmpN1#";2";}tmpK1=tmpK1#";14.02.";tmpL1=tmpL1#";Valentinstag,14.02.";tmpM1=tmpM1#";-1";
tmpK1=tmpK1#";19.03.";tmpL1=tmpL1#";Josefstag,19.03.";tmpM1=tmpM1#";-1";if((tmpR=="CH-SZ")||(tmpR=="CH-VS")||(tmpR=="CH-NW")||(tmpR=="CH-TI")||(tmpR=="CH-UR")){tmpN1=tmpN1#";4";}
tmpK1=tmpK1#";01.05.";tmpL1=tmpL1#";Erster Mai,Tag der Arbeit,Maifeiertag,Staatsfeiertag,01.05.";if((tmpQ=="CH")||(tmpR=="D-BY")||(tmpR=="D-SN")){tmpM1=tmpM1#";1";}else{if(tmpQ=="A"){tmpM1=tmpM1#";3";}else{tmpM1=tmpM1#";0";}}if((tmpQ=="D")||(tmpQ=="A")||(tmpR== "CH-BL")||(tmpR=="CH-BS")||(tmpR=="CH-JU")||(tmpR=="CH-NE")||(tmpR=="CH-ZH")||(tmpR== "CH-SH")||(tmpR=="CH-TG")||(tmpR=="CH-TI")){tmpN1=tmpN1#";5";}
tmpK1=tmpK1#";04.05.";tmpL1=tmpL1#";Florian,04.05.";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";24.06.";tmpL1=tmpL1#";Johannistag,24.06.";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";01.08.";tmpL1=tmpL1#";Bundesfeier,01.08.";tmpM1=tmpM1#";-1";if(tmpQ=="CH"){tmpN1=tmpN1#";8";}tmpK1=tmpK1#";08.08.";tmpL1=tmpL1#";Augsburger Hohe Friedensfest,Augsburger Friedensfest,08.08.";tmpM1=tmpM1#";-1";if(tmpS=="D-BY-A"){tmpN1=tmpN1#";9";}
tmpK1=tmpK1#";15.08.";tmpL1=tmpL1#";Mariä Himmelfahrt,Maria Himmelsfahrtstag,15.08.";if(tmpR=="D-SL"){tmpM1=tmpM1#";1";}else{tmpM1=tmpM1#";0";}if((tmpQ=="A")||(tmpR=="D-SL")||(tmpS=="D-BY-A")||(tmpS=="D-BY-1")||(tmpR=="CH-LU")||(tmpR=="CH-NW")||(tmpR=="CH-OW")||(tmpR=="CH-SZ")||(tmpR=="CH-TI")||(tmpR=="CH-UR")||(tmpR=="CH-VS")||(tmpR=="CH-ZG")||(tmpR=="CH-AI")||(tmpR=="CH-JU")){tmpN1=tmpN1#";10";}
tmpK1=tmpK1#";24.09.";tmpL1=tmpL1#";Rupert,Rupertikirtag,24.09.";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";29.09.";tmpL1=tmpL1#";Michaelistag,29.09.";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";03.10.";tmpL1=tmpL1#";Tag der deutschen Einheit,03.10.";tmpM1=tmpM1#";-1";if(tmpQ=="D"){tmpN1=tmpN1#";13";}tmpK1=tmpK1#";10.10.";tmpL1=tmpL1#";Tag der Volksabstimmung,10.10.";tmpM1=tmpM1#";-1";
tmpK1=tmpK1#";26.10.";tmpL1=tmpL1#";Nationalfeiertag,26.10.";tmpM1=tmpM1#";-1";if(tmpQ=="A"){tmpN1=tmpN1#";15";}tmpK1=tmpK1#";31.10.";tmpL1=tmpL1#";Reformationstag,Reformationsfest,Halloween,31.10.";if((tmpR=="D-BB")||(tmpR=="D-SN")){tmpM1=tmpM1#";1";}else{tmpM1=tmpM1#";0";}if((tmpR=="D-BB")||(tmpR=="D-MV")||(tmpR=="D-SN")||(tmpR=="D-ST")||(tmpR=="D-TH")){tmpN1=tmpN1#";15";}
tmpK1=tmpK1#";01.11.";tmpL1=tmpL1#";Allerheiligen,Allerheiligentag,01.11.";if((tmpR=="D-NW")||(tmpR=="D-RP")||(tmpR=="D-SL")){tmpM1=tmpM1#";1";}else{tmpM1=tmpM1#";0";}if((tmpQ=="A")||(tmpR=="D-BW")||(tmpR=="D-BY")||(tmpR=="D-NW")||(tmpR=="D-RP")||(tmpR=="D-SL")||(tmpR=="CH-GL")||(tmpR=="CH-LU")||(tmpR=="CH-NW")||(tmpR=="CH-OW")||(tmpR=="CH-SG")||(tmpR=="CH-SZ")||(tmpR=="CH-TI")||(tmpR=="CH-UR")||(tmpR=="CH-VS")||(tmpR=="CH-ZG")||(tmpR=="CH-AI")||(tmpR=="CH-JU")){tmpN1=tmpN1#";17";}
tmpK1=tmpK1#";02.11.";tmpL1=tmpL1#";Allerseelen,Seelentag,02.11.";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";11.11.";tmpL1=tmpL1#";Martinstag,Sankt Martin,11.11.";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";15.11.";tmpL1=tmpL1#";Leopold,15.11.";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";06.12.";tmpL1=tmpL1#";Nikolaus,Nikolaustag,06.12.";tmpM1=tmpM1#";-1";
tmpK1=tmpK1#";08.12.";tmpL1=tmpL1#";Mariä Empfängnis,08.12.";tmpM1=tmpM1#";-1";if((tmpQ=="A")||(tmpR=="CH-NW")||(tmpR=="CH-OW")||(tmpR=="CH-UR")||(tmpR=="CH-VS")||(tmpR=="CH-ZG")||(tmpR=="CH-AI")||(tmpR=="CH-LU")||(tmpR=="CH-SZ")||(tmpR=="CH-TI")){tmpN1=tmpN1#";22";}tmpK1=tmpK1#";24.12.";tmpL1=tmpL1#";Heiliger Abend,Heilig Abend,24.12.";tmpM1=tmpM1#";-1";
tmpK1=tmpK1#";25.12.";tmpL1=tmpL1#";1. Weihnachtstag,Erster Weihnachtstag,1. Weihnachtsfeiertag,Erster Weihnachtsfeiertag,Christtag,Weihnachtstag,Weihnachten,25.12.";if((tmpR=="D-BW")||(tmpR=="D-BY")||(tmpR=="D-BE")){tmpM1=tmpM1#";1";}else{if((tmpR=="D-BB")||(tmpR=="D-ST")){tmpM1=tmpM1#";2";}else{if(tmpR=="D-TH"){tmpM1=tmpM1#";3";}else{if(tmpQ=="A"){tmpM1=tmpM1#";4";}else{if(tmpQ=="CH"){tmpM1=tmpM1#";5";}else{tmpM1=tmpM1#";0";}}}}}if((tmpQ=="D")||(tmpQ=="A")||(tmpQ=="CH")){tmpN1=tmpN1#";24";}
tmpK1=tmpK1#";26.12.";tmpL1=tmpL1#";2. Weihnachtstag,Zweiter Weihnachtstag,2. Weihnachtsfeiertag,Zweiter Weihnachtsfeiertag,Stefanitag,Stefanstag,26.12.";if((tmpR=="D-BW")||(tmpR=="D-BY")||(tmpR=="D-BE")){tmpM1=tmpM1#";1";}else{if((tmpR=="D-BB")||(tmpR=="D-ST")){tmpM1=tmpM1#";2";}else{if(tmpR=="D-TH"){tmpM1=tmpM1#";3";}else{if(tmpQ=="A"){tmpM1=tmpM1#";4";}else{if(tmpQ=="CH"){tmpM1=tmpM1#";5";}else{tmpM1=tmpM1#";0";}}}}}if((tmpQ=="D")||(tmpQ=="A")||(tmpR=="CH-BE")||(tmpR=="CH-BL")||(tmpR=="CH-BS")||(tmpR=="CH-GL")||(tmpR=="CH-GR")||(tmpR=="CH-LU")||(tmpR=="CH-SG")||(tmpR=="CH-SH")||(tmpR=="CH-TG")||(tmpR=="CH-TI")||(tmpR=="CH-ZH")||(tmpR=="CH-SZ")||(tmpR=="CH-FR")||(tmpR=="CH-NW")||(tmpR=="CH-OW")||(tmpR=="CH-ZG")){tmpN1=tmpN1#";25";}
tmpK1=tmpK1#";31.12.";tmpL1=tmpL1#";Sylvester,31.12.";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";OS-52";tmpL1=tmpL1#";Weiberfastnacht";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";OS-49";tmpL1=tmpL1#";Faschingssonntag";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";OS-48";tmpL1=tmpL1#";Rosenmontag";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";OS-47";tmpL1=tmpL1#";Faschingsdienstag";tmpM1=tmpM1#";-1";
tmpK1=tmpK1#";OS-46";tmpL1=tmpL1#";Aschermittwoch";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";OS-7";tmpL1=tmpL1#";Palmsonntag";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";OS-3";tmpL1=tmpL1#";Gründonnerstag";tmpM1=tmpM1#";-1";
tmpK1=tmpK1#";OS-2";tmpL1=tmpL1#";Karfreitag";tmpM1=tmpM1#";-1";if((tmpQ=="D")||(tmpR=="A-1")||(tmpR=="CH-AG")||(tmpR=="CH-AI")||(tmpR=="CH-AR")||(tmpR=="CH-BE")||(tmpR=="CH-BL")||(tmpR=="CH-BS")||(tmpR=="CH-FR")||(tmpR=="CH-GE")||(tmpR=="CH-GL")||(tmpR=="CH-GR")||(tmpR=="CH-JU")||(tmpR=="CH-LU")||(tmpR=="CH-NE")||(tmpR=="CH-NW")||(tmpR=="CH-OW")||(tmpR=="CH-SG")||(tmpR=="CH-SH")||(tmpR=="CH-SO")||(tmpR=="CH-SZ")||(tmpR=="CH-TG")||(tmpR=="CH-UR")||(tmpR=="CH-VD")||(tmpR=="CH-ZG")||(tmpR=="CH-ZH")){tmpN1=tmpN1#";34";}
tmpK1=tmpK1#";OS-1";tmpL1=tmpL1#";Ostersamstag,Karsamstag";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";OS+0";tmpL1=tmpL1#";Ostersonntag,OS+0";tmpM1=tmpM1#";-1";if(tmpR=="D-BB"){tmpN1=tmpN1#";36";}
tmpK1=tmpK1#";OS+1";tmpL1=tmpL1#";Ostermontag";tmpM1=tmpM1#";-1";if((tmpQ=="D")||(tmpQ=="A")||(tmpR=="CH-AI")||(tmpR=="CH-AR")||(tmpR=="CH-BE")||(tmpR=="CH-BL")||(tmpR=="CH-BS")||(tmpR=="CH-GE")||(tmpR=="CH-GL")||(tmpR=="CH-GR")||(tmpR=="CH-JU")||(tmpR=="CH-SG")||(tmpR=="CH-SH")||(tmpR=="CH-TG")||(tmpR=="CH-TI")||(tmpR=="CH-VD")||(tmpR=="CH-ZH")||(tmpR=="CH-SZ")||(tmpR=="CH-UR")||(tmpR=="CH-FR")||(tmpR=="CH-LU")||(tmpR=="CH-NE")||(tmpR=="CH-NW")||(tmpR=="CH-OW")||(tmpR=="CH-ZG")){tmpN1=tmpN1#";37";}
tmpK1=tmpK1#";OS+39";tmpL1=tmpL1#";Christi Himmelfahrt,Christi Himmelfahrtstag,Christi-Himmelfahrtstag,Christi-Himmelfahrts-Tag,Himmelfahrtstag,Auffahrt,Vatertag";if(tmpR=="D-BB"){tmpM1=tmpM1#";1";}else{if(tmpR=="D-MV"){tmpM1=tmpM1#";2";}else{if(tmpR=="D-NW"){tmpM1=tmpM1#";3";}else{if((tmpR=="D-BE")||(tmpR=="D-HB")||(tmpR=="D-HE")||(tmpR=="D-HH")||(tmpR=="D-NI")||(tmpR=="D-SH")){tmpM1=tmpM1#";4";}else{if(tmpQ=="CH"){tmpM1=tmpM1#";5";}else{tmpM1=tmpM1#";0";}}}}}if((tmpQ=="D")||(tmpQ=="A")||(tmpQ=="CH")){tmpN1=tmpN1#";38";}
tmpK1=tmpK1#";OS+49";tmpL1=tmpL1#";Pfingstsonntag";tmpM1=tmpM1#";-1";if(tmpR=="D-BB"){tmpN1=tmpN1#";39";}
tmpK1=tmpK1#";OS+50";tmpL1=tmpL1#";Pfingstmontag";tmpM1=tmpM1#";-1";if((tmpQ=="D")||(tmpQ=="A")||(tmpR=="CH-AI")||(tmpR=="CH-AR")||(tmpR=="CH-BE")||(tmpR=="CH-BL")||(tmpR=="CH-BS")||(tmpR=="CH-GE")||(tmpR=="CH-GR")||(tmpR=="CH-JU")||(tmpR=="CH-SG")||(tmpR=="CH-SH")||(tmpR=="CH-TG")||(tmpR=="CH-VD")||(tmpR=="CH-ZH")||(tmpR=="CH-GL")||(tmpR=="CH-SZ")||(tmpR=="CH-TI")||(tmpR=="CH-UR")||(tmpR=="CH-FR")||(tmpR=="CH-LU")||(tmpR=="CH-NE")||(tmpR=="CH-NW")||(tmpR=="CH-OW")||(tmpR=="CH-ZG")){tmpN1=tmpN1#";40";}
tmpK1=tmpK1#";OS+56";tmpL1=tmpL1#";Dreieinigkeit,Trinitatis";tmpM1=tmpM1#";-1";
tmpK1=tmpK1#";OS+60";tmpL1=tmpL1#";Fronleichnam,Fronleichnamstag";if((tmpR=="D-HE")||(tmpR=="D-NW")||(tmpR=="D-RP")||(tmpR=="D-SL")){tmpM1=tmpM1#";1";}else{tmpM1=tmpM1#";0";}if((tmpQ=="A")||(tmpR=="D-BW")||(tmpR=="D-BY")||(tmpR=="D-HE")||(tmpR=="D-NW")||(tmpR=="D-RP")||(tmpR=="D-SL")||(tmpS=="D-SN-1")||(tmpS=="D-TH-1")||(tmpR=="CH-AI")||(tmpR=="CH-JU")||(tmpR=="CH-LU")||(tmpR=="CH-NW")||(tmpR=="CH-OW")||(tmpR=="CH-SZ")||(tmpR=="CH-UR")||(tmpR=="CH-VS")||(tmpR=="CH-ZG")||(tmpR=="CH-TI")){tmpN1=tmpN1#";42";}
tmpK1=tmpK1#";OS+68";tmpL1=tmpL1#";Herz-Jesu-Freitag";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";AD-14";tmpL1=tmpL1#";Volkstrauertag";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";AD-11";tmpL1=tmpL1#";Buß- und Bettag";tmpM1=tmpM1#";-1";if(tmpR=="D-SN"){tmpN1=tmpN1#";45";}tmpK1=tmpK1#";AD-7";tmpL1=tmpL1#";Totensonntag,Ewigkeitssonntag";tmpM1=tmpM1#";-1";
tmpK1=tmpK1#";AD+0";tmpL1=tmpL1#";1. Advent";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";AD+7";tmpL1=tmpL1#";2. Advent";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";AD+14";tmpL1=tmpL1#";3. Advent";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";AD+21";tmpL1=tmpL1#";4. Advent";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";MT+0";tmpL1=tmpL1#";Muttertag";tmpM1=tmpM1#";-1";tmpK1=tmpK1#";ED+0";tmpL1=tmpL1#";Erntedankfest,ED+0";tmpM1=tmpM1#";-1";
tmpJ1=52;if(tmpK1.Find(";")==0){tmpK1=tmpK1.Substr(1,(tmpK1.Length()-1));}if(tmpL1.Find(";")==0){tmpL1=tmpL1.Substr(1,(tmpL1.Length()-1));}if(tmpM1.Find(";")==0){tmpM1=tmpM1.Substr(1,(tmpM1.Length()-1));}if(tmpN1.Find(";")==0){tmpN1=tmpN1.Substr(1,(tmpN1.Length()-1));}
tmpD2="41;40;61;81;101";tmpE2="-1;1;2;3;4";tmpX=0;while(tmpX<5){tmpF=(tmpD2.StrValueByIndex(";",tmpX)).ToInteger();if(((tmpC1.StrValueByIndex(";",tmpF)).StrValueByIndex("-",0)).ToInteger()>0){tmpO="";tmpK2=dom.GetObject(tmpE.StrValueByIndex(";",tmpF));

if(tmpK2.ValueType()==ivtString){tmpO=tmpK2.Value();}else{if((tmpK2.ValueType()==ivtInteger)&&(tmpK2.ValueSubType()==istEnum)){tmpO=tmpK2.ValueList();}}if((tmpO.Length()>1)&&(tmpO<>"00.00.")){tmpF1="";foreach(tmpF1,tmpO.Split(";")){tmpP="";tmpQ="";tmpR="";tmpG=-1;tmpT1=false;
if(tmpF1.Find("=")>=0){tmpR=tmpF1.StrValueByIndex("=",0);tmpQ=tmpF1.StrValueByIndex("=",1);tmpT1=true;}else{tmpR=tmpF1;}tmpP=tmpR;if(tmpT1==false){tmpY=0;foreach(tmpG1,tmpL1.Split(";")){foreach(tmpH1,tmpG1.Split(",")){if(tmpH1==tmpR){tmpG=tmpY;}}tmpY=tmpY+1;}}tmpH=(tmpE2.StrValueByIndex(";",tmpX)).ToInteger();
if(tmpH>=0){if((tmpP<>"")||(tmpG>=0)){if(tmpG==-1){tmpJ1=tmpJ1+1;tmpG=tmpJ1;if(tmpK1<>""){tmpK1=tmpK1#";";}tmpK1=tmpK1#tmpP;if(tmpQ==""){tmpQ=tmpC;}if(tmpL1<>""){tmpL1=tmpL1#";";}tmpL1=tmpL1#tmpQ#","#tmpP;if(tmpM1<>""){tmpM1=tmpM1#";";}tmpM1=tmpM1#"-1";}if(tmpH==1){if(tmpN1<>""){tmpN1=tmpN1#";";}tmpN1=tmpN1#tmpG.ToString(0);}if(tmpH==2){
if(tmpO1<>""){tmpO1=tmpO1#";";}tmpO1=tmpO1#tmpG.ToString(0);}if(tmpH==3){if(tmpP1<>""){tmpP1=tmpP1#";";}tmpP1=tmpP1#tmpG.ToString(0);}if(tmpH==4){if(tmpQ1<>""){tmpQ1=tmpQ1#";";}tmpQ1=tmpQ1#tmpG.ToString(0);}}}else{if(tmpG>=0){tmpT=tmpG.ToString(0);tmpF2="";foreach(tmpG1,tmpN1.Split(";")){if(tmpG1<>tmpT){if(tmpF2<>""){tmpF2=tmpF2#";";}tmpF2=tmpF2#tmpG1;}}tmpN1=tmpF2;}}}}}tmpX=tmpX+1;}

tmpD2="1;1;1;1;1;1;1;1;1;1;2;2;2;2;2;2;2;2;2;2;3;3;3;3;3;3;3;3;3;3;4;4;4;4;4;5;5;5;5;5;6;7;8;9";tmpE2="316;321;326;331;336;341;346;351;356;361;438;444;450;456;462;468;474;480;486;492;368;375;382;389;396;403;410;417;424;431;138;155;172;189;206;227;244;261;278;295;41;61;81;101";tmpF2=(tmpI1+172800).Format("%Y%m%d")#";"#(tmpI1+86400).Format("%Y%m%d")#";"#tmpI1.Format("%Y%m%d")#";"#(tmpI1-86400).Format("%Y%m%d")#";"#(tmpI1-172800).Format("%Y%m%d");
tmpP="";tmpX=0;while(tmpX<44){if((tmpX==10)||(tmpX==20)||(tmpX==30)||(tmpX==35)||(tmpX==40)){tmpP="";}tmpT1=false;tmpU1=true;tmpF=(tmpD2.StrValueByIndex(";",tmpX)).ToInteger();tmpG=(tmpE2.StrValueByIndex(";",tmpX)).ToInteger();tmpG2="";tmpH2="";tmpI2="";tmpJ2="";
if(tmpF<>6){if(((tmpC1.StrValueByIndex(";",tmpG)).StrValueByIndex("-",0)).ToInteger()==0){tmpU1=false;}}if(tmpU1){tmpO="";if((tmpF==1)||(tmpF==2)||(tmpF==3)||(tmpF==4)||(tmpF==5)){tmpK2=dom.GetObject(tmpE.StrValueByIndex(";",tmpG));if(tmpK2.ValueType()==ivtString){tmpO=tmpK2.Value();}else{
if((tmpK2.ValueType()==ivtInteger)&&(tmpK2.ValueSubType()==istEnum)){tmpO=tmpK2.ValueList();}else{tmpT1=true;}}if(tmpO.Length()<4){tmpU1=false;}}else{if(tmpF==6){tmpO=tmpN1;}if(tmpF==7){tmpO=tmpO1;}if(tmpF==8){tmpO=tmpP1;}if(tmpF==9){tmpO=tmpQ1;}if(tmpO==""){tmpU1=false;}}if((tmpT1==false)&&(tmpU1)){tmpF1="";
foreach(tmpF1,tmpO.Split(";")){tmpU1=true;tmpI=0;tmpJ=0;tmpQ="";tmpR="";tmpS="";if((tmpF==1)||(tmpF==2)||(tmpF==3)||(tmpF==4)||(tmpF==5)){tmpU=tmpF1;}else{tmpQ=tmpF1;tmpU=tmpK1.StrValueByIndex(";",(tmpQ.ToInteger()));}tmpT="";if(tmpU.Find("=")>=0){tmpT=tmpU.StrValueByIndex("=",0);tmpQ=tmpU.StrValueByIndex("=",1);
if((tmpF<>4)&&(tmpF<>5 )){tmpU1=false;}}else{tmpT=tmpU;}if(tmpT.Find(",")>=0){tmpR=tmpT.StrValueByIndex(",",0);tmpS=tmpT.StrValueByIndex(",",1);tmpG=2;if((tmpF<>3)&&(tmpF<>4)&&(tmpF<>5)){tmpU1=false;}}else{tmpR=tmpT;tmpG=1;}tmpV1=false;tmpW1=false;if(tmpU1){tmpY=1;while(tmpY<=tmpG){tmpU1=false;tmpX1=true;tmpY1=false;
if(tmpY==1){tmpT=tmpR;}else{tmpT=tmpS;}if(tmpT.Length()>=6){if((tmpT.Substr(2,1)==".")&&(tmpT.Substr(5,1)==".")){tmpX1=false;if((tmpT.Length()==6)||(tmpT.Length()==8)||(tmpT.Length()==10)){tmpU1=true;tmpU=tmpT.Substr(3,2)#tmpT.Substr(0,2);if(tmpT.Length()==10){tmpU=tmpT.Substr(6,4)#tmpU;}else{
if(tmpT.Length()==8){tmpU=(tmpI1.Format("%Y")).Substr(0,2)#tmpT.Substr(6,2)#tmpU;}else{tmpU=tmpI1.Format("%Y")#tmpU;tmpY1=true;}}if(tmpY==1){tmpR=tmpU;}else{tmpS=tmpU;}}}}if(tmpX1){tmpU=tmpT.Substr(0,3);
if((tmpU=="TD+")||(tmpU=="TD-")||(tmpU=="OS+")||(tmpU=="OS-")||(tmpU=="AD+")||(tmpU=="AD-")||(tmpU=="MT+")||(tmpU=="MT-")||(tmpU=="ED+")||(tmpU=="ED-")){tmpU1=true;if(tmpT.Find(".")>=0){tmpU=tmpT.StrValueByIndex(".",0);tmpV=tmpT.StrValueByIndex(".",1);if((tmpU.Length()>=4)&& ((tmpV.Length()==2)||(tmpV.Length()==4))){
if(tmpV.Length()==2){tmpT=tmpU#"."#(tmpI1.Format("%Y")).Substr(0,2)#tmpV;}}else{tmpU1=false;}}else{tmpU=tmpT;tmpT=tmpU#"."#tmpI1.Format("%Y");tmpY1=true;}if(tmpU1){tmpU=tmpU.Substr(3,(tmpU.Length()-3))#tmpT.Substr((tmpT.Length()-4),4);if(tmpY==1){tmpR=tmpT;}else{tmpS=tmpT;}}}else{tmpU1=false;}}if(tmpU1){
tmpZ=tmpU.Length()-1;while(tmpZ>=0){tmpT=tmpU.Substr(tmpZ,1);if((tmpT<>"0")&&(tmpT<>"1")&&(tmpT<>"2")&&(tmpT<>"3")&&(tmpT<>"4")&&(tmpT<>"5")&&(tmpT<>"6")&&(tmpT<>"7")&&(tmpT<>"8")&&(tmpT<>"9")){tmpU1=false;tmpZ=0;}tmpZ=tmpZ-1;}}if((tmpU1) && (tmpX1 == false)){tmpK=(tmpU.Substr(6,2)).ToInteger();tmpL=(tmpU.Substr(4,2)).ToInteger();
if((tmpK<1)||(tmpK>31)||(tmpL<1)||(tmpL>12)||((tmpK>30)&&((tmpL==4)||(tmpL==6)||(tmpL==9)||(tmpL==11)))||((tmpL==2)&&(tmpK>29))){tmpU1=false;}else{if((tmpK==29)&&(tmpL==2)&&(tmpY1==false)){tmpA2=(tmpU.Substr(0,4)#"-"#tmpU.Substr(4,2)#"-"#tmpU.Substr(6,2)#" 06:00:00").ToTime();if(tmpA2.Format("%F")=="1970-01-01"){
tmpU1=false;}}}}if(tmpU1){if(tmpY==1){tmpV1=tmpY1;}else{tmpW1=tmpY1;}}else{tmpY=tmpG;}tmpY=tmpY+1;}}if(tmpU1){tmpY=1;while(tmpY<=tmpG){if(tmpY==1){tmpT=tmpR;tmpY1=tmpV1;}else{tmpT=tmpS;tmpY1=tmpW1;}tmpK=1;while(tmpK<>0){if(tmpK<>1){tmpX1=false;tmpU=tmpT.Substr(0,1);if((tmpU=="T")||(tmpU=="O")||(tmpU=="M")||(tmpU=="E")||(tmpU=="A")){tmpX1=true;}}
if(tmpX1){tmpU=tmpT.Substr((tmpT.Length()-4),4);if(tmpT.Substr(0,2)=="TD"){tmpB2=(tmpU#"-"#tmpI1.Format("%m")#"-"#tmpI1.Format("%d")#" 06:00:00").ToTime();if(tmpB2.Format("%F")=="1970-01-01"){tmpB2=(tmpU#"-02-28 06:00:00").ToTime();}}if(tmpT.Substr(0,2)=="OS"){tmpL=tmpU.ToInteger();tmpM=((19*(tmpL%19))+(15+(((3*(tmpL/100))+3)/4)-(((8*(tmpL/100))+13)/25)))%30;tmpM=tmpM-((tmpM/29)+(((tmpM/28)-(tmpM/29))*((tmpL%19)/11)));
tmpM=(21+tmpM)+(7-(((21+tmpM)-(7-((tmpL+(tmpL/4)+(2-(((3*(tmpL/100))+3)/4)))%7)))%7));tmpV=tmpU#"-";if(tmpM>31){tmpM=tmpM-31;tmpV=tmpV#"04-";}else{tmpV=tmpV#"03-";}if(tmpM<10){tmpV=tmpV#"0";}tmpB2=(tmpV#tmpM.ToString(0)#" 06:00:00").ToTime();}if(tmpT.Substr(0,2)=="AD"){tmpA2=(tmpU#"-12-25 06:00:00").ToTime();
tmpB2=tmpA2-(((tmpA2.Format("%u")).ToInteger()+21)*86400);}if(tmpT.Substr(0,2)=="MT"){tmpA2=(tmpU # "-05-01 06:00:00").ToTime();tmpB2=(tmpU # "-05-15 06:00:00").ToTime()-((tmpA2.Format("%u")).ToInteger()*86400);}if(tmpT.Substr(0,2)=="ED"){tmpA2=(tmpU#"-10-01 06:00:00").ToTime();
tmpB2=tmpA2+((7-(tmpA2.Format("%u")).ToInteger())*86400);}tmpL=1;if(tmpT.Substr(2,1)=="-"){tmpL=-1;}tmpM=(tmpT.Substr(3,(tmpT.Length()-8))).ToInteger()*86400;tmpA2=tmpB2 + (tmpM*tmpL);tmpT=tmpA2.Format("%Y%m%d");}
else{if((tmpT.Substr(4,4)=="0229")){tmpL=(tmpT.Substr(4,4)).ToInteger();tmpM=1;if((tmpK==2)||(tmpK==4)||(tmpK==9)||(tmpK==10)){tmpM=-1;}tmpZ1=true;while(tmpZ1){if((tmpL%400)==0){tmpZ1=false;}else{if((tmpL%100)==0){tmpZ1=true;}else{if((tmpL%4)==0){tmpZ1=false;}}}if(tmpZ1){tmpL=tmpL+tmpM;}}tmpT=tmpL.ToString(0)#"0229";}}
tmpL=tmpT.ToInteger();if((tmpY==1)||(tmpK==4)||(tmpK==7)||(tmpK==9)){tmpI=tmpL;}if((tmpG==1)||((tmpK==1)&&(tmpY==2))||(tmpK==5)||(tmpK==6)||(tmpK==8)||(tmpK==10)){tmpJ=tmpL;}if(tmpK==1){if(tmpY==1){if(tmpX1){tmpH=(tmpR.Substr((tmpR.Length()-4),4)).ToInteger();}else{tmpH=(tmpR.Substr(0,4)).ToInteger();}}else{if(tmpX1){tmpN=(tmpS.Substr((tmpS.Length()-4),4)).ToInteger();}else{tmpN=(tmpS.Substr(0,4)).ToInteger();}}}tmpM=(tmpF2.StrValueByIndex(";",2)).ToInteger();if(tmpG==1){if(tmpV1){if(tmpI>tmpM){if((tmpK==1)||(tmpK==2)){tmpK=2;tmpH=tmpH-1;}else{tmpK=1;}}else{if((tmpK==1)||(tmpK==3)){tmpK=3;tmpH=tmpH+1;}else
{tmpK=1;}}}else{tmpK=1;}}else{if(tmpY==2){if(tmpK==1){if((tmpV1)&&(tmpW1)){if(tmpI>tmpJ){tmpN=tmpN+1;tmpK=6;}else{if(tmpI<tmpM){tmpH=tmpH+1;tmpK=7;}else{tmpH=tmpH-1;tmpK=9;}}}else{if((tmpV1)||(tmpW1)){if(tmpV1){if(tmpI>tmpJ){tmpH=tmpH-1;tmpK=4;}}else{if(tmpI<tmpJ){tmpN=tmpN+1;tmpK=5;}}}else{if(tmpI>tmpJ){tmpU1=true;tmpK=0;}}}}else{if(tmpK==4){if(tmpI>tmpJ){tmpH=tmpH-1;}else{tmpK=1;}}if(tmpK==5){if(tmpI<tmpJ){tmpN=tmpN+1;}else{tmpK=1;}}if(tmpK==6){if(tmpI>tmpJ){tmpN=tmpN+1;}else{tmpK=8;}}if(tmpK==7){tmpN=tmpN+1;tmpK=8;}else{if(tmpK==8){if(tmpI<tmpM){tmpH=tmpH+1;tmpK=7;}else{tmpK=10;}}}if(tmpK==9){tmpN=tmpN-1;tmpK=10;}
else{if(tmpK==10){if(tmpJ>((tmpF2.StrValueByIndex(";",4)).ToInteger())){tmpH=tmpH-1;tmpK=9;}else{tmpK=1;}}}}}}if((tmpG==1)||((tmpY==2)&&(tmpK==1))||(tmpK==9)){if((tmpF==3)||(tmpF==4)||(tmpF==5)){if(tmpQ<>"1"){tmpG2=tmpG2#";"#tmpI.ToString(0);tmpH2=tmpH2#";"#tmpJ.ToString(0);}else{tmpI2=tmpI2#";"#tmpI.ToString(0);tmpJ2=tmpJ2#";"#tmpJ.ToString(0);}}else{tmpG2=tmpG2#";"#tmpI.ToString(0);tmpH2=tmpH2#";"#tmpJ.ToString(0);if((tmpF==6)||(tmpF==7)||(tmpF==8)||(tmpF==9)){tmpI2=tmpI2#";"#tmpQ;}}}if((tmpK==2)||(tmpK==3)||(tmpK==4)||(tmpK==7)||(tmpK==9)){tmpT=tmpR.Substr(0,1);if((tmpT=="T")||(tmpT=="O")||(tmpT=="M")||(tmpT=="E")||(tmpT=="A")){tmpT=tmpR.Substr(0,(tmpR.Length()-4))#tmpH.ToString(0);}
else{tmpT=tmpH.ToString(0)#tmpR.Substr(4,4);}tmpR=tmpT;}if((tmpK==5)||(tmpK==6)||(tmpK==8)||(tmpK==10)){tmpT=tmpS.Substr(0,1);if((tmpT=="T")||(tmpT=="O")||(tmpT=="M")||(tmpT=="E")||(tmpT=="A")){tmpT=tmpS.Substr(0,(tmpS.Length()-4))#tmpN.ToString(0);}else{tmpT=tmpN.ToString(0)#tmpS.Substr(4,4);}tmpS=tmpT;}if(tmpK==1){tmpK=0;}}tmpY=tmpY+1;}}if(tmpU1==false){tmpT1=true;}}if(tmpG2.Find(";")==0){tmpG2=tmpG2.Substr(1,(tmpG2.Length()-1));}if(tmpH2.Find(";")==0){tmpH2=tmpH2.Substr(1,(tmpH2.Length()-1));}if(tmpI2.Find(";")==0){tmpI2=tmpI2.Substr(1,(tmpI2.Length()-1));}if(tmpJ2.Find(";")==0){tmpJ2=tmpJ2.Substr(1,(tmpJ2.Length()-1));}tmpY=1;
while(tmpY<=3){if(tmpY==2){tmpG2=tmpI2;tmpH2=tmpJ2;}tmpI=(tmpF2.StrValueByIndex(";",0)).ToInteger();tmpJ=(tmpF2.StrValueByIndex(";",1)).ToInteger();tmpK=(tmpF2.StrValueByIndex(";",2)).ToInteger();tmpL=(tmpF2.StrValueByIndex(";",3)).ToInteger();tmpM=(tmpF2.StrValueByIndex(";",4)).ToInteger();tmpH=99999999;tmpU1=false;tmpV1=false;tmpW1=false;tmpX1=false;tmpY1=false;tmpZ1=false;tmpR="-1";tmpS="-1";tmpT="-1";tmpU="-1";tmpV="-1";tmpW="-1";if((tmpF==6)||(tmpF==7)||(tmpF==8)||(tmpF==9)){tmpZ1=true;}if((tmpY<3)&&(tmpG2.Length()>0)){tmpZ=0;foreach(tmpF1,tmpG2.Split(";")){tmpN=tmpF1.ToInteger();
tmpB1=(tmpH2.StrValueByIndex(";",tmpZ)).ToInteger();if((tmpN<=tmpI)&&(tmpB1>=tmpI)){tmpU1=true;if(tmpZ1){tmpR=tmpI2.StrValueByIndex(";",tmpZ);}}if((tmpN<=tmpJ)&&(tmpB1>=tmpJ)){tmpV1=true;if(tmpZ1){tmpS=tmpI2.StrValueByIndex(";",tmpZ);}}if((tmpN<=tmpK)&&(tmpB1>=tmpK)){tmpW1=true;if(tmpZ1){tmpT=tmpI2.StrValueByIndex(";",tmpZ);}}if((tmpN<=tmpL)&&(tmpB1>=tmpL)){tmpX1=true;if(tmpZ1){tmpU=tmpI2.StrValueByIndex(";",tmpZ);}}if((tmpN<=tmpM)&&(tmpB1>=tmpM)){tmpY1=true;if(tmpZ1){tmpV=tmpI2.StrValueByIndex(";",tmpZ);}}if((tmpF<>3)&&(tmpF<>4)&&(tmpF<>5)){
if((tmpN>=tmpK)&&(tmpN<tmpH)){tmpH=tmpN;if(tmpZ1){tmpW=tmpI2.StrValueByIndex(";",tmpZ);}}}tmpZ=tmpZ+1;}if((tmpF<>3)&&(tmpF<>4)&&(tmpF<>5)){tmpI=tmpH;}}if((tmpF==3)||(tmpF==4)||(tmpF==5)){tmpI=tmpH;if((tmpY<3)&&(tmpG2.Length()>0)){tmpE1=true;while(tmpE1){tmpE1=false;tmpZ=0;foreach(tmpF1,tmpG2.Split(";")){tmpN=tmpF1.ToInteger();tmpQ=tmpH2.StrValueByIndex(";",tmpZ);tmpB1=tmpQ.ToInteger();if(tmpH<>99999999){tmpQ=tmpH.ToString(0);tmpA2=((((tmpQ.Substr(0,4)#"-"#tmpQ.Substr(4,2)#"-"#tmpQ.Substr(6,2)#" 06:00:00").ToTime())-86400).Format("%F")#" 06:00:00").ToTime();tmpQ=tmpI.ToString(0);tmpB2=((((tmpQ.Substr(0,4)#"-"#tmpQ.Substr(4,2)#"-"#tmpQ.Substr(6,2)#" 06:00:00").ToTime())+86400).Format("%F")#" 06:00:00").ToTime();
if(((tmpN<=(tmpA2.Format("%Y%m%d")).ToInteger())&&(tmpB1>=(tmpA2.Format("%Y%m%d")).ToInteger()))||(tmpN==(tmpB2.Format("%Y%m%d")).ToInteger())||((tmpN>=(tmpA2.Format("%Y%m%d")).ToInteger())&&(tmpN<=(tmpB2.Format("%Y%m%d")).ToInteger()))){if(tmpN<tmpH){tmpH=tmpN;tmpE1=true;}if(tmpB1>tmpI){tmpI=tmpB1;tmpE1=true;}}else{if((tmpN<tmpH)&&(tmpN>=tmpK)){tmpH=tmpN;tmpI=tmpB1;tmpE1=true;}}}else{
if(tmpB1>=tmpK){tmpH=tmpN;tmpI=tmpB1;tmpE1=true;}}tmpZ=tmpZ+1;}}}}if(tmpZ1){tmpR=tmpR#";"#tmpS#";"#tmpT#";"#tmpU#";"#tmpV#";"#tmpW;}if(tmpY<>3){if(tmpU1){tmpP=tmpP#"1";}else{tmpP=tmpP#"0";}if(tmpV1){tmpP=tmpP#"1";}else{tmpP=tmpP#"0";}if(tmpW1){tmpP=tmpP#"1";}else{tmpP=tmpP#"0";}if(tmpX1){tmpP=tmpP#"1";}else{tmpP=tmpP#"0";}if(tmpY1){tmpP=tmpP#"1";}else{tmpP=tmpP#"0";}tmpP=tmpP#tmpH.ToString(0);}else{tmpJ=tmpP.Length();tmpZ=tmpJ-26;while(tmpZ<tmpJ){
if(tmpP.Substr(tmpZ,1)=="1"){tmpU1=true;}if(tmpP.Substr(tmpZ+1,1)=="1"){tmpV1=true;}if(tmpP.Substr(tmpZ+2,1)=="1"){tmpW1=true;}if(tmpP.Substr(tmpZ+3,1)=="1"){tmpX1=true;}if(tmpP.Substr(tmpZ+4,1)=="1"){tmpY1=true;}if(tmpH>(tmpP.Substr(tmpZ+5,8)).ToInteger()){tmpH=(tmpP.Substr(tmpZ+5,8)).ToInteger();}tmpZ=tmpZ+13;}tmpI=tmpH;}if(tmpF==1){tmpG2="0;2;1;0;0;4;3;0;0;0;0;0;0;0;0;0;0;0;0;0";}if(tmpF==2){tmpG2="0;2;1;3;0;5;4;0;0;0;0;0;0;0;0;0;0;0;0;0";}if(tmpF==3){tmpG2="0;2;1;3;0;6;4;5;0;0;0;0;0;0;0;0;0;0;0;0";}if((tmpF==4)||(tmpF==5)){
if(tmpY==1){tmpG2="0;6;5;7;0;10;8;9;0;0;0;0;0;0;0;0;0;0;0;0";}if(tmpY==2){tmpG2="0;12;11;13;0;16;14;15;0;0;0;0;0;0;0;0;0;0;0;0";}if(tmpY==3){tmpG2="0;2;1;3;0;0;4;0;0;0;0;0;0;0;0;0;0;0;0;0";}}if((tmpF==6)||(tmpF==7)||(tmpF==8)||(tmpF==9)){tmpG2="10;4;1;7;13;18;16;0;11;12;5;6;2;3;8;9;14;15;17;19";}tmpG=(tmpE2.StrValueByIndex(";",tmpX)).ToInteger();tmpZ=0;while(tmpZ<20){tmpJ=(tmpG2.StrValueByIndex(";",tmpZ)).ToInteger();if(tmpJ<>0){tmpP2=null;
if(((tmpC1.StrValueByIndex(";",tmpG+tmpJ)).StrValueByIndex("-",0)).ToInteger()>0){tmpK2=dom.GetObject(tmpE.StrValueByIndex(";",tmpG+tmpJ));if((tmpZ==0)||(tmpZ==1)||(tmpZ==2)||(tmpZ==3)||(tmpZ==4)){tmpP2=0;if(tmpZ==0){if(tmpU1){tmpP2=1;}}if(tmpZ==1){if(tmpV1){tmpP2=1;}}if(tmpZ==2){if(tmpW1){tmpP2=1;}}if(tmpZ==3){if(tmpX1){tmpP2=1;}}if(tmpZ==4){if(tmpY1){tmpP2=1;
}}if(tmpK2.ValueType()==ivtInteger){if((web.webGetValueListCount(tmpK2.ValueList())).ToInteger()>2){tmpP2=tmpP2+1;}}}if((tmpZ==5)||(tmpZ==6)||(tmpZ==7)){if(tmpH<>99999999){tmpQ=tmpH.ToString();tmpA2=(tmpQ.Substr(0,4)#"-"#tmpQ.Substr(4,2)#"-"#tmpQ.Substr(6,2)#" 06:00:00").ToTime();}if(tmpI<>99999999){tmpQ=tmpI.ToString();tmpB2=(tmpQ.Substr(0,4)#"-"#tmpQ.Substr(4,2)#"-"#tmpQ.Substr(6,2)#" 06:00:00").ToTime();}
if(tmpZ==5){tmpP2="";if(tmpH<>99999999){tmpP2=(tmpS1.StrValueByIndex(";",(tmpA2.Format("%w")).ToInteger()))#", "#tmpA2.Format("%d.%m.%Y");}if((tmpH<>tmpI)&&(tmpI<>99999999)&&((tmpF==3)||(tmpF==4)||(tmpF==5))){tmpP2=tmpP2#" - "#(tmpS1.StrValueByIndex(";",(tmpB2.Format("%w")).ToInteger()))#", "#tmpB2.Format("%d.%m.%Y");}}if(tmpZ==6){if(tmpW1){tmpP2=0;}
else{if(tmpV1){tmpP2=1;}else{if(tmpH==99999999){tmpP2=tmpK2.ValueMax();}else{tmpP2=(((tmpA2+86400)-tmpI1).ToInteger()/86400).ToInteger()-1;}}}}if(tmpZ==7){if(tmpI==99999999){tmpP2=tmpK2.ValueMax();}else{tmpP2=(((tmpB2+86400)-tmpI1).ToInteger()/86400).ToInteger()-1;}}}if((tmpZ==9)||(tmpZ==11)||(tmpZ==13)||(tmpZ==15)||(tmpZ==17)||(tmpZ==19)||(tmpZ==8)||(tmpZ==10)||(tmpZ==12)||(tmpZ==14)||(tmpZ==16)||(tmpZ==18)){
if((tmpZ==8)||(tmpZ==9)){tmpL=0;}if((tmpZ==10)||(tmpZ==11)){tmpL=1;}if((tmpZ==12)||(tmpZ==13)){tmpL=2;}if((tmpZ==14)||(tmpZ==15)){tmpL=3;}if((tmpZ==16)||(tmpZ==17)){tmpL=4;}if((tmpZ==18)||(tmpZ==19)){tmpL=5;}tmpM=(tmpR.StrValueByIndex(";",tmpL)).ToInteger();if((tmpZ==9)||(tmpZ==11)||(tmpZ==13)||(tmpZ==15)||(tmpZ==17)||(tmpZ==19)){tmpP2="";if(tmpM>=0){tmpL=(tmpM1.StrValueByIndex(";",tmpM)).ToInteger();if(tmpL<0){tmpL=0;}tmpP2=(tmpL1.StrValueByIndex(";",tmpM)).StrValueByIndex(",",tmpL);}}if((tmpZ==8)||(tmpZ==10)||(tmpZ==12)||(tmpZ==14)||(tmpZ==16)||(tmpZ==18)){tmpP2=-1;tmpT=tmpK2.ValueList();if(tmpM>=0){tmpS=tmpL1.StrValueByIndex(";",tmpM);}else{tmpS=tmpB;}tmpN=-1;tmpL=0;
foreach(tmpF1,tmpT.Split(";")){foreach(tmpG1,tmpS.Split(",")){if(tmpG1==tmpF1){tmpP2=tmpL;}}if(tmpF1==tmpB){tmpN=tmpL;}tmpL=tmpL+1;}if(tmpP2==-1){if(tmpN==-1){tmpP2=tmpK2.Value();}else{tmpP2=tmpN;}}}}tmpK2.State(tmpP2);}}tmpZ=tmpZ+1;}if((tmpF<>4)&&(tmpF<>5)){tmpY=3;}tmpY=tmpY+1;}}if(tmpT1){system.Exec("logger -t script -p user.debug Konfigurationsfehler in "#tmpK2.Name(),&tmpR2,&tmpQ2);if(((tmpC1.StrValueByIndex(";",0)).StrValueByIndex("-",0)).ToInteger()>0){(dom.GetObject(tmpE.StrValueByIndex(";",0))).State("Konfigurationsfehler in: "#tmpK2.Name());}}}if(tmpX==40){tmpR1=tmpP;}if((tmpX==9)||(tmpX==34)||(tmpX==39)||(tmpX==43)){tmpU1=false;tmpV1=false;tmpW1=false;tmpX1=false;tmpY1=false;tmpH=tmpP.Length();
if(tmpH>0){tmpI=99999999;tmpY=0;while(tmpY<tmpH){if(tmpP.Substr(tmpY,1)=="1"){tmpU1=true;}if(tmpP.Substr(tmpY+1,1)=="1"){tmpV1=true;}if(tmpP.Substr(tmpY+2,1)=="1"){tmpW1=true;}if(tmpP.Substr(tmpY+3,1)=="1"){tmpX1=true;}if(tmpP.Substr(tmpY+4,1)=="1"){tmpY1=true;}if(tmpI>(tmpP.Substr(tmpY+5,8)).ToInteger()){tmpI=(tmpP.Substr(tmpY+5,8)).ToInteger();}
tmpY=tmpY+13;}tmpG2="-1;-1;-1;-1;-1;-1;-1";if(tmpX==9){tmpG2="-1;367;366;-1;-1;-1;-1";}if(tmpX==34){tmpG2="-1;224;223;225;-1;-1;226";}if(tmpX==39){tmpG2="-1;313;312;314;-1;-1;315";}if(tmpX==43){tmpG2="124;122;121;123;125;-1;-1";}tmpY=0;while(tmpY<7){tmpJ=(tmpG2.StrValueByIndex(";",tmpY)).ToInteger();if(tmpJ<>-1){tmpP2=null;if(((tmpC1.StrValueByIndex(";",tmpJ)).StrValueByIndex("-",0)).ToInteger()>0){tmpK2=dom.GetObject(tmpE.StrValueByIndex(";",tmpJ));
if((tmpY==0)||(tmpY==1)||(tmpY==2)||(tmpY==3)||(tmpY==4)){tmpP2=0;if(tmpY==0){if(tmpU1){tmpP2=1;}}if(tmpY==1){if(tmpV1){tmpP2=1;}}if(tmpY==2){if(tmpW1){tmpP2=1;}}if(tmpY==3){if(tmpX1){tmpP2=1;}}if(tmpY==4){if(tmpY1){tmpP2=1;}}if(tmpK2.ValueType()==ivtInteger){
if((web.webGetValueListCount(tmpK2.ValueList())).ToInteger()>2){tmpP2=tmpP2+1;}}}if(tmpY==6){if(tmpI<>99999999){tmpQ=tmpI.ToString();tmpA2=(tmpQ.Substr(0,4)#"-"#tmpQ.Substr(4,2)#"-"#tmpQ.Substr(6,2)#" 06:00:00").ToTime();}if(tmpY==6){if(tmpW1){tmpP2=0;}else{if(tmpV1){tmpP2=1;}else{if(tmpH==99999999){tmpP2=tmpK2.ValueMax();}else{tmpP2=(((tmpA2+86400)-tmpI1).ToInteger()/86400).ToInteger()-1;}}}}}tmpK2.State(tmpP2);}}tmpY=tmpY+1;}}}tmpX=tmpX+1;}
if(tmpR1.Length()>0){tmpD2="126;127;128;129;130;131;132;133;134;135;136;137";tmpF=(tmpI1.Format("%u")).ToInteger();tmpT1=false;tmpU1=false;tmpV1=false;tmpW1=false;tmpX1=false;
if(tmpR1.Substr(0,1)=="1"){tmpT1=true;}if(tmpR1.Substr(1,1)=="1"){tmpU1=true;}if(tmpR1.Substr(2,1)=="1"){tmpV1=true;}if(tmpR1.Substr(3,1)=="1"){tmpW1=true;}if(tmpR1.Substr(4,1)=="1"){tmpX1=true;}tmpX=0;while(tmpX<12){tmpG=(tmpD2.StrValueByIndex(";",tmpX)).ToInteger();
if(((tmpC1.StrValueByIndex(";",tmpG)).StrValueByIndex("-",0)).ToInteger()>0){tmpK2=dom.GetObject(tmpE.StrValueByIndex(";",tmpG));tmpP2=0;
if(tmpX==0){if((tmpV1==false)&&(((tmpU1)&&(tmpF==1))||((tmpW1)&&(tmpF==5)))){tmpP2=1;}}if(tmpX==1){if((tmpU1==false)&&(((tmpT1)&&(tmpF==7))||((tmpV1)&&(tmpF==4)))){tmpP2=1;}}if(tmpX==2){if((tmpW1==false)&&(((tmpX1)&&(tmpF==6))||((tmpV1)&&(tmpF==2)))){tmpP2=1;}}
if(tmpX==3){if((tmpV1==false)&&(((tmpU1)&&(tmpF==1))||((tmpW1)&&(tmpF==5))||((tmpU1)&&(tmpW1)&&(tmpF>=2)&&(tmpF<=4)))){tmpP2=1;}}if(tmpX==4){if((tmpU1==false)&&(((tmpT1)&&(tmpF==7))||((tmpV1)&&(tmpF==4))||((tmpT1)&&(tmpV1)&&(tmpF>=1)&&(tmpF<=3)))){tmpP2=1;}}if(tmpX==5){if((tmpW1==false)&&(((tmpX1)&&(tmpF==6))||((tmpV1)&&(tmpF==2))||((tmpX1)&&(tmpV1)&&(tmpF>=3)&&(tmpF<=5)))){tmpP2=1;}}
if(tmpX==6){if((tmpV1==false)&&(((tmpU1)&&(tmpF==1))||((tmpW1)&&(tmpF==6)))){tmpP2=1;}}if(tmpX==7){if((tmpU1==false)&&(((tmpT1)&&(tmpF==7))||((tmpV1)&&(tmpF==5)))){tmpP2=1;}}if(tmpX==8){if((tmpW1==false)&&(((tmpX1)&&(tmpF==7))||((tmpV1)&&(tmpF==2)))){tmpP2=1;}}
if(tmpX==9){if((tmpV1==false)&&(((tmpU1)&&(tmpF==1))||((tmpW1)&&(tmpF==6))||((tmpU1)&&(tmpW1)&&(tmpF>=2)&&(tmpF<=5)))){tmpP2=1;}}if(tmpX==10){if((tmpU1==false)&&(((tmpT1)&&(tmpF==7))||((tmpV1)&&(tmpF==5))||((tmpT1)&&(tmpV1)&&(tmpF>=1)&&(tmpF<=4)))){tmpP2=1;}}if(tmpX==11){if((tmpW1==false)&&(((tmpX1)&&(tmpF==7))||((tmpV1)&&(tmpF==2))||((tmpX1)&&(tmpV1)&&(tmpF>=3)&&(tmpF<=6)))){tmpP2=1;}}
if(tmpK2.ValueType()==ivtInteger){if((web.webGetValueListCount(tmpK2.ValueList())).ToInteger()>2){tmpP2=tmpP2+1;}}tmpK2.State(tmpP2);}tmpX=tmpX+1;}}
if(((tmpC1.StrValueByIndex(";",0)).StrValueByIndex("-",0)).ToInteger()>0){(dom.GetObject(tmpE.StrValueByIndex(";",0))).State("Skript beendet: "#tmpD);}

Zuletzt geändert von AndiN am 10.08.2016, 15:29, insgesamt 6-mal geändert.
Andi (Greenhorn)

Letzter Reboot: 17.03.24 => FW Update (Uptime:Rekord:153 Tage)
Systeminfos: Raspberry Pi3 Firmware: 3.75.6.20240316 142 Geräte
System angebunden: 3 Roomba 650 - Sprachausgabe via Home24 Media - Pocket Control
- Zentrale: Asus TF103 mit Home24 Tablet
Addons: Drucken 2.5 - HQ WebUI 2.5.9 - XML-API 1.22 - CUx-Daemon 2.9.3 - E-Mail 1.7.4 - hm_pdetect 1.11 - VPN cloudmatic
Diverse Links

matze-pe
Beiträge: 757
Registriert: 11.02.2013, 08:38
Hat sich bedankt: 1 Mal
Danksagung erhalten: 1 Mal

Re: Script Probleme (überarbeitete Skripts)

Beitrag von matze-pe » 25.11.2015, 11:58

Super danke für die Skriptänderungen, ich beobachte mal ob sie nun stabiler laufen :D

Liegt das Problem primär an der CCU2 Firmware, dass bei zu vielen Variabeln nicht alles abgearbeitet werden kann oder an der begrenzten Performance der CCU2?
Ich stelle demnächst auf RaspberryMatic um, der ja eine 10x schnellere Performance als die CCU2 hat.
CCU3 (80 Geräte, 105 Variablen, 50 Programme) * CCU.IO + DashUI + Apple HomeKit (Homebridge) auf Raspi2

Benutzeravatar
AndiN
Beiträge: 2621
Registriert: 10.06.2015, 08:54
Wohnort: Hennef
Hat sich bedankt: 10 Mal
Danksagung erhalten: 28 Mal

Re: Script Probleme (überarbeitete Skripts)

Beitrag von AndiN » 25.11.2015, 19:42

Hallo Matze,

ich kann es Dir nicht sagen. Ich vermute, dass intern Speicher für die Variablen belegt und dieser nicht freigegeben wird.

Seit dem ich alle Skripte umgeschrieben habe und nur noch die Variablen im Einsatz habe.... bis dato keine Probleme mehr. Zufall? Ich glaube es nicht....

Andi
Andi (Greenhorn)

Letzter Reboot: 17.03.24 => FW Update (Uptime:Rekord:153 Tage)
Systeminfos: Raspberry Pi3 Firmware: 3.75.6.20240316 142 Geräte
System angebunden: 3 Roomba 650 - Sprachausgabe via Home24 Media - Pocket Control
- Zentrale: Asus TF103 mit Home24 Tablet
Addons: Drucken 2.5 - HQ WebUI 2.5.9 - XML-API 1.22 - CUx-Daemon 2.9.3 - E-Mail 1.7.4 - hm_pdetect 1.11 - VPN cloudmatic
Diverse Links

Benutzeravatar
blackhole
Beiträge: 3717
Registriert: 21.07.2015, 14:03
System: CCU
Hat sich bedankt: 184 Mal
Danksagung erhalten: 586 Mal

Re: Script Probleme (überarbeitete Skripts)

Beitrag von blackhole » 26.11.2015, 08:35

Meine Beobachtungen zu dem Thema:
  1. Fehler treten häufig auf, wenn in einem (umfangreichen) Skript Variablen umbenannt werden. Und zwar genau einmal. Nach einem Reboot ist dann alles gut.
  2. Fehler treten nicht auf, wenn in einem (umfangreichen) Skript neue Variablen hinzukommen, die bereits vorhandenen Variablen aber unberührt bleiben.
  3. Fehler treten beim Ändern eines (umfangreichen) Skriptes, unabhängig von Umbenennungen oder Hinzufügen von Variablen häufig auf, wenn ccu.io installiert ist.
Das sind wirklich nur subjektive Beobachtungen, Kausalzusammenhänge mögen fehlen - oder auch nicht. Andere Leute mögen andere Beobachtungen gemacht haben.

Ich glaube™ nicht, dass die grundsätzliche Anzahl von Variablen eine Rolle spielt. Ich finde daher auch die hier vorgestellte Lösung suboptimal (Skripte werden unleserlich) zumal der vermeintlich positive Effekt eher ein Randeffekt ist.

Ich halte es aber für eine gute Idee, alle verwendeten Variablen am Ende eines Skriptes zu "resetten" (entweder "wertfrei" neu initialisieren oder "nullen"). Ersteres werde ich voraussichtlich in meinen Skripten versuchsweise einbauen. Das schade zumindest nicht und die Skripte bleiben weiterhin lesbar, gut wartbar, gut erweiterbar.

Last not least: Die doppelte Pflege fällt weg (die wird sonst wohl zu einer dauerhaften Aufgabe, da vermutlich kein Skripter aus vorgenannten Gründen das Schema hier übernehmen wird). Vermutlich wird das Erbe hier auch kaum jemand übernehmen und pflegen, wenn sich die Prioritäten einmal ändern werden.

Ganz wichtig: Ich will die Lösung hier keinesfalls madig reden, respektiere die getane Arbeit und freue mich für alle, denen das hilft.

Benutzeravatar
AndiN
Beiträge: 2621
Registriert: 10.06.2015, 08:54
Wohnort: Hennef
Hat sich bedankt: 10 Mal
Danksagung erhalten: 28 Mal

Re: Script Probleme (überarbeitete Skripts)

Beitrag von AndiN » 26.11.2015, 14:38

@Blackhole: Wehe... Lach.. Nein, die Arbeit war echt imens und seit dem habe ich Ruhe.

Ich weiß nur eins, dass ich mal ein Skript (irgend so ein 0-8-15) falsch geändert hatte (also ein Fehler, der bei der Fehlerprüfung nicht auffiel) und auf einmal lief das Unwetterskript nicht mehr. Fehler in einer Ecke wo keiner war. Also hängt alles zusammen.

Mit dem Neustart kann ich nur bedingt bestätigen. Hatte einmal den Fehler, dass obwohl ich kein Srkipt geändert/ergänzt hatte. Glaube eher, dass wenn der interne Speicher einen Overflow hat und nicht geleert wird. Dann können Variablen nicht mehr mit Werten beschrieben werden. Zumindest stelle ich mir das bildlich so vor.

Das mit dem Reseten wäre doch mal einen Versuch für diejenigen die das Phänomen noch haben. Ist ja schnell gemacht, da es in der Regel die o.a. großen Skripte betreffen würde. Die Lösung wäre mir zig mal lieber wie das Ewige umschreiben.

Wie gesagt, seit dem Umschreiben keinerlei Probleme mehr und absolut stabiles Laufverhalten.
Andi (Greenhorn)

Letzter Reboot: 17.03.24 => FW Update (Uptime:Rekord:153 Tage)
Systeminfos: Raspberry Pi3 Firmware: 3.75.6.20240316 142 Geräte
System angebunden: 3 Roomba 650 - Sprachausgabe via Home24 Media - Pocket Control
- Zentrale: Asus TF103 mit Home24 Tablet
Addons: Drucken 2.5 - HQ WebUI 2.5.9 - XML-API 1.22 - CUx-Daemon 2.9.3 - E-Mail 1.7.4 - hm_pdetect 1.11 - VPN cloudmatic
Diverse Links

Antworten

Zurück zu „HomeMatic Zentrale (CCU / CCU2 / CCU3 / Charly)“