Homey Community Forum

Location and Presence (Owntracks) - HowTo

tools
app

#62

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)?


#63

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


#64

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.


#65

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.


#66

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.


#67

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.


#68

Thank you, I now have it working with accurate presence status.


#69

have you reassigned your phone in the owntracks flow ?


#70

Scanno the fence in bigger fence will also fix additional complexity with owntracks getting false possitives. So if you go walking around your area the gate does not need to go open. If you have been out of you 2km fence then it should trigger again to open the gate.
I now have fixed this with adding logic variables but it could be much easier when you have multiple triggers possible or if trigger entered big geofence and home geofence entered than true if entered home geofence but no trigger entering big geofence then false


#71

I found out I can ‘lock’ apps on my phone, to prevent them from closing, or sleeping, or something. I must say it’s been working fine the last couple of days.


#72

On what phone and OS?


#73

:+1:t5:


#74

Xiaomi Mi Mix 2S, Android 9. In the overview of running apps, I can longpress in on an app. I then get a submenu with three options. One is a lock and it prevents apps from closing (I guess). Even though I’ve already turned off battery optimization for Homey and Owntracks, I still had issues, but now it seems to work.


#75

Testing right now with multiple fences. Seems to be working so far. And I guess having a logic card that gives back true/false if you are in a fence is something I could add.

Main change is that I now have an array a fences that a device is in. Leave removes a fence from that array and enter adds it.