[HowTo] Location and Presence (Owntracks)

ssh to the NAS, type “ifconfig -a [enter]” and see how the various interfaces are configured. Or, use your phone connected to the same network and with an app like ‘fing’ find out what seems to be the NAS.

I’d rather use MQTT broker on Homey, since Mosquito has no gui. Maybe I’ll try it someday, but first I have to make sure private http works flawlessly. I went to work today and Owntracks knows I’m at work, but Homey (Location & presence) still thinks I’m at home. I wish I was too, but that’s a different matter.

I went to a friend Saturday and it worked fine then.

1 Like

I have installed the app and connected it with mqtt.
The problem is that added geofence are not visible in owntracks.
When I add a geofence in Homey I cannot add the coordinates.

That can have several causes. First your location accuracy was bad and the leave event was ignored. Also connectivity problems can be a cause, but then the message should be send as soon as the connection is back again.

For those situations i was experimenting with the inregions field that is send with regular locations events, but cant get that to work reliable. If you have often these kind of problems, try enabling inregions.

You can see your location in settings?

How can I sync those on an iPhone? The screenshot from Android show an advanced setting, on the iPhone I don’t see something that publishes my ‘home’ geofence to other phones. The homey knows about it, the phone that configured it knows about it, but the second phone does not show this geofence. Can I push it from the 1st phone or homey app? Force get it on the second phone?

Ah you want to push to other phones? Go to the settings page of the homey app.
In the overview tab you will see the most actual data of the knows users. At the right side you wil see a button that says ^ by each line. Press it and it will send the data of the geofences to that phone (only MQTT for now)

Ah! Thanks. That phone is en route now, so I will have to wait for a check if the app is showing the fence. This is the screen scanno is talking about:

If it does not show, the device has to accept remote commands. Its a setting somewhere on the phone app.

Only on Android under Advanced. This option is not available on the iPhone.

Nope. Did not work. I see the cmd command in the communication but the owntracks app on phone 2 does not add the geofence. I clicked the arrow next to phone two since that is the phone that needs the waypoints. As a quick fix I exported the waypoint in my settings screen and send them with airdrop to phone number 2. If it can not be send as it should, then we should send it as it can… Let’s find out if this exported geofence is triggering flows…

Yesterday we went away and it worked fine (both leaving and coming home). This morning I went to work and Owntracks knows I’m here, but Location & Presence did not get updated. I’ll try turning inregions on and see what happens.

After leaving the ‘ported’ home geofence once, everything is working fine!

After testing it for a couple of days, I do have some questions. I’d like to compose a geofence within a geofence. It is nice to have a flow arriving in town (to flow the thermostat) with like a geofence of 5 miles around home, and within geofence town a geofence home with a 300 feet radius (and flow the normal presence items). When I configure that, the combination owntracks/homey is becoming a bit unpredictable. Like when leaving home it is mentioning arriving in town, which is odd, since I already was in town. Yet it is not mentioning leaving home and hitting my presence update flow.

Am I too greedy? Should I just make a couple of geofences on the entrance ways into town or is my geofence within geofence a scenario that actually should work and just needs some more debugging?

At the moment you are too greedy :). The logic inside the Homey app can’t handle that scenario.
At the moment that you are crossing the border, the phone app tells the Homey app that it is leaving a fence and/or entering one.

But it is an interesting scenario. It is worth some debugging. Could you give me some logging from the Homey app. First i am interested in the _location messages. If you are in your town and home, what does the inregions section in that message say. Does it have two entries (home, town)?

In home (and thus in town):
20190209-18:26:29 OnMessage called

20190209-18:26:29 received ‘{“batt”:77,“lon”:4.66666666666666,“acc”:65,“p”:100.333333444,“vac”:10,“lat”:52.8888888888,“inregions”:[“home”,“town”],“t”:“p”,“conn”:“w”,“tst”:1546633189,“alt”:-3,"_type":“location”,“tid”:“GG”}’ on ‘owntracks/gerard/KA9Q77777-ADA6-4006-BC8D-BADCAFEC909’

20190209-18:26:29 We have received a location message

20190209-18:26:29 Set battery percentage for gerard to 77%

20190209-18:26:29 inregions: home,town

20190209-18:26:29 region home

20190209-18:26:29 region town

20190209-18:26:29 User gerard already is in region town

20190209-18:26:29 isAccurate

Thanks. That confirms what I thought.
Supporting.that requires a bit of rethinking of the trigger logic.

Will add a fence inside a fence also to see the trigger behavior.

How do I set this up from the mobile app 2.0.2?

I can’t find the option to carry out the following.

When using HTTPS, you have to add users that are allowed to send events to the homey app. To do this, go to the apps settings page and go to the second button (Change users). Add the user name that you want to give access by entering the name in the empty field below the already known users. Press the “+” button to add the user.

Doing some major rework on the Location and Presence app. Just managed to get pushing of waypoints working on https connections.
Pushing of waypoints means that you can send all known geofences from the Homey app to a known phone.

That was already possible for MQTT users, but the internal rework makes it possible to store messages to https connected phones. Once a location change comes in from that phone, the geofences are send inside the https response.

In the Athom Homey app, go to the App section, choose Location and Presence. In that screen press Configure App.

Then you will see the Homey Location and Presence settings screen. At the end of the settings screen, select the button/tab users. There you can add the new user.