[HowTo] Location and Presence (Owntracks)

I restarted Homey and now it works. Now I just have to get away from home to test it :slight_smile:

Great!

Hi there, where do you find the users tokens? In the Homey system, i’ve got only “Family” the the users but no tokens…

User tokens for location & presence should be created in the location & presence app on Homey

Oh and your settings page will look different because this is a Work in Progress

Thanks, i didn’t unsterdand i needed this app.

ok, so i’m using CloudMQTT, connexions are ok. The problem is Location and Presence doesn’t see the Fence i’ve created in Owntracks. It seems i’ve missed something…

image

Should i create a fence here, with the same name i’ve used in Owntracks’s region?

image

Can you check the log in the location&presence app?
If you create a fence in the owntracks app on your phone it should automatically be created in the location&presence app.

20190916-19:09:27 initVars called
20190916-19:09:27 connectedClient == null
20190916-19:09:27 Broker URL: mqtts://Farmer.cloudmqtt.com:26725
20190916-19:09:27 keepalive: 60
20190916-19:09:27 rejectUnauthorized: false
20190916-19:09:28 Subscribed to owntracks/#
20190916-19:09:28 TriggerHandler constructor called
20190916-19:09:28 EventTrigger constructor called
20190916-19:09:28 Trigger constructor called
20190916-19:09:28 Trigger onInit() called
20190916-19:09:28 EventTrigger setAutocompleteActions called
20190916-19:09:28 EnterTrigger constructor called
20190916-19:09:28 Trigger constructor called
20190916-19:09:28 Trigger onInit() called
20190916-19:09:28 EnterTrigger setAutocompleteActions called
20190916-19:09:28 LeaveTrigger constructor called
20190916-19:09:28 Trigger constructor called
20190916-19:09:28 Trigger onInit() called
20190916-19:09:28 LeaveTrigger setAutocompleteActions called
20190916-19:09:28 BatteryTrigger constructor called
20190916-19:09:28 Trigger constructor called
20190916-19:09:28 Trigger onInit() called
20190916-19:09:28 BatteryTrigger setAutocompleteActions called
20190916-19:09:28 registerActions called
20190916-19:09:28 createAutocompleteActions called
20190916-19:09:28 registerSpeech
20190916-19:09:28 registerConditions called
20190916-19:09:29 MQTT client connected
20190916-19:09:29 Connected Topics: owntracks/#
20190916-19:09:29 Broker State: CONNECTED
20190916-19:09:29 OnMessage called
20190916-19:09:29 received ‘{“cog”:184,“batt”:22,“lon”:0.14673317782594517,“acc”:5,“p”:101.16678619384766,“bs”:1,“vel”:0,“vac”:3,“lat”:47.933135986328125,“t”:“u”,“conn”:“w”,“tst”:1568653022,“alt”:55,"_type":“location”,“tid”:“9C”}’ on ‘owntracks/Yohann/EB194A2A-4CB5-497F-8AD5-199F4119D09C’
20190916-19:09:29 Device changed for user Yohann to EB194A2A-4CB5-497F-8AD5-199F4119D09C
20190916-19:09:29 We have received a location message
20190916-19:09:29 Set battery percentage for Yohann to 22%
20190916-19:10:25 getLogLines called
20190916-19:16:15 getFenceArray called
20190916-19:17:11 getFenceArray called
20190916-19:17:27 Delete fence called: Maison
20190916-19:17:27 Deleted fence: undefined
20190916-19:17:27 saveFenceData called
20190916-19:17:27 getFenceArray called
20190916-19:18:42 getLogLines called

It’s me trying but as you said, the fence should be created by the app

Got it! I had to publish the waypoints in owntracks. Then the fence appeared.

Hi, Im trying to work this out.

I have created a cloudmqtt no problem there, set the access to read/write
I have setup the mqtt broker app in the homey and generated a certificate, pasted it and emailed it to my comp, used nano and created a file with the pem extension. and airdropped it to my iphone.

But when I enter the owntrack and press i on the proto 4 line I cant find any certificates…HTH do I save them so that I can load them in the app??

Hello all,

As nothing seems to work so far as a location tool i want to try if Owntracks works. Starting with HTTP connection first as i want to see first if it works. MQTT will be an option for later if i can figure out how that works. I have installed the app on homey and on 2 phones. Both huawei mate 20 pro’s. Android 9.0.
Homey had 3.1 installed. I made 1 region called “thuis”. so far so good. I don’t. See the correct settings in the homey app

the fence data is not updating! What am i doing wrong. Already been out today several times so thats not the case.still not updating . Tried to set inregions in location. No change

this is what the log tells me

I have tried restarting homey, no luck. remote commands is on, inaccurate locations is set to 50.

i am out of options to try, can anyone tell me what i am doing wrong?

Did you define the geofences in the APP on your mobile and did you put your app on “MOVE” mode when you click on the MAP on Owntracks application on your mobile.

When you define your fences there they will automatically be created in the homey app.

I installed Own tracks on the recent Samsung of both my wife and myself, and set up an HTTP link via the Homey cloud to my Homey (standard version, standard OS level) and the Location and Presence app, all conform the guidelines given in the top of this thread. No need for geofencing and Homey flows at this stage.

I can see the location data for both Samsungs appearing correctly in Homey’s Location and Presence, but it is unclear to me how to arrange access to “friends” location using this approach, as I need access to my wife’s location as well as my own, and vice versa. I see only the user “te” in the friends list (guess that’s me). Same for my wife.

I am used to chasing the Internet for solutions, but so far no luck. The HTTP section in the Owntracks booklet only confuses me. So what am I missing???

1 Like

The current implementation of Owntracks in the store can only receive events. It is not bidirectional. When using a MQTT broker that will work fine (all connected devices will receive the location changes from other devices that are authorized). So with https, the friends list on your phone does not get populated. You need a MQTT broker for that.

I have a highly experimental version that supports directional https and a lot of more enhancements, but due to lack of time, i am not able to finish the last bits (mainly configuration interface).

With MQTT broker here and the friends are not populated either. Has never been working properly (last update of my partner on my phone was 3 months ago…). Still do not understand what the problem is there. Geofencing itself is working properly.

The Owntracks booklet advises to use HTTP rather than MQTT when dealing with Android smartphones, because of the Android restrictions imposed on apps running in the background. That’s why I chose the HTTP route. Are there any positive experiences in the field running MQTT with Owntracks on Android smartphones (“friends” feature)??

Further to my HTTP troubles depicted above: I finally decided to try out the MQTT route. I installed the Mosquitto MQTT broker on my Centos 7 server, took out a Lets Encrypt certificate, adapted the Owntracks app on both Samsungs and Homey’s Location @ Presence app to work with my MQTT broker, and even installed Owntracks Recorder on Centos 7 (with some difficulty: no viable installation package at this stage other than Docker).

It all works like a charm now. Today I set up a geofence for “home” together wit a bunch of Homey flows and even that seems to work. Kudos for all the developers, and thanks for the support given in this thread: very helpful!

draining battery as much as an drunken sailor empties the bar.

Do you have it on “Significant changes monitoring” mode?