====== Owntracks ====== ===== Basic Info Owntracks ===== OwnTracks is an Open Source project which provides an iOS and an Android app with which your smartphone records its current location. Whether you want your young child to know where you currently are, or you want to keep track of where you spent your last vacation, or you and a group of friends want to see each other on a map, OwnTracks does that. It consists of an app which runs on your smart phone, and which periodically, publishes a small chunk of data which other OwnTracks users you authorize may see. It also support ibeacon tracking on iOS devices only) and bring other added value to Miniserver. Using Owntracks you can set-up an presence detection as well as other stuff. Download the Apps: * Apple: [[https://itunes.apple.com/de/app/owntracks/id692424691?mt=8|App Store]] * Android: [[https://play.google.com/store/apps/details?id=org.owntracks.android&hl=de|Play Store]] The App's are sending data whether using MQTT or HTTP to the receiver. The Plugin is designed to work only using MQTT mode. In addition the MQTT LoxBerry Pluginis required to be installed to get the data finally into Loxone. Basically you use the App's to trigger an "enter/leave" event, as many of those GeoLocation Apps can. In addition to that Owntracks deliver quit a lot more of data which could be usefull for your Smart Home like. Batteriestatus of each device, ground speed in case you have an "enter" event and theoratically you can track all your (and other) movements during the day. There is a Booklet covering tons of details how to set-up the App, your loacations and how owntracks works. Personally i can't support how to use/set-up the App in your environment. * Owntracks documentation: [[https://owntracks.org/booklet/]] ===== Requirements ===== - DnyDNS or static or local IP-Address (DynDNS recommended for security reasons) available This may change in the future to use to TLS. - configure Portwording rule for TCP-Port 1883 to xxxx(x) in your Router - installed MQTT Plugin - installed Smartphone App ===== Configuration ===== open Plugin post installation and you have all Info required. In addition there is a tab to get the command recognition to be used for Loxone, as well as a direct link to MQTT. In case you have **weather4lox** Plugin installed your location data will be parsed in, if not a **google map** tab appears to identify your location data. {{plugins:owntracks:1228538762.png?400}} After saving your config create a user specific App configuration file and pass it to corresponding User. Once User has completed the set-up on his Smartphone you should see incoming traffic either in Plugin Monitor or in MQTT Plugin  ===== Basic Setup of MQTT Plugin ===== for setting up Owntracks you need to have a LoxBerry with appropriate Plugin installed. How to do that and do how-to do the basic configuration please visit the support Wiki page here: [[plugins:mqtt_gateway:start|MQTT Gateway]] There are detailed instructions how to do. The Plugin installation contains automatically the subscriptions and conversions, so no need to take action on MQTT ===== Setup Owntracks in iOS ===== ==== Setup for MQTT Interface ==== - open App configuration file (press button at the top right corner)  - select Owntracks to be installed - Owntracks confirmation - your location - check settings and connect status - check imported settings - test data transfer by clicking on **Publish waypoints**\\ {{plugins:owntracks:1228538731.png?200}}{{plugins:owntracks:1228538732.png?200}}{{plugins:owntracks:1228538728.png?200}}{{plugins:owntracks:1228538729.jpg?200}}{{plugins:owntracks:1228538730.png?200}}{{plugins:owntracks:1228538148.png?200}} Now you should open Owntracks Plugin and check either in "**Monitor / Command Recognition**" tab or in your MQTT Plugin and there "**Incoming overview**" or "**Logfiles**" if you have received data ==== Setup for HTTP Interface ==== Currently the HTTP Interface is not supported, it requires a script for further processing. ===== Setup Owntracks in Android ===== Due to missing hardware i can't support Android devices (to be added by User) [[https://loxwiki.atlassian.net/wiki/people/6166fe55198b4f0068f1a624?ref=confluence|User 1a624]] will provide this within the next few days ===== Set-up Owntracks in Loxone ===== ==== Mode "Set virtual inputs via HTTP Webservices (recommended)" ==== (to be added by User) ==== Mode "Send data via UDP" ==== if you have selected "**Send data via UDP**" you have to add a virtual UDP input to your config and enter the MQTT Plugin Port (default is **11883**) {{plugins:owntracks:1228538304.png?250}} adding virtual UDP input command and the comand recognition: {{plugins:owntracks:1228538306.png?400}} the basic command recogniation is always "owntracks/loxberry/****/" followed by the type of data you would like to have. ===== Differences between iOS/Android ===== Depending on used Hardware and Interface there are differences in the data layout/set which been send to Loxone. Those can be found here [[https://owntracks.org/booklet/tech/json/]] very detailed splitted by message payloads (Types)  ==== Data Types ==== OwnTracks publishes its message payloads in [[http://www.json.org/|JSON]] format. The different payload types are identified by a ''%%_type%%'' element. Depending on the app platform, different payload types are supported. ^ ''%%_type%%'' ^ iOS ^ Android ^ | ''%%beacon%%'' | Y | N | | ''%%card%%'' | Y | Y | | ''%%cmd%%'' | Y | Y | | ''%%configuration%%'' | Y | Y | | ''%%encrypted%%'' | Y | Y | | ''%%location%%'' | Y | Y | | ''%%lwt%%'' | Y | Y | | ''%%steps%%'' | Y | N | | ''%%transition%%'' | Y | Y | | ''%%waypoint%%'' | Y | Y | | ''%%waypoints%%'' | Y | Y | ==== Data ==== following data could be used for entry/leave events: ^ command ^ description ^ MQTT conversion required ^ unit ^ Apple ^ Android ^ | cog | Course over ground | | degree | **X** | | | batt | Device battery level | | percent | **X** | **X** | | lon | longitude | | meters | **X** | **X** | | acc | Accuracy of the reported location in meters without unit | | meters | **X** | **X** | | p | barometric pressure | | kPa | **X** | | | vel | velocity | | km/h | **X** | | | vac | vertical accuracy of the alt element | | meters | **X** | | | lat | latitude | | meters | **X** | **X** | | t | **p** ping issued randomly by background task | Yes | | **X** | **X** | | | **c** circular region enter/leave event | Yes | | **X** | **X** | | | **b** beacon region enter/leave event | Yes | | **X** | | | | **r** response to a reportLocation cmd message | Yes | | **X** | **X** | | | **u** manual publish requested by the user | Yes | | **X** | **X** | | | **t** timer based publish in move move | Yes | | **X** | | | | **v** updated by Settings/Privacy/Locations Services/System Services/Frequent Locations monitoring | | | **X** | | | conn | Internet connectivity status (route to host) when the message is created | | | | | | | **w** phone is connected to a WiFi connection | Yes | | **X** | **X** | | | **o** phone is offline | Yes | | **X** | **X** | | | **m** mobile data | Yes | | **X** | **X** | | tst | UNIX epoch timestamp in seconds of the location fix | | epoch | **X** | **X** | | alt | Altitude measured above sea level | | meters | **X** | **X** | | tid | Tracker ID used to display the initials of a user | | string | **X** | **X** | | enter | enter/leave region | Yes | string | **X** | **X** | ===== Tracking/Monitoring ===== introducing from v0.3.0 onwards the Plugin contains a real Tracking/monitoring feature. All data from Users are captured in a database and visualized with either OpenStreetMap or Google Maps (require a Google Maps API key).  {{plugins:owntracks:1228539173.png?150}} {{plugins:owntracks:1228539174.png?150}} {{plugins:owntracks:1228539172.png?250}} ===== Roadmap ===== * add-on for Live Tracking of Geo Locations → done ===== FAQ ===== [[https://www.loxforum.com/forum/projektforen/loxberry/plugins/188828-loyberry-owntracks]]