"Ösi" Wetterseite

Ok, ich seh mir das in den nächsten Tagen mal an. Dachte ich warte mal wie erfolgreich Hofimax ist…

OK, neue Version ist Online

Einfach die Datei IPSWeather_Refresh.ips.php über die bestehende kopieren und die URL in der Konfigurations Datei entsprechend anpassen.

funktioniert wunderbar, danke :wink:

Ach, da bastel ich grad dran rum ums zu reprieren.
Surf zwischendurch ein bisl ins IPS Forum und schon wird eine fertige Lösung präsentiert.:eek:

schönen Dank, funktioniert fein.
bb

Danke! :cool:

super! Danke fürs Update.
Gruß,
Roman
:loveips:

Hallo Leute

Habe auch das mal versucht so einzubauen.

Nun habe ich im Webfront diese Meldung und ehrlich gesagt weis ich nicht nach was ich suchen muss.
Laut der Meldung im C ordner aber da finde ich diese Variable nicht!

Vielleicht könnt ihr mir sagen was ich da ändern muss.

Installation wie folgt:
Alle Files aus dem Verzeichnis „scripts“ in das IPS Scripts Verzeichnis kopieren
Alle Files aus den Verzeichnis „user\Weather\“ in „…\webfront\user\Weather“ kopieren
IPSWeather_Installation.ips.php anlegen und ausführen
Im Webfront Konfigurator eine Seite mit der URL „user\Weather\Weather.php“ anlegen

Das habe ich so gemacht den IPSInstaller habe ich nicht gemacht.
Denke den brauche ich auch nicht.

vielen Dank

Da ist beim Ausführen des Scripts IPSWeather_Installation.ips.php was schief gegangen - der IPSInstaller muß im Scripts Verzeichnis vorhanden sein (einfach reinkopieren).

Starte das Installation Script nochmals und sieh Dir den Output in der Konsole an!

Hallo

So habe ich den drinnen.

Meinst hier einfach dazukopieren?

Welchen Installler soll ich den da nehmen??

… Du mußt den Inhalt von IPSWeather_Installation in das Script einfügen -also:


<?
	include_once "IPSInstaller.ips.php";

	$ProgramPath  = 'Program.Weather';
	$iPhonePath   = 'iPhone.Wetter';

	// ----------------------------------------------------------------------------------------------------------------------------
	// Program Installation
	// ----------------------------------------------------------------------------------------------------------------------------
	$CategoryIdWeather = CreateCategoryPath($ProgramPath);
	$CategoryIdScripts = CreateCategory('Scripts', $CategoryIdWeather, 10);
	$CategoryIdForecast = CreateCategory('Forecast', $CategoryIdWeather, 20);
	$CategoryIdForecastToday = CreateCategory('Today',     $CategoryIdForecast, 10);
	$CategoryIdForecast1     = CreateCategory('Forecast 1', $CategoryIdForecast, 20);
	$CategoryIdForecast2     = CreateCategory('Forecast 2', $CategoryIdForecast, 30);
	$CategoryIdForecast3     = CreateCategory('Forecast 3', $CategoryIdForecast, 40);
	IPS_SetHidden($CategoryIdScripts, true);

	// Scripts
	IPS_SetParent($IPS_SELF, $CategoryIdScripts);
   $ScriptIdConstants       = CreateScript('IPSWeather_Constants',       'IPSWeather_Constants.ips.php',       $CategoryIdScripts, 10);
   $ScriptIdConfiguration   = CreateScript('IPSWeather_Configuration',   'IPSWeather_Configuration.ips.php',   $CategoryIdScripts, 20);
   $ScriptIdRefresh         = CreateScript('IPSWeather_Refresh',         'IPSWeather_Refresh.ips.php',         $CategoryIdScripts, 30);

	// Timer
	CreateTimer_CyclicByMinutes ('Refresh', $ScriptIdRefresh, 30);

	// Create Variables
	$TodayDayOfWeek          = CreateVariable("DayOfWeek",            3 /*String*/,  $CategoryIdForecastToday,  10,  '~String',  null, '');
	$TodayTempCurrent        = CreateVariable("Temperature Current",  1 /*Integer*/, $CategoryIdForecastToday,  20,  null,       null, 0);
	$TodayTempMin            = CreateVariable("Temperature_Min",      1 /*Integer*/, $CategoryIdForecastToday,  30,  null,       null, 0);
	$TodayTempMax            = CreateVariable("Temperature_Max",      1 /*Integer*/, $CategoryIdForecastToday,  40,  null,       null, 0);
	$TodaySeaLevel           = CreateVariable("SeaLevel",             1 /*Integer*/, $CategoryIdForecastToday,  50,  null,       null, 0);
	$TodayAirHumidity        = CreateVariable("Air Humidity",         3 /*String*/,  $CategoryIdForecastToday,  60,  '~String',  null, '');
	$TodayWind               = CreateVariable("Wind",                 3 /*String*/,  $CategoryIdForecastToday,  70,  '~String',  null, '');
	$TodayIcon               = CreateVariable("Icon",                 3 /*String*/,  $CategoryIdForecastToday,  80,  '~String',  null, '');
	$TodayTextShort          = CreateVariable("TextLong",             3 /*String*/,  $CategoryIdForecastToday,  90,  '~String',  null, '');
	$TodayTextLong           = CreateVariable("TextShort",            3 /*String*/,  $CategoryIdForecastToday,  100, '~String',  null, '');
	$LastRefreshDateTime     = CreateVariable("LastRefresh DateTime", 3 /*String*/,  $CategoryIdForecastToday,  110, '~String',  null, '');
	$LastRefreshTime         = CreateVariable("LastRefresh Time",     3 /*String*/,  $CategoryIdForecastToday,  120, '~String',  null, '');

	$Forecast1DayOfWeek       = CreateVariable("DayOfWeek",            3 /*String*/,  $CategoryIdForecast1    ,  10,  '~String',  null, '');
	$Forecast1TempMin         = CreateVariable("Temperature_Min",      1 /*Integer*/, $CategoryIdForecast1    ,  20,  null,       null, 0);
	$Forecast1TempMax         = CreateVariable("Temperature_Max",      1 /*Integer*/, $CategoryIdForecast1    ,  30,  null,       null, 0);
	$Forecast1TextShort       = CreateVariable("TextLong",             3 /*String*/,  $CategoryIdForecast1    ,  40,  '~String',  null, '');
	$Forecast1TextLong        = CreateVariable("TextShort",            3 /*String*/,  $CategoryIdForecast1    ,  50,  '~String',  null, '');
	$Forecast1Icon            = CreateVariable("Icon",                 3 /*String*/,  $CategoryIdForecast1    ,  60,  '~String',  null, '');

	$Forecast2DayOfWeek       = CreateVariable("DayOfWeek",            3 /*String*/,  $CategoryIdForecast2    ,  10,  '~String',  null, '');
	$Forecast2TempMin         = CreateVariable("Temperature_Min",      1 /*Integer*/, $CategoryIdForecast2    ,  20,  null,       null, 0);
	$Forecast2TempMax         = CreateVariable("Temperature_Max",      1 /*Integer*/, $CategoryIdForecast2    ,  30,  null,       null, 0);
	$Forecast2TextShort       = CreateVariable("TextLong",             3 /*String*/,  $CategoryIdForecast2    ,  40,  '~String',  null, '');
	$Forecast2TextLong        = CreateVariable("TextShort",            3 /*String*/,  $CategoryIdForecast2    ,  50,  '~String',  null, '');
	$Forecast2Icon            = CreateVariable("Icon",                 3 /*String*/,  $CategoryIdForecast2    ,  60,  '~String',  null, '');

	$Forecast3DayOfWeek       = CreateVariable("DayOfWeek",            3 /*String*/,  $CategoryIdForecast3    ,  10,  '~String',  null, '');
	$Forecast3TempMin         = CreateVariable("Temperature_Min",      1 /*Integer*/, $CategoryIdForecast3    ,  20,  null,       null, 0);
	$Forecast3TempMax         = CreateVariable("Temperature_Max",      1 /*Integer*/, $CategoryIdForecast3    ,  30,  null,       null, 0);
	$Forecast3TextShort       = CreateVariable("TextLong",             3 /*String*/,  $CategoryIdForecast3    ,  40,  '~String',  null, '');
	$Forecast3TextLong        = CreateVariable("TextShort",            3 /*String*/,  $CategoryIdForecast3    ,  50,  '~String',  null, '');
	$Forecast3Icon            = CreateVariable("Icon",                 3 /*String*/,  $CategoryIdForecast3    ,  60,  '~String',  null, '');

	$iForecast                = CreateVariable("iForecast",             3 /*String*/,  $CategoryIdWeather     ,  100, '~HTMLBox', null, '<iframe frameborder="0" width="100%" height="4000px" src="../user/Weather/Weather.php"</iframe>');

	// Register Constants
	SetVariableConstant ('c_ID_TodayDay',               $TodayDayOfWeek,       'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_LastRefreshDateTime',    $LastRefreshDateTime,  'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_LastRefreshTime',        $LastRefreshTime,      'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_TodayForecastLong',      $TodayTextLong,        'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_TodayForecastShort',     $TodayTextShort,       'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_TodayIcon',              $TodayIcon,            'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_Wind',                   $TodayWind,            'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_SeaLevel',               $TodaySeaLevel,        'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_AirHumidity',            $TodayAirHumidity,     'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_TodayTempCurrent',       $TodayTempCurrent,     'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_TodayTempMax',           $TodayTempMax,         'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_TodayTempMin',           $TodayTempMin,         'IPSWeather_Constants.ips.php');

	SetVariableConstant ('c_ID_TomorrowDay',            $Forecast1DayOfWeek,    'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_TomorrowTempMax',        $Forecast1TempMax,      'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_TomorrowTempMin',        $Forecast1TempMin,      'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_TomorrowForecastLong',   $Forecast1TextLong,     'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_TomorrowForecastShort',  $Forecast1TextShort,    'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_TomorrowIcon',           $Forecast1Icon,         'IPSWeather_Constants.ips.php');

	SetVariableConstant ('c_ID_Tomorrow1Day',           $Forecast2DayOfWeek,    'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_Tomorrow1TempMax',       $Forecast2TempMax,      'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_Tomorrow1TempMin',       $Forecast2TempMin,      'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_Tomorrow1ForecastLong',  $Forecast2TextLong,     'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_Tomorrow1ForecastShort', $Forecast2TextShort,    'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_Tomorrow1Icon',          $Forecast2Icon,         'IPSWeather_Constants.ips.php');

	SetVariableConstant ('c_ID_Tomorrow2Day',           $Forecast3DayOfWeek,    'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_Tomorrow2TempMax',       $Forecast3TempMax,      'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_Tomorrow2TempMin',       $Forecast3TempMin,      'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_Tomorrow2ForecastLong',  $Forecast3TextLong,     'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_Tomorrow2ForecastShort', $Forecast3TextShort,    'IPSWeather_Constants.ips.php');
	SetVariableConstant ('c_ID_Tomorrow2Icon',          $Forecast3Icon,         'IPSWeather_Constants.ips.php');

	// Execute Data Refresh
	include_once "IPSWeather_Refresh.ips.php";

	// ----------------------------------------------------------------------------------------------------------------------------
	// iPhone Installation
	// ----------------------------------------------------------------------------------------------------------------------------
	if ($iPhonePath <> "") {
		$iPhoneId  = CreateCategoryPath($iPhonePath, 10, 'Cloud');
		CreateLink('Vorhersage',    $iForecast, $iPhoneId, 10);
	}
?>

bei 2.5 nimmst Du einfach die letzte Version des IPSInstallers (10.12.2011), beim 2.4 die vom 19.06.2011

Ok

Nun siehts so aus und bei den Script so!

Habe so etwas rumprobiert aber ich bekommen keine Daten rein.

Wo liegt den der Fehler?

Danke euch

Da fehlt jetzt glaub ich nur mehr der IPSLogger, installier den mal oder entferne mal auf die Schnelle alle Aufrufe im Refresh Script:


<?
	include_once "IPSWeather_Configuration.ips.php";
	include_once "IPSWeather_Constants.ips.php";
	define ("c_LogId", "WeatherRefresh");


	if (Sys_Ping(c_Value_IPExternal, 100)) {

   	$api = simplexml_load_string(utf8_encode(@Sys_GetURLContent($urlGoogle)));
		echo $urlGoogle;

		SetValue (c_ID_LastRefreshDateTime, date("Y-m-j H:i:s"));
		SetValue (c_ID_LastRefreshTime, date("H:i"));

		// Aktuelles Wetter
		SetValue(c_ID_TodayForecastShort, (string)$api->weather->current_conditions->condition->attributes()->data);
		SetValue(c_ID_TodayTempCurrent,   (string)$api->weather->current_conditions->temp_c->attributes()->data);
		SetValue(c_ID_AirHumidity,        str_replace("Feuchtigkeit", "rel.Luftfeuchte", $api->weather->current_conditions->humidity->attributes()->data));
		SetValue(c_ID_Wind,               (string)$api->weather->current_conditions->wind_condition->attributes()->data);
		SetValue(c_ID_TodayIcon,          str_replace(".gif", ".png", str_replace($iconsGoogle, $pathIconsLarge, $api->weather->current_conditions->icon->attributes()->data)));

		// Wettervorhersage heute, morgen, in zwei und in drei Tagen ($wetter[1] bis $wetter[4])
		$i = 1;
		foreach($api->weather->forecast_conditions as $weather)
		{
			if ($i==1) {
				SetValue(c_ID_TodayDay,           str_replace($DaySourceArray, $DayDisplayArray, $weather->day_of_week->attributes()->data));
				SetValue(c_ID_TodayForecastShort, (string)$weather->condition->attributes()->data);
				SetValue(c_ID_TodayTempMin,       (string)$weather->low->attributes()->data);
				SetValue(c_ID_TodayTempMax,       (string)$weather->high->attributes()->data);
				if (GetValue(c_ID_TodayIcon)) {
					SetValue(c_ID_TodayIcon,     str_replace(".gif", ".png", str_replace($iconsGoogle, $pathIconsLarge, $weather->icon->attributes()->data)));
				}
			} else if ($i==2) {
				SetValue(c_ID_TomorrowDay,            str_replace($DaySourceArray, $DayDisplayArray, $weather->day_of_week->attributes()->data));
				SetValue(c_ID_TomorrowForecastShort,  (string)$weather->condition->attributes()->data);
				SetValue(c_ID_TomorrowTempMin,        (string)$weather->low->attributes()->data);
				SetValue(c_ID_TomorrowTempMax,        (string)$weather->high->attributes()->data);
				SetValue(c_ID_TomorrowIcon,           str_replace(".gif", ".png", str_replace($iconsGoogle, $pathIconsSmall, $weather->icon->attributes()->data)));
			} else if ($i==3) {
				SetValue(c_ID_Tomorrow1Day,           str_replace($DaySourceArray, $DayDisplayArray, $weather->day_of_week->attributes()->data));
				SetValue(c_ID_Tomorrow1ForecastShort, (string)$weather->condition->attributes()->data);
				SetValue(c_ID_Tomorrow1TempMin,       (string)$weather->low->attributes()->data);
				SetValue(c_ID_Tomorrow1TempMax,       (string)$weather->high->attributes()->data);
				SetValue(c_ID_Tomorrow1Icon,          str_replace(".gif", ".png", str_replace($iconsGoogle, $pathIconsSmall, $weather->icon->attributes()->data)));
			} else if ($i==4) {
				SetValue(c_ID_Tomorrow2Day,           str_replace($DaySourceArray, $DayDisplayArray, $weather->day_of_week->attributes()->data));
				SetValue(c_ID_Tomorrow2ForecastShort, (string)$weather->condition->attributes()->data);
				SetValue(c_ID_Tomorrow2TempMin,       (string)$weather->low->attributes()->data);
				SetValue(c_ID_Tomorrow2TempMax,       (string)$weather->high->attributes()->data);
				SetValue(c_ID_Tomorrow2Icon,          str_replace(".gif", ".png", str_replace($iconsGoogle, $pathIconsSmall, $weather->icon->attributes()->data)));
			} else  {
			}
			$i++;
		}

		// Wetter für Niederösterreich von ORF auslesen
		$lHTML=file_get_contents($orfUrl);

		$forcast = ExtractData($lHTML, '<div class="fulltextWrapper" role="article">', '<div class="webcamLinks">', true, false);
		$forcastToday = '<h2>'.ExtractData($forcast, '<h2>', '</h2>').'</h2>'.ExtractData($forcast, '<p>', '</p>', false, false);

		$forcast = ExtractData($forcast, '</p>', '<div class="webcamLinks">', true, false);
		$forcastTomorrow  = '<h2>'.ExtractData($forcast, '<h2>', '</h2>').'</h2>'.ExtractData($forcast, '<p>', '</p>', false, false);

		$forcast = ExtractData($forcast, '</p>', '<div class="webcamLinks">', true, false);
		$forcastTomorrow1 = '<h2>'.ExtractData($forcast, '<h2>', '</h2>').'</h2>'.ExtractData($forcast, '<p>', '</p>', false, false);

		$forcast = ExtractData($forcast, '</p>', '<div class="webcamLinks">', true, false);
		$forcastTomorrow2 = '<h2>'.ExtractData($forcast, '<h2>', '</h2>').'</h2>'.ExtractData($forcast, '<p>', '</p>', false, false);

		SetValue (c_ID_TodayForecastLong,     $forcastToday);
		SetValue (c_ID_TomorrowForecastLong,  $forcastTomorrow);
		SetValue (c_ID_Tomorrow1ForecastLong, $forcastTomorrow1);
		SetValue (c_ID_Tomorrow2ForecastLong, $forcastTomorrow2);

	} else {

	}


	function ExtractData($data, $key1, $key2, $removeKey1=true, $removeKey2=true) {
	   $strPos1 = strpos($data, $key1);
	   $strPos2 = strpos($data, $key2);
	   if ($removeKey1 and $removeKey2) {
	   	$result  =substr($data, $strPos1+strlen($key1), $strPos2-$strPos1-strlen($key1));
	   } elseif ($removeKey1) {
	   	$result  =substr($data, $strPos1+strlen($key1), $strPos2-$strPos1-strlen($key1)+strlen($key2));
	   } elseif ($removeKey2) {
	   	$result  =substr($data, $strPos1, $strPos2-$strPos1-strlen($key2));
	   } else {
	   	$result  =substr($data, $strPos1, $strPos2-$strPos1+strlen($key2));
	   }
	   return $result;
	}
?>

mmmhhhh

Du meinst hier drinne??

Wo soll ich den script hinzufügen??

Habs mal installiert!

Hat sich leider nichts geändert.

Habe mal den Script eingefügt bei Refresh

Nun bekomme ich diese meldung!

http://www.google.com/ig/api?weather=Virgen-Austria&hl=de
Fatal error: Call to a member function attributes() on a non-object in [Program\Weather\Scripts\IPSWeather_Refresh] on line 16

Sonst keine mehr nur bei Refreh und Wetter bei ausführen die selbe Meldung!

ja genau IPSWeather_Refresh

Muss dazu sagen habe bei IPSWeather_Configuration.ips

Die Daten geändert! Also Standort!

Diesen Ort kennt die Google Wetter API nicht, nimm den nächst größeren Ort in Deiner Umgebung

Geil jetzt gehts!

Kann ich oben wo dein Heimatort ist also Korneuburg ändern??

Wenn ja wie mache ich das.

Danke

IPSWeather_Configuration.ips.php


	$ort = "Korneuburg";

Vielen Dank