leaving home

Post your questions and help other users.

Moderator: Martin

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

leaving home

Post by Micha » 30 Dec 2017 07:20

Hello,

now I want to trigger that I'm leaving my home. So I want to say: "if you are loosing connection to wifi named xyz".

How can I trigger this?

Micha

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

Re: leaving home

Post by Desmanto » 30 Dec 2017 07:28

Trigger Wifi Disconnected. But make sure you don't immediately execute your main flow. Put some timer and recheck for reconnection several times. You don't want the main flow triggered when you just restart your wifi router or out of range for a while.

Look at geofencing thread for the detail : viewtopic.php?f=6&t=7137
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: leaving home

Post by Micha » 31 Dec 2017 08:28

Thank you, I got it.

Micha

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

Re: leaving home

Post by Micha » 31 Dec 2017 08:43

Sorry, now I have new problems with this flow: I'm not at home. So I have of course no connection to my home wifi.

The trigger "wifi not connecred to xy" fires! I thought, it should only fire when I was connected and loose this connection.

Micha

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

Re: leaving home

Post by Desmanto » 31 Dec 2017 09:28

At mine, it is working properly. Only when disconnected from the SSID I assigned, it will trigger. Try to check if the proper value of SSID. Check the log for the time when it was triggered.
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: leaving home

Post by Micha » 31 Dec 2017 12:41

Hello,
here's my log file.

Micha
Attachments
flow_Zu_Hause_verlassen_20171231_133248.xml
(3.69 KiB) Downloaded 736 times
log_mail.txt
(43.54 KiB) Downloaded 756 times

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

Re: leaving home

Post by Desmanto » 31 Dec 2017 14:04

You have two triggers at there. It is the Wifi scan result that trigger the flow, not the wifi disconnected trigger.
Multiple triggers will always executed in OR logic. Any one of the trigger got triggerred, the flow will be executed.
(FYI : wifi scan result usually triggered periodically, at my phone it is about 60-100 seconds when screen on and can be up to several minutes when screen off)

You don't need the wifi scan result, just remove it. Tap the 5 line icon on top of the trigger and uncheck the wifi scan result. It is good already.

Since I have seen your flow, can't helped not comment about it. :) Expression using {step} is not needed. There is a condition called Execution count, use this instead.
But you have to reverse the branch, since execution count only give true, when the element reach the the number you put in. So false to the sleep, true to switch mobile data on.
The first execution already count as 1, so you have to increase the number by 1. You need 5 x 30 seconds, put execution count : 6.

Using execution count won't give any advantage to your flow. But it will save your time from typing all the code. (unless you need more complex condition check).
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: leaving home

Post by Micha » 31 Dec 2017 15:44

Thank you very much! I just used a template for the counter...

Happy new year!

Micha

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

Re: leaving home

Post by Desmanto » 31 Dec 2017 18:04

Oh, yeah. That's why the script pattern seems familiar. I usually use my own method for the loop, thus never use the template :)

Happy New Year too! (in my timezone)

Desmanto
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