Since I didn’t want to use MQTT I started investigating the http mode. I’m using pimatic-location now to set the location of the device.
Install pimatic-location and create a new location device.
I use a PHP script to translate the json message from OwnTracks to pimatic. I have a local webserver with PHP so I created a file on my server: location.php
add this to the file:
<?php
header("Content-type: application/json");
// pimatic settings
$ip = '192.168.1.202';
$user = 'admin';
$pw = 'password';
// ID of the location device in pimatic
$device = 'my-iphone';
$data = json_decode(file_get_contents("php://input"), true);
$lat = $data['lat'];
$lon = $data['lon'];
file_get_contents("http://$user:$pw@$ip/api/device/$device/updateLocation?updateAddress=1&lat=$lat&long=$lon");
?>
now use http mode in OwnTracks and set it to this file like: