Hallo,
dass Skript wollte bei mir auch nicht.
Habe es umgebaut und nur die Daten die ich brauche noch drin.
<?php
// Geokoordinaten des Wohnortes
$latitude = 51.97; // Breitengrad
$longitude = 9.01; // Längengrad
$timestamp = time();
$sunrise = date_sunrise($timestamp, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, 90+50/60, date("O")/100);
$sunset = date_sunset($timestamp, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, 90+50/60, date("O")/100);
$civilTwilightStart = date_sunrise($timestamp, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, 96, date("O")/100);
$civilTwilightEnd = date_sunset($timestamp, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, 96, date("O")/100);
SetValueString(CreateVariableByName($_IPS['SELF'], "Sonnenaufgang", 3, "~String"), date("H:i:s", $sunrise));
SetValueString(CreateVariableByName($_IPS['SELF'], "Sonnenuntergang", 3, "~String"), date("H:i:s", $sunset));
SetValueString(CreateVariableByName($_IPS['SELF'], "zivile Morgendaemmerung", 3, "~String"), date("H:i:s", $civilTwilightStart));
SetValueString(CreateVariableByName($_IPS['SELF'], "zivile Abenddaemmerung", 3, "~String"), date("H:i:s", $civilTwilightEnd));
function CreateVariableByName($id, $name, $type, $profile = "")
{
//global $_IPS['SELF'];
$vid = @IPS_GetVariableIDByName($name, $id);
if($vid === false)
{
$vid = IPS_CreateVariable($type);
IPS_SetParent($vid, $id);
IPS_SetName($vid, $name);
IPS_SetInfo($vid, "this variable was created by script #".$_IPS['SELF']);
if($profile !== "") { IPS_SetVariableCustomProfile($vid, $profile); }
}
return $vid;
}
?>
lg Thomas