Coming home

Post your questions and help other users.

Moderator: Martin

Post Reply
User avatar
Micha
Posts: 46
Joined: 27 Dec 2017 23:04

Coming home

Post by Micha » 08 Jan 2018 21:22

Hello,

what's the best trigger for "I'm coming home"?

I tried to use "if WIFI scan results available or if I am in GSM cell" with condition "WIFI 'myhome' available". But sometimes (or often) that does not work correctly. Will "WIFI scan results available" work if WIFI is disabled? I tried it with a test flow and it appears to be so.

How often the GSM cell check is executed?

Are there better ideas for the "coming home" problem? The WIFI 'myhome' is not available everywhere in the house.

Thanks for help,
Micha

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Coming home

Post by Desmanto » 09 Jan 2018 01:30

The wifi doesn't have to cover the whole area. You only need it to be triggered once, most likely at the entrance or gate. Find something unique that you can use a "beacon" that you are at home (most likely your wifi "myhome"). It is the exiting need to be made with timer and periodic check. You don't want the flow triggered as soon as you lose your wifi signal, but still at home. In short, make the "Entering" easy, but "Exiting" difficult.

Wifi scan result available usually will be triggered every several minutes even during screen off. Wifi need be enabled in most cases, and at wifi setting, "scan always available" need to be checked. Location also need to be enabled in some phones, especially on newer android version.

You can look more detail at my index, location/GPS part, about geofencing.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
Micha
Posts: 46
Joined: 27 Dec 2017 23:04

Re: Coming home

Post by Micha » 09 Jan 2018 06:49

Desmanto wrote:Wifi scan result available usually will be triggered every several minutes even during screen off. Wifi need be enabled in most cases, and at wifi setting
That's a problem because I want to deactivate wifi if I'm not at home.

Micha

xdauser
Posts: 35
Joined: 05 Aug 2015 17:55

Re: Coming home

Post by xdauser » 09 Jan 2018 08:10

Guys, what I noticed that wifi activates by itself for very short period of time every couple of minutes when option scan always enabled is force, so wifi does not have to be on.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Coming home

Post by Desmanto » 09 Jan 2018 15:10

Micha wrote: That's a problem because I want to deactivate wifi if I'm not at home.

Micha
If you check the "scanning always available", you phone will still scan for wifi even it is off. It is part of the location feature.

To deactivate it, just the same as "Exiting". After you disconnected from the wifi, start the periodic timer flow, and let it scan for at least 5-10 minutes (to make sure you are not at intermitten disconnect or router wifi restart); before enabling another periodic location flow. Then if the periodic location tells that you are far from home, then disable all the periodic checking and turn off wifi.

For the entering, you can try with Phone GSM, search for the cell that you most likely connected when you are near home, then activate a periodic timer to check for the wifi, or just enable the wifi altogether.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply