$value) { $Erg[$key] = $value; } //print_r($responseData); return $Erg; } //Abfrage Kilometerstand function GetCockpitData(){ $ObjektInfo = IPS_GetObject(IPS_GetParent($_IPS[\'SELF\'])); $ObjectID = $ObjektInfo[\'ObjectID\']; $TokenID = GetValue(IPS_GetObjectIDByIdent($ObjectID."_TokenID", $ObjectID)); $AccountID = GetValue(IPS_GetObjectIDByIdent($ObjectID."_AccountID", $ObjectID)); $KameronID = GetValue(IPS_GetObjectIDByIdent($ObjectID."_KAMEREON_API", $ObjectID)); $VinID = GetValue(IPS_GetObjectIDByIdent($ObjectID."_VIN", $ObjectID)); $CountryID = GetValue(IPS_GetObjectIDByIdent($ObjectID."_COUNTRY", $ObjectID)); $postData = array( \'apikey: \'.$KameronID, \'x-gigya-id_token: \'.$TokenID ); $ch = curl_init(\'https://api-wired-prod-1-euw1.wrd-aws.com/commerce/v1/accounts/\'.$AccountID.\'/kamereon/kca/car-adapter/v1/cars/\'.$VinID.\'/cockpit?country=\'.$CountryID); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HTTPHEADER, $postData); $response = curl_exec($ch); if ($response === FALSE) die(curl_error($ch)); $responseData = json_decode($response, TRUE); $Erg = $responseData[\'data\'][\'attributes\'][\'totalMileage\']; return $Erg; } // hole Positionsdaten function GetPosition(){ $ObjektInfo = IPS_GetObject(IPS_GetParent($_IPS[\'SELF\'])); $ObjectID = $ObjektInfo[\'ObjectID\']; $TokenID = GetValue(IPS_GetObjectIDByIdent($ObjectID."_TokenID", $ObjectID)); $AccountID = GetValue(IPS_GetObjectIDByIdent($ObjectID."_AccountID", $ObjectID)); $KameronID = GetValue(IPS_GetObjectIDByIdent($ObjectID."_KAMEREON_API", $ObjectID)); $VinID = GetValue(IPS_GetObjectIDByIdent($ObjectID."_VIN", $ObjectID)); $CountryID = GetValue(IPS_GetObjectIDByIdent($ObjectID."_COUNTRY", $ObjectID)); $postData = array( \'apikey: \'.$KameronID, \'x-gigya-id_token: \'.$TokenID ); $ch = curl_init(\'https://api-wired-prod-1-euw1.wrd-aws.com/commerce/v1/accounts/\'.$AccountID.\'/kamereon/kca/car-adapter/v1/cars/\'.$VinID.\'/location?country=\'.$CountryID); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HTTPHEADER, $postData); $response = curl_exec($ch); if ($response === FALSE) die(curl_error($ch)); $responseData = json_decode($response, TRUE); $Erg["gpsLatitude"]=$responseData[\'data\'][\'attributes\'][\'gpsLatitude\']; $Erg["gpsLongitude"]=$responseData[\'data\'][\'attributes\'][\'gpsLongitude\']; $Erg["gpsUpdate"]=$responseData[\'data\'][\'attributes\'][\'lastUpdateTime\']; return $Erg; } function SetPositionMaps(){ $ObjektInfo = IPS_GetObject(IPS_GetParent($_IPS[\'SELF\'])); $ObjectID = $ObjektInfo[\'ObjectID\']; $GoogleApi = IPS_GetObjectIDByIdent($ObjectID."_GOOGLE_API", $ObjectID); if (GetValue($GoogleApi)){ $GoogleApi = GetValue(IPS_GetObjectIDByIdent($ObjectID."_GOOGLE_API", $ObjectID)); $Lat = IPS_GetObjectIDByIdent($ObjectID."_gpsLatitude", $ObjectID); $Lon = IPS_GetObjectIDByIdent($ObjectID."_gpsLongitude", $ObjectID); $HTMLMap = IPS_GetObjectIDByIdent($ObjectID."_HTML_MAP", $ObjectID); // tausche float komma gegen punkt $Lat=str_replace(",", ".", (Getvalue($Lat))); $Lon=str_replace(",", ".", (Getvalue($Lon))); $StringHtml = \'