Hi,
juhu, Willige Tester
Also soweit ich das sehe gehen bestimmte Dinge bei der Phase 1 nicht. bspw die GPS Daten.
Dafür fehlen bei der Phase 2 die Batterietemperatur und die Außentemperatur. Die gibt es nur bei der 1.
@Bernd
Phase 1 wurde bis ca 2019 gebaut und danach Phase2, sollte also klappen.
Ihr könnt ja in der Kategorie folgendes Script einfügen und ausführen:
<?php
function GetBatteryData(){
$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/v2/cars/'.$VinID.'/battery-status?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));
$md5 = md5($response);
$responseData = json_decode($response, TRUE);
print_r($responseData);
}
//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);
print_r($responseData);
}
// 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));
print_r($response);
}
echo "################# Hole Batteriedaten ab
";
GetBatteryData();
echo "################# Hole Cockpitdaten ab
";
GetCockpitData();
echo "################# Hole Positionsdaten ab
";
GetPosition();
Die daten stehen mir zur Verfügung… Ich brauch noch ein wenig Zeit, am WE hat mein Kind Geburtstag, da schaff ich wahrscheinlich nix
Viele Grüße