Openweathermap (Wettervorhersage)

OK. Anscheinend wurde Google Wetter API eingestellt.

Noch jemand Vorschläge?

Also ich kann die Yahoo Wettervorhersage von „pleibing“ empfehlen.

https://www.symcon.de/forum/threads/23374-Wetter-im-Webfront-Style?highlight=yahoo+wetter

Läuft bei mir seit längerem problemlos.
Die Standard-Icons gefallen mir sehr gut. Vor allem ist die Optik durchgehend gleich (Webfront bzw. IPS APP).

Der einzigste Aufwand an dem Wetterbericht ist die kostenlose anmeldung zur erstellung des Abrufkeys…

So, habe jetzt auch die Pleibling Seite am Laufen.

Danke Pleibling!!!

Muss jetzt nur noch IPSView beibringen und dann ist alles schön :o)

Hi, und direkt doofe Frage.
Luftfeuchte und Regen bekomm ich ja ausgelesen wie auf der ersten Seite beschrieben.
Aber wie komme ich an so werte wie z.B. wind.speed ???
Da fehlt mir vermutlich nur die richtige Syntax.

Gruß

Kai

Hier habe ich mal ein Beispiel geposted…

json Hilfe gesucht

Grüße,
Chris

ah kappiert, den Pfeil dazwischen, danke dir!!!

und wie komm ich an den Array unter weather z.b. dran? mit „0“ will so nicht => habs [0] hätte getan :wink:

Hier mal das „aktuelle Wetter“, für alle die keine eigene Wetter-Station haben:

<?
/** Konfiguration: **/
$locationID = "2890199";

/************************************************************************************************************************************/
/** Variablen-Profil "OpenWeatherAPI" anlegen wenn nicht bereits vorhanden **/
if (!IPS_VariableProfileExists("OpenWeatherAPI"))
	IPS_CreateVariableProfile("OpenWeatherAPI", 1);

$content = Sys_GetURLContent("http://api.openweathermap.org/data/2.5/weather?id=".$locationID."&lang=de&units=metric&mode=json");
$json = json_decode($content);

/** Aktuelles Wetter über openweathermap auslesen & Variablen anlegen **/
$OrtID = CreateVariableByName($_IPS['SELF'], "Ort", 3, $profile = "", $icon = "", $pos = 0, $hidden=false);
$PressureID = CreateVariableByName($_IPS['SELF'], "Pressure", 2, $profile = "~AirPressure.F", $icon = "Gauge", $pos = 0, $hidden=false);
$TemperatureID = CreateVariableByName($_IPS['SELF'], "Temperatur", 2, $profile = "~Temperature", $icon = "Temperature", $pos = 0, $hidden=false);
$HumidityID = CreateVariableByName($_IPS['SELF'], "Humidity", 1, $profile = "~Humidity", $icon = "Gauge", $pos = 0, $hidden=false);
$WeatherDescID = CreateVariableByName($_IPS['SELF'], "Weather Description", 3, $profile = "", $icon = "", $pos = 0, $hidden=false);
$WindSpeedID =  CreateVariableByName($_IPS['SELF'], "Wind Speed", 2, $profile = "~WindSpeed.kmh", $icon = "WindSpeed", $pos = 0, $hidden=false);
$WindDirectionID =  CreateVariableByName($_IPS['SELF'], "Wind Direction", 2, $profile = "~WindDirection.F", $icon = "WindDirection", $pos = 0, $hidden=false);
$CloudsID = CreateVariableByName($_IPS['SELF'], "Cloud Cover", 1, $profile = "~Intensity.100", $icon = "Cloud", $pos = 0, $hidden=false);
$Rain3hID = CreateVariableByName($_IPS['SELF'], "Rain 3h", 2, $profile = "~Rainfall", $icon = "Rainfall", $pos = 0, $hidden=false);
$WeatherID = CreateVariableByName($_IPS['SELF'], "Weather ID", 1, $profile = "OpenWeatherAPI", $icon = "", $pos = 0, $hidden=false);
SetValueString($OrtID, $json->name);
SetValueFloat($TemperatureID, $json->main->temp);
SetValueFloat($PressureID, $json->main->pressure);
SetValueInteger($HumidityID, $json->main->humidity);
SetValueString($WeatherDescID, $json->weather[0]->description);
SetValueFloat($WindSpeedID, $json->wind->speed);
SetValueFloat($WindDirectionID, $json->wind->deg);
SetValueInteger($CloudsID, $json->clouds->all);
if(isset($json->rain->{'3h'}))
{
	SetValueFloat($Rain3hID, $json->rain->{'3h'});
}
else
{
   SetValueFloat($Rain3hID, 0);
}
SetValueInteger($WeatherID, $json->weather[0]->id);

/** Variablen-Profil "OpenWeatherAPI" aktualisieren **/
if (!IPS_VariableProfileExists("OpenWeatherAPI"))
	IPS_CreateVariableProfile("OpenWeatherAPI", 1);
	
IPS_SetVariableProfileAssociation("OpenWeatherAPI", $json->weather[0]->id, $json->weather[0]->description, "", -1);


/************************************************************************************************************************************/
/* IP Symcon-Variable anlegen
0	Legt eine Variable vom Typ Boolean an
1	Legt eine Variable vom Typ Integer an
2	Legt eine Variable vom Typ Float an
3	Legt eine Variable vom Typ String an
 */

if (!function_exists('CreateVariableByName'))
{
function CreateVariableByName($id, $name, $type, $profile = "", $icon = "", $pos = 0, $hidden=false)
{
  global $IPS_SELF;
  $vid = @IPS_GetVariableIDByName($name, $id);
  if($vid === false)
  {
    $vid = IPS_CreateVariable($type);
    IPS_SetParent($vid, $id);
    IPS_SetName($vid, $name);
    IPS_SetPosition($vid, $pos);
    IPS_SetIcon($vid, $icon);
    IPS_SetHidden($vid, $hidden);
    IPS_SetVariableCustomProfile($vid, $profile);
    IPS_SetInfo($vid, "this variable was created by script #$IPS_SELF");
  }
  return $vid;
}
}
?>

Viele Grüße,
Markus

Hallo
bekomme immer wen ich das Skript ausführe volgende Fehlermeldung:

Fatal error: Call to undefined function CreateVariableByName() in C:\IP-Symcon\scripts\40468.ips.php on line 14
PHP-Error-Error: Call to undefined function CreateVariableByName()
Error in Script C:\IP-Symcon\scripts\40468.ips.php on Line 14Abort Processing during Fatal-Error: Call to undefined function CreateVariableByName()
Error in Script C:\IP-Symcon\scripts\40468.ips.php on Line 14

hoffe es kann mir wehr helfen
Danke

Hallo,

falls du mein Script verwendest - prüfe mal, ob du wirklich das ganze Script kopiert hast.
Am unteren Ende findest du folgenden Abschnitt:

/************************************************************************************************************************************/ 
/* IP Symcon-Variable anlegen 
0    Legt eine Variable vom Typ Boolean an 
1    Legt eine Variable vom Typ Integer an 
2    Legt eine Variable vom Typ Float an 
3    Legt eine Variable vom Typ String an 
 */ 

if (!function_exists('CreateVariableByName')) 
{ 
function CreateVariableByName($id, $name, $type, $profile = "", $icon = "", $pos = 0, $hidden=false) 
{ 
  global $IPS_SELF; 
  $vid = @IPS_GetVariableIDByName($name, $id); 
  if($vid === false) 
  { 
    $vid = IPS_CreateVariable($type); 
    IPS_SetParent($vid, $id); 
    IPS_SetName($vid, $name); 
    IPS_SetPosition($vid, $pos); 
    IPS_SetIcon($vid, $icon); 
    IPS_SetHidden($vid, $hidden); 
    IPS_SetVariableCustomProfile($vid, $profile); 
    IPS_SetInfo($vid, "this variable was created by script #$IPS_SELF"); 
  } 
  return $vid; 
} 
} 

Dieser deklariert die Funktion, die gemäß deiner Fehlermeldung fehlt…
Wenn es sich um ein anderes Script handelt, dann versuche mal die Funktion an den Anfang oder an das Ende zu kopieren - dann sollte es klappen :-).

Kleiner Tipp für das nächste Mal: Nicht mit Infos geizen - dann gibt’s auch bessere Infos & Lösungshilfen :slight_smile:

Viele Grüße,
Markus

P.S.: Ich hatte tatsächlich am Anfang die Funktion nicht mit ins Script eingefügt, da sie bei mir in einer globalen Bibliothek ist… Ich hatte sie kurz nach dem ursprünglichen Post noch hinzugefügt. Falls du also zu schnell warst oder den Code aus der eMail-Benachrichtigung kopiert hast, dann war’s meine Schuld :slight_smile:

Hatte ich auch auf dem Pi.

Daher mal geändert, und rennt bei mir :


<?
/** Konfiguration: **/
$locationID = "2947641";

/************************************************************************************************************************************/
/** Variablen-Profil "OpenWeatherAPI" anlegen wenn nicht bereits vorhanden **/
if (!IPS_VariableProfileExists("OpenWeatherAPI"))
    IPS_CreateVariableProfile("OpenWeatherAPI", 1);

$content = Sys_GetURLContent("http://api.openweathermap.org/data/2.5/weather?id=".$locationID."&lang=de&units=metric&mode=json");
$json = json_decode($content);
// echo ($content);
/** Aktuelles Wetter über openweathermap auslesen & Variablen anlegen **/
$OrtID = CreateVariableByName($_IPS['SELF'], "Ort", 3, $profile = "", $icon = "", $pos = 0, $hidden=false);
$PressureID = CreateVariableByName($_IPS['SELF'], "Pressure", 2, $profile = "~AirPressure.F", $icon = "Gauge", $pos = 0, $hidden=false);
$TemperatureID = CreateVariableByName($_IPS['SELF'], "Temperatur", 2, $profile = "~Temperature", $icon = "Temperature", $pos = 0, $hidden=false);
$HumidityID = CreateVariableByName($_IPS['SELF'], "Humidity", 1, $profile = "~Humidity", $icon = "Gauge", $pos = 0, $hidden=false);
$WeatherDescID = CreateVariableByName($_IPS['SELF'], "Weather Description", 3, $profile = "", $icon = "", $pos = 0, $hidden=false);
$WindSpeedID =  CreateVariableByName($_IPS['SELF'], "Wind Speed", 2, $profile = "~WindSpeed.kmh", $icon = "WindSpeed", $pos = 0, $hidden=false);
$WindDirectionID =  CreateVariableByName($_IPS['SELF'], "Wind Direction", 2, $profile = "~WindDirection.F", $icon = "WindDirection", $pos = 0, $hidden=false);
$CloudsID = CreateVariableByName($_IPS['SELF'], "Cloud Cover", 1, $profile = "~Intensity.100", $icon = "Cloud", $pos = 0, $hidden=false);
$Rain3hID = CreateVariableByName($_IPS['SELF'], "Rain 3h", 2, $profile = "~Rainfall", $icon = "Rainfall", $pos = 0, $hidden=false);
$WeatherID = CreateVariableByName($_IPS['SELF'], "Weather_ID", 1, $profile = "OpenWeatherAPI", $icon = "", $pos = 0, $hidden=false);
SetValueString($OrtID, $json->name);
SetValueFloat($TemperatureID, $json->main->temp);
SetValueFloat($PressureID, $json->main->pressure);
SetValueInteger($HumidityID, $json->main->humidity);
SetValueString($WeatherDescID, $json->weather[0]->description);
SetValueInteger($WeatherID, $json->weather[0]->id);
SetValueFloat($WindSpeedID, $json->wind->speed);
SetValueFloat($WindDirectionID, $json->wind->deg);
SetValueInteger($CloudsID, $json->clouds->all);
SetValueFloat($Rain3hID, $json->rain->{'3h'});
/** Variablen-Profil "OpenWeatherAPI" aktualisieren **/
if (!IPS_VariableProfileExists("OpenWeatherAPI"))
    IPS_CreateVariableProfile("OpenWeatherAPI", 1);

IPS_SetVariableProfileAssociation("OpenWeatherAPI", $json->weather[0]->id, $json->weather[0]->description, "", -1);


/************************************************************************************************************************************/
/* IP Symcon-Variable anlegen
0    Legt eine Variable vom Typ Boolean an
1    Legt eine Variable vom Typ Integer an
2    Legt eine Variable vom Typ Float an
3    Legt eine Variable vom Typ String an
 */


function CreateVariableByName($id, $name, $type, $profile = "", $icon = "", $pos = 0, $hidden=false)
{
  global $_IPS;
  $vid = @IPS_GetVariableIDByName($name, $id);
  if($vid === false)
  {
    $vid = IPS_CreateVariable($type);
    IPS_SetParent($vid, $id);
    IPS_SetName($vid, $name);
    IPS_SetPosition($vid, $pos);
    IPS_SetIcon($vid, $icon);
    IPS_SetHidden($vid, $hidden);
    IPS_SetVariableCustomProfile($vid, $profile);
    IPS_SetInfo($vid, "this variable was created by script #".$_IPS['SELF']);
  }
  return $vid;
}

?>

Hallo Thomas Danke für die schnelle Antwort jetzt funktioniert soweit das meiste bekomme nur noch diese Fehlermeldung:
PHP-Error-Notice: Undefined property: stdClass::$rain
Error in Script C:\IP-Symcon\scripts\18455.ips.php on Line 33
Notice: Undefined property: stdClass::$rain in C:\IP-Symcon\scripts\18455.ips.php on line 33
PHP-Error-Notice: Trying to get property of non-object
Error in Script C:\IP-Symcon\scripts\18455.ips.php on Line 33
Notice: Trying to get property of non-object in C:\IP-Symcon\scripts\18455.ips.php on line 33

Danke Lg Stefan

Hallo Stefan,

ich weiß woran das liegt - „rain“ ist in der json API als optional hinterlegt - und wird nicht immer über die Schnittstelle bereit gestellt… Ich denke an dieser Stelle muss mein Script nochmal angepasst werden.

Entweder du passt das Script eigenständig an (z.B. mit ‚if isset‘) - oder du wartest bis ich das Update fertig habe :slight_smile:

Grüße,
Markus

Hallo Markus,

genau so ist es mit „rain“, war auch nur ein Schnellschuss es auf den Pi anzupassen.
Leider sind die Wetterdaten von meinem Wohort da nicht sehr genau, da ist meine eigene „Wetterhütte“ besser.:smiley:
Ich habe da eine Elsner Wetterstation am LCN, und Eigenbau am LCN der die von Elsner fehlenden Werte, wie auch genauere Temperaturen liefert.
Dein Skript ist schon gut, ersetzt aber leider nicht die „vor Ort“ Daten, wie jeder andere „Wetterbericht“.

Danke für die Mühe bin schon am überlegen eine Wetterstation mir zu kaufen ist halt bei meinen KNX System nicht gerade die billigste Variante :wink:

HM somm,
stimmt schon, aber es gibt andere Wege.
Da ist dann halt basteln per Atmega oder Raspberry angesagt.

Ich habe eine Elsner per RS485 am Atmega hängen, der Rest kommt auch von einem anderen Atmega (Luftdruck, Feuchte, Regenmenge usw…)
Habe alles in LCN „gesendet“, aber auch das könnte man direkt an IPS z.B. per Raspberry machen.
Es gibt so viele Wege, ich habe mich halt auf die Übertragung in LCN festgelegt.
Soll nur ein Gedankenansatzt sein, machbar ist vieles…

Hallo Zusammen,

ich hatte ganz vergessen, das aktualisierte Script mit Berücksichtigung des optionalen Merkmals „rain“ zur Verfügung stellen…

Geändert wurde eigentlich nur folgender Abschnitt:

if(isset($json->rain->{'3h'}))
{
	SetValueFloat($Rain3hID, $json->rain->{'3h'});
}
else
{
   SetValueFloat($Rain3hID, 0);
}

Viele Grüße,
Markus

<?
/** Konfiguration: **/
$locationID = "2890199";

/************************************************************************************************************************************/
/** Variablen-Profil "OpenWeatherAPI" anlegen wenn nicht bereits vorhanden **/
if (!IPS_VariableProfileExists("OpenWeatherAPI"))
    IPS_CreateVariableProfile("OpenWeatherAPI", 1);

$content = Sys_GetURLContent("http://api.openweathermap.org/data/2.5/weather?id=".$locationID."&lang=de&units=metric&mode=json");
$json = json_decode($content);

/** Aktuelles Wetter über openweathermap auslesen & Variablen anlegen **/
$OrtID = CreateVariableByName($_IPS['SELF'], "Ort", 3, $profile = "", $icon = "", $pos = 0, $hidden=false);
$PressureID = CreateVariableByName($_IPS['SELF'], "Pressure", 2, $profile = "~AirPressure.F", $icon = "Gauge", $pos = 0, $hidden=false);
$TemperatureID = CreateVariableByName($_IPS['SELF'], "Temperatur", 2, $profile = "~Temperature", $icon = "Temperature", $pos = 0, $hidden=false);
$HumidityID = CreateVariableByName($_IPS['SELF'], "Humidity", 1, $profile = "~Humidity", $icon = "Gauge", $pos = 0, $hidden=false);
$WeatherDescID = CreateVariableByName($_IPS['SELF'], "Weather Description", 3, $profile = "", $icon = "", $pos = 0, $hidden=false);
$WindSpeedID =  CreateVariableByName($_IPS['SELF'], "Wind Speed", 2, $profile = "~WindSpeed.kmh", $icon = "WindSpeed", $pos = 0, $hidden=false);
$WindDirectionID =  CreateVariableByName($_IPS['SELF'], "Wind Direction", 2, $profile = "~WindDirection.F", $icon = "WindDirection", $pos = 0, $hidden=false);
$CloudsID = CreateVariableByName($_IPS['SELF'], "Cloud Cover", 1, $profile = "~Intensity.100", $icon = "Cloud", $pos = 0, $hidden=false);
$Rain3hID = CreateVariableByName($_IPS['SELF'], "Rain 3h", 2, $profile = "~Rainfall", $icon = "Rainfall", $pos = 0, $hidden=false);
$WeatherID = CreateVariableByName($_IPS['SELF'], "Weather ID", 1, $profile = "OpenWeatherAPI", $icon = "", $pos = 0, $hidden=false);
SetValueString($OrtID, $json->name);
SetValueFloat($TemperatureID, $json->main->temp);
SetValueFloat($PressureID, $json->main->pressure);
SetValueInteger($HumidityID, $json->main->humidity);
SetValueString($WeatherDescID, $json->weather[0]->description);
SetValueFloat($WindSpeedID, $json->wind->speed);
SetValueFloat($WindDirectionID, $json->wind->deg);
SetValueInteger($CloudsID, $json->clouds->all);
if(isset($json->rain->{'3h'}))
{
    SetValueFloat($Rain3hID, $json->rain->{'3h'});
}
else
{
   SetValueFloat($Rain3hID, 0);
}
SetValueInteger($WeatherID, $json->weather[0]->id);

/** Variablen-Profil "OpenWeatherAPI" aktualisieren **/
if (!IPS_VariableProfileExists("OpenWeatherAPI"))
    IPS_CreateVariableProfile("OpenWeatherAPI", 1);
    
IPS_SetVariableProfileAssociation("OpenWeatherAPI", $json->weather[0]->id, $json->weather[0]->description, "", -1);


/************************************************************************************************************************************/
/* IP Symcon-Variable anlegen
0    Legt eine Variable vom Typ Boolean an
1    Legt eine Variable vom Typ Integer an
2    Legt eine Variable vom Typ Float an
3    Legt eine Variable vom Typ String an
 */

if (!function_exists('CreateVariableByName'))
{
function CreateVariableByName($id, $name, $type, $profile = "", $icon = "", $pos = 0, $hidden=false)
{
  global $IPS_SELF;
  $vid = @IPS_GetVariableIDByName($name, $id);
  if($vid === false)
  {
    $vid = IPS_CreateVariable($type);
    IPS_SetParent($vid, $id);
    IPS_SetName($vid, $name);
    IPS_SetPosition($vid, $pos);
    IPS_SetIcon($vid, $icon);
    IPS_SetHidden($vid, $hidden);
    IPS_SetVariableCustomProfile($vid, $profile);
    IPS_SetInfo($vid, "this variable was created by script #$IPS_SELF");
  }
  return $vid;
}
}
?>

Hab das obige Script von Markus mal probiert. Es bringt die Fehlermeldung Fatal error: Call to undefined function CeateVariableByName() in C:\IP-Symcon\scripts\50641.ips.php on line 15
Die function sieht auch etwas merkwürdig aus. Was soll das >>>if (!function_exists(‚CreateVariableByName‘))<<< davor?

if (!function_exists(‚CreateVariableByName‘)) // Wenn die Funktion CreateVariableByName nicht existiert
{ // dann…
function CreateVariableByName($id, $name, $type, $profile = „“, $icon = „“, $pos = 0, $hidden=false) // lege die Funktion CreateVariableByName an…
{
[XXX]
}
}

Wenn du eine Funktion deklarierst die bereits im System deklariert wurde (z.B. durch eine globale Funktionsbibliothek), kommt es zu einem Scriptfehler. Daher wird normalerweise vor der Deklaration (Anlegen der Funktion) geprüft ob diese bereits existiert…
Ich habe bei mir ein zentrales File, dass in jedes Script eingebunden wird. In diesem werden derartige Funktionen IPS-Weit zur Verfügung gestellt, dann brauch ich nicht jedes Mal das Rad neu zu erfinden & das Programmieren in IPS wird schneller & effizienter.

Hmm, also eigentlich kann daher deine Fehlermeldung so fast nicht passen… auf jeden Fall nicht wenn du das ganze Script kopiert hast. Probiere sonst mal den Block an den Anfang des Scripts zu kopieren:

<? 
/** 
   Konfiguration: 
**/ 
$locationID = "2890199"; 
/************************************************************************************************************************************/ 
/* IP Symcon-Variable anlegen 
0    Legt eine Variable vom Typ Boolean an 
1    Legt eine Variable vom Typ Integer an 
2    Legt eine Variable vom Typ Float an 
3    Legt eine Variable vom Typ String an 
 */ 

if (!function_exists('CreateVariableByName')) 
{ 
function CreateVariableByName($id, $name, $type, $profile = "", $icon = "", $pos = 0, $hidden=false) 
{ 
  global $IPS_SELF; 
  $vid = @IPS_GetVariableIDByName($name, $id); 
  if($vid === false) 
  { 
    $vid = IPS_CreateVariable($type); 
    IPS_SetParent($vid, $id); 
    IPS_SetName($vid, $name); 
    IPS_SetPosition($vid, $pos); 
    IPS_SetIcon($vid, $icon); 
    IPS_SetHidden($vid, $hidden); 
    IPS_SetVariableCustomProfile($vid, $profile); 
    IPS_SetInfo($vid, "this variable was created by script #$IPS_SELF"); 
  } 
  return $vid; 
} 
} 

/************************************************************************************************************************************/ 
/** Variablen-Profil "OpenWeatherAPI" anlegen wenn nicht bereits vorhanden **/ 
if (!IPS_VariableProfileExists("OpenWeatherAPI")) 
    IPS_CreateVariableProfile("OpenWeatherAPI", 1); 

$content = Sys_GetURLContent("http://api.openweathermap.org/data/2.5/weather?id=".$locationID."&lang=de&units=metric&mode=json"); 
$json = json_decode($content); 

/** Aktuelles Wetter über openweathermap auslesen & Variablen anlegen **/ 
$OrtID = CreateVariableByName($_IPS['SELF'], "Ort", 3, $profile = "", $icon = "", $pos = 0, $hidden=false); 
$PressureID = CreateVariableByName($_IPS['SELF'], "Pressure", 2, $profile = "~AirPressure.F", $icon = "Gauge", $pos = 0, $hidden=false); 
$TemperatureID = CreateVariableByName($_IPS['SELF'], "Temperatur", 2, $profile = "~Temperature", $icon = "Temperature", $pos = 0, $hidden=false); 
$HumidityID = CreateVariableByName($_IPS['SELF'], "Humidity", 1, $profile = "~Humidity", $icon = "Gauge", $pos = 0, $hidden=false); 
$WeatherDescID = CreateVariableByName($_IPS['SELF'], "Weather Description", 3, $profile = "", $icon = "", $pos = 0, $hidden=false); 
$WindSpeedID =  CreateVariableByName($_IPS['SELF'], "Wind Speed", 2, $profile = "~WindSpeed.kmh", $icon = "WindSpeed", $pos = 0, $hidden=false); 
$WindDirectionID =  CreateVariableByName($_IPS['SELF'], "Wind Direction", 2, $profile = "~WindDirection.F", $icon = "WindDirection", $pos = 0, $hidden=false); 
$CloudsID = CreateVariableByName($_IPS['SELF'], "Cloud Cover", 1, $profile = "~Intensity.100", $icon = "Cloud", $pos = 0, $hidden=false); 
$Rain3hID = CreateVariableByName($_IPS['SELF'], "Rain 3h", 2, $profile = "~Rainfall", $icon = "Rainfall", $pos = 0, $hidden=false); 
$WeatherID = CreateVariableByName($_IPS['SELF'], "Weather ID", 1, $profile = "OpenWeatherAPI", $icon = "", $pos = 0, $hidden=false); 
SetValueString($OrtID, $json->name); 
SetValueFloat($TemperatureID, $json->main->temp); 
SetValueFloat($PressureID, $json->main->pressure); 
SetValueInteger($HumidityID, $json->main->humidity); 
SetValueString($WeatherDescID, $json->weather[0]->description); 
SetValueFloat($WindSpeedID, $json->wind->speed); 
SetValueFloat($WindDirectionID, $json->wind->deg); 
SetValueInteger($CloudsID, $json->clouds->all); 
if(isset($json->rain->{'3h'})) 
{ 
    SetValueFloat($Rain3hID, $json->rain->{'3h'}); 
} 
else 
{ 
   SetValueFloat($Rain3hID, 0); 
} 
SetValueInteger($WeatherID, $json->weather[0]->id); 

/** Variablen-Profil "OpenWeatherAPI" aktualisieren **/ 
if (!IPS_VariableProfileExists("OpenWeatherAPI")) 
    IPS_CreateVariableProfile("OpenWeatherAPI", 1); 
     
IPS_SetVariableProfileAssociation("OpenWeatherAPI", $json->weather[0]->id, $json->weather[0]->description, "", -1); 
?>

Ich habe #34, unteres Skript, komplett übernommen und bekomme die Fehlermeldung.

if (!function_exists(‚CreateVariableByName‘)) und letzte Klammer entfernt und alles ist schön.

Auch das global $IPS_SELF (ist noch vorhanden) habe ich noch nicht kapiert. Sollte doch eigentlich in IPS 3.x nicht mehr nötig sein. Egal es läuft.

Besten Dank. Das Problem hatte ich nämlich auch.
Mit dem verlegen an den Anfang des Scripts habe ich endlich kein Fehler 14 mehr.

Gruss
Danny