time()-(24-$n)*60*60,'Value' => $awattar_hourly[date('H',time()+$n*60*60)]],]); AC_AddLoggedValues($archiveID[0], $ID_Strompreis_brutto, [['TimeStamp' => time()-(24-$n)*60*60,'Value' => ($awattar_hourly[date('H',time()+$n*60*60)]+$Grundpreis)/100],]); AC_AddLoggedValues($archiveID[0], $ID_Strompreis_brutto_Cent, [['TimeStamp' => time()-(24-$n)*60*60,'Value' => ($awattar_hourly[date('H',time()+$n*60*60)]+$Grundpreis)],]); $n=$n+1; } while($n < count($awattar['data'])); #print_r($awattar_hourly); #...und reagregieren AC_ReAggregateVariable($archiveID[0], $ID_Boersenpreis_netto_Cent); AC_ReAggregateVariable($archiveID[0], $ID_Strompreis_brutto); AC_ReAggregateVariable($archiveID[0], $ID_Strompreis_brutto_Cent); } function CreateVariableByIdent($id, $ident, $name, $type, $archiveID) { $vid = @IPS_GetObjectIDByIdent($ident, $id); if($vid === false) { $vid = IPS_CreateVariable($type); IPS_SetParent($vid, $id); IPS_SetName($vid, $name); IPS_SetIdent($vid, $ident); AC_SetLoggingStatus($archiveID[0], $vid, true); } return $vid; }