Page 1 of 1

leaving home

Posted: 30 Dec 2017 07:20
by Micha
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

Re: leaving home

Posted: 30 Dec 2017 07:28
by Desmanto
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

Re: leaving home

Posted: 31 Dec 2017 08:28
by Micha
Thank you, I got it.

Micha

Re: leaving home

Posted: 31 Dec 2017 08:43
by Micha
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

Re: leaving home

Posted: 31 Dec 2017 09:28
by Desmanto
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.

Re: leaving home

Posted: 31 Dec 2017 12:41
by Micha
Hello,
here's my log file.

Micha

Re: leaving home

Posted: 31 Dec 2017 14:04
by Desmanto
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).

Re: leaving home

Posted: 31 Dec 2017 15:44
by Micha
Thank you very much! I just used a template for the counter...

Happy new year!

Micha

Re: leaving home

Posted: 31 Dec 2017 18:04
by Desmanto
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