Wettervorhersage mit wetter.com

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

Moderator: Co-Administratoren

Benutzeravatar
joni-blue
Beiträge: 1173
Registriert: 04.01.2012, 12:20
System: CCU
Wohnort: Hannover
Hat sich bedankt: 6 Mal
Danksagung erhalten: 1 Mal

Re: Wettervorhersage mit wetter.com

Beitrag von joni-blue » 13.05.2016, 17:26

hier umgeschrieben auf Zeichenkette den Wetterzustand

einfach die Variablen Wetter_heute_X_zustand auf Zeichenkette ändern

Code: Alles auswählen

!	Version 2.1.1 zustand als zeichenkette

!	Version 1.1.1 aus Forum

string tmpC = "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;";

!-----------------------------------------------------------------------------
! Hier alle was man verändern kann/muss
! Voraussetzung: CUxD und ein Wetter.com Account
!-----------------------------------------------------------------------------
string apikey = "xxxxx";
string cityCode = "xxxxx";
string projectName = "xxxxxx";

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(tmpC.StrValueByIndex(";",(value.ToInteger()).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(tmpC.StrValueByIndex(";",(value.ToInteger()).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(tmpC.StrValueByIndex(";",(value.ToInteger()).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(tmpC.StrValueByIndex(";",(value.ToInteger()).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(tmpC.StrValueByIndex(";",(value.ToInteger()).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(tmpC.StrValueByIndex(";",(value.ToInteger()).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(tmpC.StrValueByIndex(";",(value.ToInteger()).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(tmpC.StrValueByIndex(";",(value.ToInteger()).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(tmpC.StrValueByIndex(";",(value.ToInteger()).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(tmpC.StrValueByIndex(";",(value.ToInteger()).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(tmpC.StrValueByIndex(";",(value.ToInteger()).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(tmpC.StrValueByIndex(";",(value.ToInteger()).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());
}
Reboot tut gut ! ! !

Benutzeravatar
joni-blue
Beiträge: 1173
Registriert: 04.01.2012, 12:20
System: CCU
Wohnort: Hannover
Hat sich bedankt: 6 Mal
Danksagung erhalten: 1 Mal

Re: Wettervorhersage mit wetter.com

Beitrag von joni-blue » 13.05.2016, 17:53

nein, da war ja was. jetzt muss ich das script auf tmp umstellen damit ich nicht über 200 variablen komme
Reboot tut gut ! ! !

Benutzeravatar
joni-blue
Beiträge: 1173
Registriert: 04.01.2012, 12:20
System: CCU
Wohnort: Hannover
Hat sich bedankt: 6 Mal
Danksagung erhalten: 1 Mal

Re: Wettervorhersage mit wetter.com

Beitrag von joni-blue » 13.05.2016, 18:28

hier mit tmp und Text anstatt zahlen beim wetter zustand

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());
    };
Reboot tut gut ! ! !

Benutzeravatar
joni-blue
Beiträge: 1173
Registriert: 04.01.2012, 12:20
System: CCU
Wohnort: Hannover
Hat sich bedankt: 6 Mal
Danksagung erhalten: 1 Mal

Re: Wettervorhersage mit wetter.com

Beitrag von joni-blue » 14.05.2016, 10:47

Bildschirmausschnitt.png
kann mann den Text von wetter.com in eine Variable bekommen?
Reboot tut gut ! ! !

mike08
Beiträge: 283
Registriert: 13.09.2015, 11:18
System: Alternative CCU (auf Basis OCCU)
Hat sich bedankt: 3 Mal
Danksagung erhalten: 2 Mal

Re: Wettervorhersage mit wetter.com

Beitrag von mike08 » 16.05.2016, 23:20

Hallo!

Trotz Anmeldung bei Wetter.com, komme ich nicht zu den folgenden Informationen:
! Hier der City Code
string tmpB = "DE0004160046";

! Meine Projektnummer
string tmpC = "podbiwetter";

Wo finde ich diese? Vielleicht sitzt das Problem vor dem Monitor! :wink:

Grüßé
Michael
Fritzbox 7590 mit 7.x (immer aktuell)
Raspberry Pi3b mit RM: Aktuell
CCU2: Abgeschaltet
Zusatzsoftware: CUx-Daemon, E-Mail CCU Addon, hm_pdetect, hm-Print
Skripte: Servicemeldung 1.x http://homematic-forum.de/forum/viewtop ... 18#p211604
ioBroker auf Synology DS916+II imTest;
Wandtermostat, Tür-/Fensterkontakt, Ausenthermostat, 1 Kanal Taster, 2 Kanal Taster, Hutch-4fach Aktor, 1fach UP-Aktor, 2fach UP-Aktor, E-Paper-Display; CUL868(v3), USB2.0-Ser! [FF]

Benutzeravatar
joni-blue
Beiträge: 1173
Registriert: 04.01.2012, 12:20
System: CCU
Wohnort: Hannover
Hat sich bedankt: 6 Mal
Danksagung erhalten: 1 Mal

Re: Wettervorhersage mit wetter.com

Beitrag von joni-blue » 18.05.2016, 12:43

Hi. Du musst dir das selber anlegen als Projekt. Das ist mein Projekt du greifst damit mein Wetter in Hannover ab falls die Daten da noch Stimmen


Gesendet von iPhone mit Tapatalk
Reboot tut gut ! ! !

mike08
Beiträge: 283
Registriert: 13.09.2015, 11:18
System: Alternative CCU (auf Basis OCCU)
Hat sich bedankt: 3 Mal
Danksagung erhalten: 2 Mal

Re: Wettervorhersage mit wetter.com

Beitrag von mike08 » 18.05.2016, 14:37

joni-blue hat geschrieben:Hi. Du musst dir das selber anlegen als Projekt. Das ist mein Projekt du greifst damit mein Wetter in Hannover ab...
Hallo!
Das ist klar. Ich kann kein Projekt erstellen, obwohl ich registriert bin. Aber vielleicht ist das Problem vor dem Monitor. ;-)

Nur wie lege ich eine Projekt an?

Grüße
Michael
Fritzbox 7590 mit 7.x (immer aktuell)
Raspberry Pi3b mit RM: Aktuell
CCU2: Abgeschaltet
Zusatzsoftware: CUx-Daemon, E-Mail CCU Addon, hm_pdetect, hm-Print
Skripte: Servicemeldung 1.x http://homematic-forum.de/forum/viewtop ... 18#p211604
ioBroker auf Synology DS916+II imTest;
Wandtermostat, Tür-/Fensterkontakt, Ausenthermostat, 1 Kanal Taster, 2 Kanal Taster, Hutch-4fach Aktor, 1fach UP-Aktor, 2fach UP-Aktor, E-Paper-Display; CUL868(v3), USB2.0-Ser! [FF]

Benutzeravatar
joni-blue
Beiträge: 1173
Registriert: 04.01.2012, 12:20
System: CCU
Wohnort: Hannover
Hat sich bedankt: 6 Mal
Danksagung erhalten: 1 Mal

Re: Wettervorhersage mit wetter.com

Beitrag von joni-blue » 18.05.2016, 16:47

vorher bei wetter.com anmelden und dann den link öffnen. geht bei mir auch nur so

http://at.wetter.com/apps_und_mehr/webs ... /projekte/
Reboot tut gut ! ! !

mike08
Beiträge: 283
Registriert: 13.09.2015, 11:18
System: Alternative CCU (auf Basis OCCU)
Hat sich bedankt: 3 Mal
Danksagung erhalten: 2 Mal

Re: Wettervorhersage mit wetter.com

Beitrag von mike08 » 19.05.2016, 19:04

joni-blue hat geschrieben:vorher bei wetter.com anmelden und dann den link öffnen. geht bei mir auch nur sohttp://at.wetter.com/apps_und_mehr/webs ... /projekte/
Danke!

Jetzt suche ich mir den Wolf, da ich den City-Code für Wiesbaden nicht finde! -(

Grüße
Michael
Fritzbox 7590 mit 7.x (immer aktuell)
Raspberry Pi3b mit RM: Aktuell
CCU2: Abgeschaltet
Zusatzsoftware: CUx-Daemon, E-Mail CCU Addon, hm_pdetect, hm-Print
Skripte: Servicemeldung 1.x http://homematic-forum.de/forum/viewtop ... 18#p211604
ioBroker auf Synology DS916+II imTest;
Wandtermostat, Tür-/Fensterkontakt, Ausenthermostat, 1 Kanal Taster, 2 Kanal Taster, Hutch-4fach Aktor, 1fach UP-Aktor, 2fach UP-Aktor, E-Paper-Display; CUL868(v3), USB2.0-Ser! [FF]

Jeeper.at
Beiträge: 380
Registriert: 05.01.2016, 09:27
Wohnort: Wien
Hat sich bedankt: 19 Mal
Danksagung erhalten: 1 Mal

Re: Wettervorhersage mit wetter.com

Beitrag von Jeeper.at » 19.05.2016, 19:36

Wiesbaden: DE0011578

Antworten

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