array( "verify_peer"=> false, "verify_peer_name"=> false, ), 'http' => array( 'timeout' => 15 ) ) ); @$array = get_headers($url, 0, $stream); if (empty($array)) { return; } else { $string = $array[0]; if(strpos($string,"200")) { echo 'url exists '.$url."\n
"; } else { echo 'url: '.$url." does not exist \n
"; return; } /* Ende - prüfen ob Seite existiert */ } $file = file_get_contents($url); $json = json_decode($file, TRUE); if ($debug) print_r ($json); if (!empty($json['battery']['voltage'])) { echo $json['battery']['voltage'] . PHP_EOL; SetValueFloat(11768,$json['battery']['voltage']); echo $json['energy'][0]['autonomy'] . PHP_EOL; SetValueInteger(17277,$json['energy'][0]['autonomy']); echo $json['energy'][0]['updated_at'] . PHP_EOL; SetValueString(44458,$json['energy'][0]['updated_at']); echo $json['energy'][0]['charging']['charging_mode'] . PHP_EOL; SetValueString(45016,$json['energy'][0]['charging']['charging_mode']); echo $json['energy'][0]['charging']['charging_rate'] . PHP_EOL; SetValueInteger(52679,$json['energy'][0]['charging']['charging_rate']); echo $json['energy'][0]['charging']['plugged'] . PHP_EOL; SetValueBoolean(40541,$json['energy'][0]['charging']['plugged']); echo $json['energy'][0]['charging']['status'] . PHP_EOL; SetValueString(56120,$json['energy'][0]['charging']['status']); echo $json['energy'][0]['level'] . PHP_EOL; SetValueInteger(23530,$json['energy'][0]['level']); echo $json['environment']['air']['temp'] . PHP_EOL; SetValueFloat(33236,$json['environment']['air']['temp']); echo $json['environment']['luminosity']['day'] . PHP_EOL; echo $json['ignition']['type'] . PHP_EOL; echo $json['kinetic']['acceleration'] . PHP_EOL; echo $json['kinetic']['moving'] . PHP_EOL; echo $json['kinetic']['pace'] . PHP_EOL; echo $json['kinetic']['speed'] . PHP_EOL; SetValueFloat(39756,$json['kinetic']['speed']); echo $json['last_position']['geometry']['coordinates'][0] . PHP_EOL; echo $json['last_position']['geometry']['coordinates'][1] . PHP_EOL; echo $json['last_position']['geometry']['coordinates'][2] . PHP_EOL; echo $json['timed_odometer']['updated_at'] . PHP_EOL; SetValueString(56258,$json['timed_odometer']['updated_at']); echo $json['timed_odometer']['mileage'] . PHP_EOL; SetValueFloat(19061,$json['timed_odometer']['mileage']); }