Hallo Leute,
ich beschäftige mich seit etwa 2 Monate mit HM und habe heute zum erstem Mal ein eigenes Script geschrieben um die Wettervorhersage der nächsten 3 Tage bei Wetter.com zu holen. Ich wollte mal mein "Erfolg" mit euch teilen. Vielleicht braucht jemand sowas und hoffentlich können mir die Experten unter euch ein paar Tipps zur Verbesserung geben
Um die API Key zu bekommen, muss sich erst bei Wetter.com anmelden und ein Projekt erzeugen. Dann die Checksumme MD5 aus Projektname, Key und Citycode erzeugen. Für die einzelnen Tagen habe ich dann jeweils 6 Variablen erstellt und lese jetzt einmal am Tag die Mindest- und Höchsttemperatur, Wetterzustand, Windgeschwindigkeit und ob es an dem Tag regnen soll der folgenden 3 Tage aus.
Liste der Schritte (Kurzfassung)
- Zuerst musst du dich bei wetter.com anmelden: http://www.wetter.com/mein_wetter/register/
- Dann einloggen und ein Projekt erstellen: http://www.wetter.com/apps_und_mehr/web ... /projekte/
- Wenn das Projekt erstellt wurde, bekommst du eine Projekt API Key und den vergebenen Projektnamen -> Diese brauchst du später
- Beim Erstellen des Projekts nicht vergessen im Reiter "Vorhersageeinstellungen" die Anzahl der Vorhersagetage auf 3 zu stellen (hier noch ein Link dazu) und die weitere Einstellmöglichkeiten wie im Bild einstellen
- Jetzt gehst du auf wetter.com und suchst die Wettervorhersage für dein Ort: z.B. Buxtehude: http://www.wetter.com/wetter_aktuell/ak ... 01740.html
- Aus dem Link entnimmst du dein CityCode: hier DE0001740
- Jetzt gehst du auf http://www.md5generator.de/ und gibst im Eigabefeld (ohne Leerzeichen - einfach hintereinander): ProjektName APIKey CityCode
- Jetzt hast du alles was man braucht -> Im Skript einfach die Checksumme in der Variabel apikey eingeben und die andere Variabeln entsprechend anpassen.
- Für alle die sich mit CUxD auskennen,das hier durchlesen und auch so ein Gerät anlegen, der hier im Code eingegeben werden muss
- Zu guter Letzt müssen einige Variabeln angelegt werden. Entwerder die gleiche Bezeichnung wie unten im Skript wählen oder diese im Skript anpassen. Die Art der einzelnen Variabeln stehen als Kommentar hinten dran und was die einzelnen bewirken, sollte aus dem Namen ersichtlich sein
Code: Alles auswählen
!-----------------------------------------------------------------------------
! Hier alle was man verändern kann/muss
! Voraussetzung: CUxD und ein Wetter.com Account
!-----------------------------------------------------------------------------
string apikey = "hier die MD5 Checksumme aus ProjektName APIKey CityCode eintragen";
string cityCode = "DE0000910";
string projectName = "meinerstesprojekt";
var CUxD_Device = "CUxD.CUX2801001:1"; !CUxD Virtuelles Gerät
!Wetter heute Variablen-Namen (alles optional)
string Wetter_heute_zustand = "Wetter_heute_zustand"; !Zahl 0 - 999
string Wetter_heute_tempMax = "Wetter_heute_tempMax"; !Zahl -50 - 50 °C
string Wetter_heute_tempMin = "Wetter_heute_tempMin"; !Zahl -50 - 50 °C
string Wetter_heute_wind = "Wetter_heute_wind"; !Zahl 0 - 200 km/h
string Wetter_heute_zustand_txt = "Wetter_heute_zustand_txt"; !Zeichenkette
string Wetter_heute_regen = "Wetter_heute_regen"; !Logikwert
string Wetter_heute_regen_wahrscheinlichkeit = "Wetter_heute_regen_proz"; !Zahl 0 - 100 %
!Wetter morgen Variablen-Namen (alles optional)
string Wetter_morgen_zustand = "Wetter_morgen_zustand"; !Zahl 0 - 999
string Wetter_morgen_tempMax = "Wetter_morgen_tempMax"; !Zahl -50 - 50 °C
string Wetter_morgen_tempMin = "Wetter_morgen_tempMin"; !Zahl -50 - 50 °C
string Wetter_morgen_wind = "Wetter_morgen_wind"; !Zahl 0 - 200 km/h
string Wetter_morgen_zustand_txt = "Wetter_morgen_zustand_txt"; !Zeichenkette
string Wetter_morgen_regen = "Wetter_morgen_regen"; !Logikwert
string Wetter_morgen_regen_wahrscheinlichkeit = "Wetter_morgen_regen_proz"; !Zahl 0 - 100 %
!Wetter übermorgen Variablen-Namen (alles optional)
string Wetter_morgen2_zustand = "Wetter_morgen2_zustand"; !Zahl 0 - 999
string Wetter_morgen2_tempMax = "Wetter_morgen2_tempMax"; !Zahl -50 - 50 °C
string Wetter_morgen2_tempMin = "Wetter_morgen2_tempMin"; !Zahl -50 - 50 °C
string Wetter_morgen2_wind = "Wetter_morgen2_wind"; !Zahl 0 - 200 km/h
string Wetter_morgen2_zustand_txt = "Wetter_morgen2_zustand_txt"; !Zeichenkette
string Wetter_morgen2_regen = "Wetter_morgen2_regen"; !Logikwert
string Wetter_morgen2_regen_wahrscheinlichkeit = "Wetter_morgen2_regen_proz"; !Zahl 0 - 100 %
!-----------------------------------------------------------------------------
! Ab hier muss man nichts mehr beachten
!-----------------------------------------------------------------------------
string weatherUrl = "http://api.wetter.com/forecast/weather/city/" + cityCode +"/project/" + projectName + "/cs/" + apikey + "/output/json";
var stdout;
var posStart;
var posEnd;
var value;
var substring;
var posValueStart;
var posValueEnd;
var posValue;
var cut1 = "\"23:00\"";
var cut2 = "},";
var heute = system.Date("%F");
var t= system.Date("%F ")#"00:00:00";
t = t.ToTime().ToInteger() + 86400;
var morgen = t.ToTime().Format("%F");
t = t.ToTime().ToInteger() + 86400;
var morgen2 = t.ToTime().Format("%F");
dom.GetObject(CUxD_Device # ".CMD_SETS").State("wget -q -O - " # weatherUrl);
dom.GetObject(CUxD_Device # ".CMD_QUERY_RET").State(1);
stdout = dom.GetObject(CUxD_Device # ".CMD_RETS").State();
!-----------------------------------------------------------------------------
! Dekodierung der Umlaute
!-----------------------------------------------------------------------------
string decoded;
string index;
foreach(index, stdout.Split("Ã")){
decoded = decoded+ index + "";
}
stdout = decoded;
decoded = "";
foreach(index, stdout.Split("¤")){
decoded = decoded + index + "ä";
}
stdout = decoded;
decoded = "";
foreach(index, stdout.Split("¶")){
decoded = decoded + index + "ö";
}
stdout = decoded;
decoded = "";
foreach(index, stdout.Split("¼")){
decoded = decoded + index + "ü";
}
stdout = decoded;
decoded = "";
!-----------------------------------------------------------------------------
! HEUTE
!-----------------------------------------------------------------------------
boolean regen = false;
posStart = "\"" + heute + "\":{";
posEnd = "\"" + morgen + "\":{";
substring = stdout.Substr(stdout.Find(posStart), stdout.Find(posEnd));
!Wetterzustand
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = substring.Find(posValueStart) + posValueStart.Length();
value = substring.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
integer valInt = value.ToInteger();
if(dom.GetObject(Wetter_heute_zustand).IsTypeOf(OT_VARDP)){
dom.GetObject(Wetter_heute_zustand).State(valInt);
}
regen = ((valInt > 5) && (valInt < 10)) || (valInt > 59);
!Maximaltemperatur
if(dom.GetObject(Wetter_heute_tempMax).IsTypeOf(OT_VARDP)){
posValueStart = "\"tx\":\"";
posValueEnd = "\",";
posValue = substring.Find(posValueStart) + posValueStart.Length();
value = substring.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(Wetter_heute_tempMax).State(value.ToInteger());
}
!Regenwahrscheinlichkeit
if(dom.GetObject(Wetter_heute_regen_wahrscheinlichkeit).IsTypeOf(OT_VARDP)){
posValueStart = "\"pc\":\"";
posValueEnd = "\",";
posValue = substring.Find(posValueStart) + posValueStart.Length();
value = substring.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(Wetter_heute_regen_wahrscheinlichkeit).State(value.ToInteger());
}
!Wird überhaupt regnen
if(dom.GetObject(Wetter_heute_regen).IsTypeOf(OT_VARDP)){
if(!regen){
var cutUhr = "\"06:00\"";
var regenSuche = substring.Substr(substring.Find(cutUhr), substring.Length());
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = regenSuche.Find(posValueStart) + posValueStart.Length();
valInt = regenSuche.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0).ToInteger();
regen = ((valInt > 5) && (valInt < 10)) || (valInt > 59);
if(!regen){
cutUhr = "\"11:00\"";
regenSuche = substring.Substr(substring.Find(cutUhr), substring.Length());
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = regenSuche.Find(posValueStart) + posValueStart.Length();
valInt = regenSuche.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0).ToInteger();
regen = ((valInt > 5) && (valInt < 10)) || (valInt > 59);
if(!regen){
cutUhr = "\"17:00\"";
regenSuche = substring.Substr(substring.Find(cutUhr), substring.Length());
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = regenSuche.Find(posValueStart) + posValueStart.Length();
valInt = regenSuche.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0).ToInteger();
regen = ((valInt > 5) && (valInt < 10)) || (valInt > 59);
if(!regen){
cutUhr = "\"23:00\"";
regenSuche = substring.Substr(substring.Find(cutUhr), substring.Length());
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = regenSuche.Find(posValueStart) + posValueStart.Length();
valInt = regenSuche.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0).ToInteger();
regen = ((valInt > 5) && (valInt < 10)) || (valInt > 59);
}
}
}
}
dom.GetObject(Wetter_heute_regen).State(regen);
}
substring = substring.Substr(substring .Find(cut1), substring.Length());
substring = substring.Substr(substring .Find(cut2), substring.Length());
!Minimaltemperatur
if(dom.GetObject(Wetter_heute_tempMin).IsTypeOf(OT_VARDP)){
posValueStart = "\"tn\":\"";
posValueEnd = "\",";
posValue = substring.Find(posValueStart) + posValueStart.Length();
value = substring.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(Wetter_heute_tempMin).State(value.ToInteger());
}
!Windgeschwindigkeit
if(dom.GetObject(Wetter_heute_wind).IsTypeOf(OT_VARDP)){
posValueStart = "\"ws\":\"";
posValueEnd = "\",";
posValue = substring.Find(posValueStart) + posValueStart.Length();
value = substring.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(Wetter_heute_wind).State(value.ToInteger());
}
!Wetterzustand Text
if(dom.GetObject(Wetter_heute_zustand_txt).IsTypeOf(OT_VARDP)){
posValueStart = "\"w_txt\":\"";
posValueEnd = "\"},";
posValue = substring.Find(posValueStart) + posValueStart.Length();
value = substring.Substr(posValue, 20).StrValueByIndex(posValueEnd, 0);
dom.GetObject(Wetter_heute_zustand_txt).State(value);
}
!-----------------------------------------------------------------------------
! MORGEN
!-----------------------------------------------------------------------------
regen = false;
posStart = "\"" + morgen + "\":{";
posEnd = "\"" + morgen2 + "\":{";
substring = stdout.Substr(stdout.Find(posStart), stdout.Find(posEnd));
!Wetterzustand
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = substring.Find(posValueStart) + posValueStart.Length();
value = substring.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
integer valInt = value.ToInteger();
if(dom.GetObject(Wetter_morgen_zustand).IsTypeOf(OT_VARDP)){
dom.GetObject(Wetter_morgen_zustand).State(valInt);
}
regen = ((valInt > 5) && (valInt < 10)) || (valInt > 59);
!Maximaltemperatur
if(dom.GetObject(Wetter_morgen_tempMax).IsTypeOf(OT_VARDP)){
posValueStart = "\"tx\":\"";
posValueEnd = "\",";
posValue = substring.Find(posValueStart) + posValueStart.Length();
value = substring.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(Wetter_morgen_tempMax).State(value.ToInteger());
}
!Regenwahrscheinlichkeit
if(dom.GetObject(Wetter_morgen_regen_wahrscheinlichkeit).IsTypeOf(OT_VARDP)){
posValueStart = "\"pc\":\"";
posValueEnd = "\",";
posValue = substring.Find(posValueStart) + posValueStart.Length();
value = substring.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(Wetter_morgen_regen_wahrscheinlichkeit).State(value.ToInteger());
}
!Wird überhaupt regnen
if(dom.GetObject(Wetter_morgen_regen).IsTypeOf(OT_VARDP)){
if(!regen){
var cutUhr = "\"06:00\"";
var regenSuche = substring.Substr(substring.Find(cutUhr), substring.Length());
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = regenSuche.Find(posValueStart) + posValueStart.Length();
valInt = regenSuche.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0).ToInteger();
regen = ((valInt > 5) && (valInt < 10)) || (valInt > 59);
if(!regen){
cutUhr = "\"11:00\"";
regenSuche = substring.Substr(substring.Find(cutUhr), substring.Length());
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = regenSuche.Find(posValueStart) + posValueStart.Length();
valInt = regenSuche.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0).ToInteger();
regen = ((valInt > 5) && (valInt < 10)) || (valInt > 59);
if(!regen){
cutUhr = "\"17:00\"";
regenSuche = substring.Substr(substring.Find(cutUhr), substring.Length());
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = regenSuche.Find(posValueStart) + posValueStart.Length();
valInt = regenSuche.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0).ToInteger();
regen = ((valInt > 5) && (valInt < 10)) || (valInt > 59);
if(!regen){
cutUhr = "\"23:00\"";
regenSuche = substring.Substr(substring.Find(cutUhr), substring.Length());
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = regenSuche.Find(posValueStart) + posValueStart.Length();
valInt = regenSuche.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0).ToInteger();
regen = ((valInt > 5) && (valInt < 10)) || (valInt > 59);
}
}
}
}
dom.GetObject(Wetter_morgen_regen).State(regen);
}
substring = substring .Substr(substring .Find(cut1), substring.Length());
substring = substring .Substr(substring .Find(cut2), substring.Length());
!Minimaltemperatur
if(dom.GetObject(Wetter_morgen_tempMin).IsTypeOf(OT_VARDP)){
posValueStart = "\"tn\":\"";
posValueEnd = "\",";
posValue = substring.Find(posValueStart) + posValueStart.Length();
value = substring.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(Wetter_morgen_tempMin).State(value.ToInteger());
}
!Windgeschwindigkeit
if(dom.GetObject(Wetter_morgen_wind).IsTypeOf(OT_VARDP)){
posValueStart = "\"ws\":\"";
posValueEnd = "\",";
posValue = substring.Find(posValueStart) + posValueStart.Length();
value = substring.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(Wetter_morgen_wind).State(value.ToInteger());
}
!Wetterzustand Text
if(dom.GetObject(Wetter_morgen_zustand_txt).IsTypeOf(OT_VARDP)){
posValueStart = "\"w_txt\":\"";
posValueEnd = "\"},";
posValue = substring.Find(posValueStart) + posValueStart.Length();
value = substring.Substr(posValue, 20).StrValueByIndex(posValueEnd, 0);
dom.GetObject(Wetter_morgen_zustand_txt).State(value);
}
!-----------------------------------------------------------------------------
! ÜBERMORGEN
!-----------------------------------------------------------------------------
regen = false;
posStart = "\"" + morgen2 + "\":{";
posEnd = "}}";
substring = stdout.Substr(stdout.Find(posStart), stdout.Find(posEnd));
!Wetterzustand
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = substring.Find(posValueStart) + posValueStart.Length();
value = substring.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
integer valInt = value.ToInteger();
if(dom.GetObject(Wetter_morgen2_zustand).IsTypeOf(OT_VARDP)){
dom.GetObject(Wetter_morgen2_zustand).State(valInt);
}
regen = ((valInt > 5) && (valInt < 10)) || (valInt > 59);
!Maximaltemperatur
if(dom.GetObject(Wetter_morgen2_tempMax).IsTypeOf(OT_VARDP)){
posValueStart = "\"tx\":\"";
posValueEnd = "\",";
posValue = substring.Find(posValueStart) + posValueStart.Length();
value = substring.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(Wetter_morgen2_tempMax).State(value.ToInteger());
}
!Regenwahrscheinlichkeit
if(dom.GetObject(Wetter_morgen2_regen_wahrscheinlichkeit).IsTypeOf(OT_VARDP)){
posValueStart = "\"pc\":\"";
posValueEnd = "\",";
posValue = substring.Find(posValueStart) + posValueStart.Length();
value = substring.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(Wetter_morgen2_regen_wahrscheinlichkeit).State(value.ToInteger());
}
!Wird überhaupt regnen
if(dom.GetObject(Wetter_morgen2_regen).IsTypeOf(OT_VARDP)){
if(!regen){
var cutUhr = "\"06:00\"";
var regenSuche = substring.Substr(substring.Find(cutUhr), substring.Length());
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = regenSuche.Find(posValueStart) + posValueStart.Length();
valInt = regenSuche.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0).ToInteger();
regen = ((valInt > 5) && (valInt < 10)) || (valInt > 59);
if(!regen){
cutUhr = "\"11:00\"";
regenSuche = substring.Substr(substring.Find(cutUhr), substring.Length());
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = regenSuche.Find(posValueStart) + posValueStart.Length();
valInt = regenSuche.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0).ToInteger();
regen = ((valInt > 5) && (valInt < 10)) || (valInt > 59);
if(!regen){
cutUhr = "\"17:00\"";
regenSuche = substring.Substr(substring.Find(cutUhr), substring.Length());
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = regenSuche.Find(posValueStart) + posValueStart.Length();
valInt = regenSuche.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0).ToInteger();
regen = ((valInt > 5) && (valInt < 10)) || (valInt > 59);
if(!regen){
cutUhr = "\"23:00\"";
regenSuche = substring.Substr(substring.Find(cutUhr), substring.Length());
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = regenSuche.Find(posValueStart) + posValueStart.Length();
valInt = regenSuche.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0).ToInteger();
regen = ((valInt > 5) && (valInt < 10)) || (valInt > 59);
}
}
}
}
dom.GetObject(Wetter_morgen2_regen).State(regen);
}
substring = substring.Substr(substring.Find(cut1), substring.Length());
substring = substring.Substr(substring.Find(cut2), substring.Length());
!Minimaltemperatur
if(dom.GetObject(Wetter_morgen2_tempMin).IsTypeOf(OT_VARDP)){
posValueStart = "\"tn\":\"";
posValueEnd = "\",";
posValue = substring.Find(posValueStart) + posValueStart.Length();
value = substring.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(Wetter_morgen2_tempMin).State(value.ToInteger());
}
!Windgeschwindigkeit
if(dom.GetObject(Wetter_morgen2_wind).IsTypeOf(OT_VARDP)){
posValueStart = "\"ws\":\"";
posValueEnd = "\",";
posValue = substring.Find(posValueStart) + posValueStart.Length();
value = substring.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(Wetter_morgen2_wind).State(value.ToInteger());
}
!Wetterzustand Text
if(dom.GetObject(Wetter_morgen2_zustand_txt).IsTypeOf(OT_VARDP)){
posValueStart = "\"w_txt\":\"";
posValueEnd = "\"}";
posValue = substring.Find(posValueStart) + posValueStart.Length();
value = substring.Substr(posValue, 20).StrValueByIndex(posValueEnd, 0);
dom.GetObject(Wetter_morgen2_zustand_txt).State(value);
}
Code: Alles auswählen
!-----------------------------------------------------------------------------
! Hier alle was man verändern kann/muss
! Voraussetzung: CUxD und ein Wetter.com Account
!-----------------------------------------------------------------------------
string apikey = "hier die MD5 Checksumme aus ProjektName APIKey CityCode eintragen";
string cityCode = "DE0000910";
string projectName = "meinerstesprojekt";
var CUxD_Device = "CUxD.CUX2801001:1"; !CUxD Virtuelles Gerät
!Wetter heute Variablen-Namen (alles optional)
string W6h_zus = "Wetter_heute_6_zustand"; !Zahl 0 - 999
string W6h_tempMax = "Wetter_heute_6_tempMax"; !Zahl -50 - 50 °C
string W6h_tempMin = "Wetter_heute_6_tempMin"; !Zahl -50 - 50 °C
string W6h_regen = "Wetter_heute_6_regen_proz"; !Zahl 0 - 100 %
string W11h_zus = "Wetter_heute_11_zustand"; !Zahl 0 - 999
string W11h_tempMax = "Wetter_heute_11_tempMax"; !Zahl -50 - 50 °C
string W11h_tempMin = "Wetter_heute_11_tempMin"; !Zahl -50 - 50 °C
string W11h_regen = "Wetter_heute_11_regen_proz"; !Zahl 0 - 100 %
string W17h_zus = "Wetter_heute_17_zustand"; !Zahl 0 - 999
string W17h_tempMax = "Wetter_heute_17_tempMax"; !Zahl -50 - 50 °C
string W17h_tempMin = "Wetter_heute_17_tempMin"; !Zahl -50 - 50 °C
string W17h_regen = "Wetter_heute_17_regen_proz"; !Zahl 0 - 100 %
string W23h_zus = "Wetter_heute_23_zustand"; !Zahl 0 - 999
string W23h_tempMax = "Wetter_heute_23_tempMax"; !Zahl -50 - 50
string W23h_tempMin = "Wetter_heute_23_tempMin"; !Zahl -50 - 50 °C
string W23h_regen = "Wetter_heute_23_regen_proz"; !Zahl 0 - 100 %
!Wetter morgen Variablen-Namen (alles optional)
string W6m_zus = "Wetter_morgen_6_zustand"; !Zahl 0 - 999
string W6m_tempMax = "Wetter_morgen_6_tempMax"; !Zahl -50 - 50 °C
string W6m_tempMin = "Wetter_morgen_6_tempMin"; !Zahl -50 - 50 °C
string W6m_regen = "Wetter_morgen_6_regen_proz"; !Zahl 0 - 100 %
string W11m_zus = "Wetter_morgen_11_zustand"; !Zahl 0 - 999
string W11m_tempMax = "Wetter_morgen_11_tempMax"; !Zahl -50 - 50 °C
string W11m_tempMin = "Wetter_morgen_11_tempMin"; !Zahl -50 - 50 °C
string W11m_regen = "Wetter_morgen_11_regen_proz"; !Zahl 0 - 100 %
string W17m_zus = "Wetter_morgen_17_zustand"; !Zahl 0 - 999
string W17m_tempMax = "Wetter_morgen_17_tempMax"; !Zahl -50 - 50 °C
string W17m_tempMin = "Wetter_morgen_17_tempMin"; !Zahl -50 - 50 °C
string W17m_regen = "Wetter_morgen_17_regen_proz"; !Zahl 0 - 100 %
string W23m_zus = "Wetter_morgen_23_zustand"; !Zahl 0 - 999
string W23m_tempMax = "Wetter_morgen_23_tempMax"; !Zahl -50 - 50
string W23m_tempMin = "Wetter_morgen_23_tempMin"; !Zahl -50 - 50 °C
string W23m_regen = "Wetter_morgen_23_regen_proz"; !Zahl 0 - 100 %
!Wetter übermorgen Variablen-Namen (alles optional)
string W6u_zus = "Wetter_morgen2_6_zustand"; !Zahl 0 - 999
string W6u_tempMax = "Wetter_morgen2_6_tempMax"; !Zahl -50 - 50 °C
string W6u_tempMin = "Wetter_morgen2_6_tempMin"; !Zahl -50 - 50 °C
string W6u_regen = "Wetter_morgen2_6_regen_proz"; !Zahl 0 - 100 %
string W11u_zus = "Wetter_morgen2_11_zustand"; !Zahl 0 - 999
string W11u_tempMax = "Wetter_morgen2_11_tempMax"; !Zahl -50 - 50 °C
string W11u_tempMin = "Wetter_morgen2_11_tempMin"; !Zahl -50 - 50 °C
string W11u_regen = "Wetter_morgen2_11_regen_proz"; !Zahl 0 - 100 %
string W17u_zus = "Wetter_morgen2_17_zustand"; !Zahl 0 - 999
string W17u_tempMax = "Wetter_morgen2_17_tempMax"; !Zahl -50 - 50 °C
string W17u_tempMin = "Wetter_morgen2_17_tempMin"; !Zahl -50 - 50 °C
string W17u_regen = "Wetter_morgen2_17_regen_proz"; !Zahl 0 - 100 %
string W23u_zus = "Wetter_morgen2_23_zustand"; !Zahl 0 - 999
string W23u_tempMax = "Wetter_morgen2_23_tempMax"; !Zahl -50 - 50
string W23u_tempMin = "Wetter_morgen2_23_tempMin"; !Zahl -50 - 50 °C
string W23u_regen = "Wetter_morgen2_23_regen_proz"; !Zahl 0 - 100 %
!-----------------------------------------------------------------------------
! Ab hier muss man nichts mehr beachten
!-----------------------------------------------------------------------------
string weatherUrl = "http://api.wetter.com/forecast/weather/city/" + cityCode +"/project/" + projectName + "/cs/" + apikey + "/output/json";
var stdout;
var posStart;
var posEnd;
var value;
var substring;
var substring2;
var posValueStart;
var posValueEnd;
var posValue;
var cut1 = "\"23:00\"";
var cut2 = "},";
integer posTmp;
var heute = system.Date("%F");
var t= system.Date("%F ")#"00:00:00";
t = t.ToTime().ToInteger() + 86400;
var morgen = t.ToTime().Format("%F");
t = t.ToTime().ToInteger() + 86400;
var morgen2 = t.ToTime().Format("%F");
dom.GetObject(CUxD_Device # ".CMD_SETS").State("wget -q -O - " # weatherUrl);
dom.GetObject(CUxD_Device # ".CMD_QUERY_RET").State(1);
stdout = dom.GetObject(CUxD_Device # ".CMD_RETS").State();
!-----------------------------------------------------------------------------
! HEUTE
!-----------------------------------------------------------------------------
posStart = "\"" + heute + "\":{";
posEnd = "\"" + morgen + "\":{";
substring = stdout.Substr(stdout.Find(posStart), stdout.Find(posEnd));
!06:00 Uhr
posTmp = substring.Find("06:00");
substring2 = substring.Substr(posTmp, substring.Find("11:00") - posTmp);
!Wetterzustand
if(dom.GetObject(W6h_zus).IsTypeOf(OT_VARDP)){
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W6h_zus).State(value.ToInteger());
}
!Maximaltemperatur
if(dom.GetObject(W6h_tempMax).IsTypeOf(OT_VARDP)){
posValueStart = "\"tx\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W6h_tempMax).State(value.ToInteger());
}
!Regenwahrscheinlichkeit
if(dom.GetObject(W6h_regen).IsTypeOf(OT_VARDP)){
posValueStart = "\"pc\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W6h_regen).State(value.ToInteger());
}
!Minimaltemperatur
if(dom.GetObject(W6h_tempMin).IsTypeOf(OT_VARDP)){
posValueStart = "\"tn\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W6h_tempMin).State(value.ToInteger());
}
!11:00 Uhr
posTmp = substring.Find("11:00");
substring2 = substring.Substr(posTmp, substring.Find("17:00") - posTmp);
!Wetterzustand
if(dom.GetObject(W11h_zus).IsTypeOf(OT_VARDP)){
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W11h_zus).State(value.ToInteger());
}
!Maximaltemperatur
if(dom.GetObject(W11h_tempMax).IsTypeOf(OT_VARDP)){
posValueStart = "\"tx\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W11h_tempMax).State(value.ToInteger());
}
!Regenwahrscheinlichkeit
if(dom.GetObject(W11h_regen).IsTypeOf(OT_VARDP)){
posValueStart = "\"pc\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W11h_regen).State(value.ToInteger());
}
!Minimaltemperatur
if(dom.GetObject(W11h_tempMin).IsTypeOf(OT_VARDP)){
posValueStart = "\"tn\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W11h_tempMin).State(value.ToInteger());
}
!17:00 Uhr
posTmp = substring.Find("17:00");
substring2 = substring.Substr(posTmp, substring.Find("23:00") - posTmp);
!Wetterzustand
if(dom.GetObject(W17h_zus).IsTypeOf(OT_VARDP)){
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W17h_zus).State(value.ToInteger());
}
!Maximaltemperatur
if(dom.GetObject(W17h_tempMax).IsTypeOf(OT_VARDP)){
posValueStart = "\"tx\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W17h_tempMax).State(value.ToInteger());
}
!Regenwahrscheinlichkeit
if(dom.GetObject(W17h_regen).IsTypeOf(OT_VARDP)){
posValueStart = "\"pc\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W17h_regen).State(value.ToInteger());
}
!Minimaltemperatur
if(dom.GetObject(W17h_tempMin).IsTypeOf(OT_VARDP)){
posValueStart = "\"tn\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W17h_tempMin).State(value.ToInteger());
}
!23:00 Uhr
posTmp = substring.Find("23:00");
substring2 = substring.Substr(posTmp, substring.Length() - posTmp);
!Wetterzustand
if(dom.GetObject(W23h_zus).IsTypeOf(OT_VARDP)){
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W23h_zus).State(value.ToInteger());
}
!Maximaltemperatur
if(dom.GetObject(W23h_tempMax).IsTypeOf(OT_VARDP)){
posValueStart = "\"tx\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W23h_tempMax).State(value.ToInteger());
}
!Regenwahrscheinlichkeit
if(dom.GetObject(W23h_regen).IsTypeOf(OT_VARDP)){
posValueStart = "\"pc\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W23h_regen).State(value.ToInteger());
}
!Minimaltemperatur
if(dom.GetObject(W23h_tempMin).IsTypeOf(OT_VARDP)){
posValueStart = "\"tn\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W23h_tempMin).State(value.ToInteger());
}
!-----------------------------------------------------------------------------
! MORGEN
!-----------------------------------------------------------------------------
posStart = "\"" + morgen + "\":{";
posEnd = "\"" + morgen2 + "\":{";
substring = stdout.Substr(stdout.Find(posStart), stdout.Find(posEnd));
!06:00 Uhr
posTmp = substring.Find("06:00");
substring2 = substring.Substr(posTmp, substring.Find("11:00") - posTmp);
!Wetterzustand
if(dom.GetObject(W6m_zus).IsTypeOf(OT_VARDP)){
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W6m_zus).State(value.ToInteger());
}
!Maximaltemperatur
if(dom.GetObject(W6m_tempMax).IsTypeOf(OT_VARDP)){
posValueStart = "\"tx\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W6m_tempMax).State(value.ToInteger());
}
!Regenwahrscheinlichkeit
if(dom.GetObject(W6m_regen).IsTypeOf(OT_VARDP)){
posValueStart = "\"pc\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W6m_regen).State(value.ToInteger());
}
!Minimaltemperatur
if(dom.GetObject(W6m_tempMin).IsTypeOf(OT_VARDP)){
posValueStart = "\"tn\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W6m_tempMin).State(value.ToInteger());
}
!11:00 Uhr
posTmp = substring.Find("11:00");
substring2 = substring.Substr(posTmp, substring.Find("17:00") - posTmp);
!Wetterzustand
if(dom.GetObject(W11m_zus).IsTypeOf(OT_VARDP)){
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W11m_zus).State(value.ToInteger());
}
!Maximaltemperatur
if(dom.GetObject(W11m_tempMax).IsTypeOf(OT_VARDP)){
posValueStart = "\"tx\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W11m_tempMax).State(value.ToInteger());
}
!Regenwahrscheinlichkeit
if(dom.GetObject(W11m_regen).IsTypeOf(OT_VARDP)){
posValueStart = "\"pc\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W11m_regen).State(value.ToInteger());
}
!Minimaltemperatur
if(dom.GetObject(W11m_tempMin).IsTypeOf(OT_VARDP)){
posValueStart = "\"tn\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W11m_tempMin).State(value.ToInteger());
}
!17:00 Uhr
posTmp = substring.Find("17:00");
substring2 = substring.Substr(posTmp, substring.Find("23:00") - posTmp);
!Wetterzustand
if(dom.GetObject(W17m_zus).IsTypeOf(OT_VARDP)){
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W17m_zus).State(value.ToInteger());
}
!Maximaltemperatur
if(dom.GetObject(W17m_tempMax).IsTypeOf(OT_VARDP)){
posValueStart = "\"tx\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W17m_tempMax).State(value.ToInteger());
}
!Regenwahrscheinlichkeit
if(dom.GetObject(W17m_regen).IsTypeOf(OT_VARDP)){
posValueStart = "\"pc\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W17m_regen).State(value.ToInteger());
}
!Minimaltemperatur
if(dom.GetObject(W17m_tempMin).IsTypeOf(OT_VARDP)){
posValueStart = "\"tn\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W17m_tempMin).State(value.ToInteger());
}
!23:00 Uhr
posTmp = substring.Find("23:00");
substring2 = substring.Substr(posTmp, substring.Length() - posTmp);
!Wetterzustand
if(dom.GetObject(W23m_zus).IsTypeOf(OT_VARDP)){
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W23m_zus).State(value.ToInteger());
}
!Maximaltemperatur
if(dom.GetObject(W23m_tempMax).IsTypeOf(OT_VARDP)){
posValueStart = "\"tx\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W23m_tempMax).State(value.ToInteger());
}
!Regenwahrscheinlichkeit
if(dom.GetObject(W23m_regen).IsTypeOf(OT_VARDP)){
posValueStart = "\"pc\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W23m_regen).State(value.ToInteger());
}
!Minimaltemperatur
if(dom.GetObject(W23m_tempMin).IsTypeOf(OT_VARDP)){
posValueStart = "\"tn\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W23m_tempMin).State(value.ToInteger());
}
!-----------------------------------------------------------------------------
! ÜBERMORGEN
!-----------------------------------------------------------------------------
posStart = "\"" + morgen2 + "\":{";
posEnd = "}}";
substring = stdout.Substr(stdout.Find(posStart), stdout.Find(posEnd));
!Wetterzustand
if(dom.GetObject(W6u_zus).IsTypeOf(OT_VARDP)){
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W6u_zus).State(value.ToInteger());
}
!Maximaltemperatur
if(dom.GetObject(W6u_tempMax).IsTypeOf(OT_VARDP)){
posValueStart = "\"tx\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W6u_tempMax).State(value.ToInteger());
}
!Regenwahrscheinlichkeit
if(dom.GetObject(W6u_regen).IsTypeOf(OT_VARDP)){
posValueStart = "\"pc\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W6u_regen).State(value.ToInteger());
}
!Minimaltemperatur
if(dom.GetObject(W6u_tempMin).IsTypeOf(OT_VARDP)){
posValueStart = "\"tn\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W6u_tempMin).State(value.ToInteger());
}
!11:00 Uhr
posTmp = substring.Find("11:00");
substring2 = substring.Substr(posTmp, substring.Find("17:00") - posTmp);
!Wetterzustand
if(dom.GetObject(W11u_zus).IsTypeOf(OT_VARDP)){
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W11u_zus).State(value.ToInteger());
}
!Maximaltemperatur
if(dom.GetObject(W11u_tempMax).IsTypeOf(OT_VARDP)){
posValueStart = "\"tx\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W11u_tempMax).State(value.ToInteger());
}
!Regenwahrscheinlichkeit
if(dom.GetObject(W11u_regen).IsTypeOf(OT_VARDP)){
posValueStart = "\"pc\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W11u_regen).State(value.ToInteger());
}
!Minimaltemperatur
if(dom.GetObject(W11u_tempMin).IsTypeOf(OT_VARDP)){
posValueStart = "\"tn\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W11u_tempMin).State(value.ToInteger());
}
!17:00 Uhr
posTmp = substring.Find("17:00");
substring2 = substring.Substr(posTmp, substring.Find("23:00") - posTmp);
!Wetterzustand
if(dom.GetObject(W17u_zus).IsTypeOf(OT_VARDP)){
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W17u_zus).State(value.ToInteger());
}
!Maximaltemperatur
if(dom.GetObject(W17u_tempMax).IsTypeOf(OT_VARDP)){
posValueStart = "\"tx\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W17u_tempMax).State(value.ToInteger());
}
!Regenwahrscheinlichkeit
if(dom.GetObject(W17u_regen).IsTypeOf(OT_VARDP)){
posValueStart = "\"pc\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W17u_regen).State(value.ToInteger());
}
!Minimaltemperatur
if(dom.GetObject(W17u_tempMin).IsTypeOf(OT_VARDP)){
posValueStart = "\"tn\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W17u_tempMin).State(value.ToInteger());
}
!23:00 Uhr
posTmp = substring.Find("23:00");
substring2 = substring.Substr(posTmp, substring.Length() - posTmp);
!Wetterzustand
if(dom.GetObject(W23u_zus).IsTypeOf(OT_VARDP)){
posValueStart = "\"w\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W23u_zus).State(value.ToInteger());
}
!Maximaltemperatur
if(dom.GetObject(W23u_tempMax).IsTypeOf(OT_VARDP)){
posValueStart = "\"tx\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W23u_tempMax).State(value.ToInteger());
}
!Regenwahrscheinlichkeit
if(dom.GetObject(W23u_regen).IsTypeOf(OT_VARDP)){
posValueStart = "\"pc\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W23u_regen).State(value.ToInteger());
}
!Minimaltemperatur
if(dom.GetObject(W23u_tempMin).IsTypeOf(OT_VARDP)){
posValueStart = "\"tn\":\"";
posValueEnd = "\",";
posValue = substring2.Find(posValueStart) + posValueStart.Length();
value = substring2.Substr(posValue, 5).StrValueByIndex(posValueEnd, 0);
dom.GetObject(W23u_tempMin).State(value.ToInteger());
}
Code: Alles auswählen
!WETTER:COM
! Version 3.1.1 auf tmp umgestellt
! Version 2.1.1 zustand als zeichenkette
! Version 1.1.1 aus Forum
!-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 = "156c45ccfac795fc13ebbb8e04484689";
! Hier der City Code
string tmpB = "DE0004160046";
! Meine Projektnummer
string tmpC = "podbiwetter";
string tmpR2 = "sonnig;leicht bewölkt;wolkig;bedeckt;Nebel;Sprühregen;Regen;Schnee;Schauer;Gewitter;leicht bewölkt;;;;;;;;;;wolkig;;;;;;;;;;bedeckt;;;;;;;;;;Nebel;;;;;Nebel;;;Nebel mit Reifbildung;Nebel mit Reifbildung;Sprühregen;leichter Sprühregen;;Sprühregen;;starker Sprühregen;leichter Sprühregen gefrierend;starker Sprühregen gefrierend;;;leichter Regen;leichter Regen;;mäßiger Regen;;starker Regen;leichter Regen gefrierend;mäßiger bis starker Regen gefrierend;leichter Schneeregen;starker Schneeregen;leichter Schneefall;leichter Schneefall;;mäßiger Schneefall;;starker Schneefall;;;;;leichter Regenschauer;Regenschauer;starker Regenschauer;leichter Schnee Regenschauer;starker Schnee Regenschauer;leichter Schneeschauer;mäßiger bis starker Schneeschauer;;;;Gewitter;;;;;leichtes Gewitter;starkes Gewitter;";
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(tmpR2.StrValueByIndex(";",(tmpI.ToInteger()).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(tmpR2.StrValueByIndex(";",(tmpI.ToInteger()).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(tmpR2.StrValueByIndex(";",(tmpI.ToInteger()).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(tmpR2.StrValueByIndex(";",(tmpI.ToInteger()).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(tmpR2.StrValueByIndex(";",(tmpI.ToInteger()).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(tmpR2.StrValueByIndex(";",(tmpI.ToInteger()).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(tmpR2.StrValueByIndex(";",(tmpI.ToInteger()).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(tmpR2.StrValueByIndex(";",(tmpI.ToInteger()).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(tmpR2.StrValueByIndex(";",(tmpI.ToInteger()).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(tmpR2.StrValueByIndex(";",(tmpI.ToInteger()).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(tmpR2.StrValueByIndex(";",(tmpI.ToInteger()).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(tmpR2.StrValueByIndex(";",(tmpI.ToInteger()).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());
};