Only trigger a task when I approach home?

181 views
Skip to first unread message

Sean

unread,
Oct 24, 2014, 10:46:43 AM10/24/14
to tas...@googlegroups.com
Hey all!

I currently have a Tasker task setup that triggers my front door light when I connect to my home wifi SSID, and it's after 5:30. The only problem with this is when I'm home before 5:30, my front door light will come on once 5:30 hits. I don't want this to happen if I'm already home.

So, is there a way to trigger a task when you approach an area only?

Thanks!

Scott

unread,
Oct 24, 2014, 11:37:03 AM10/24/14
to tas...@googlegroups.com
Rather than having two contexts for that profile, just use the WiFi connected context.  In the entry task, check to see if it's after 5:30 and turn on the light if it is.  The task will always go off when you connect to your home WiFi, but it will only turn on the light if it's after 5:30.

Sean

unread,
Oct 24, 2014, 11:44:33 AM10/24/14
to tas...@googlegroups.com
Not sure if I'm following you 100% Scott. How do I add in that conditional check for the time without making it a context?

Thanks!

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/aA2N4jNfsho/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.

Scott

unread,
Oct 24, 2014, 12:02:21 PM10/24/14
to tas...@googlegroups.com, schl...@schleppy.net
There's an "If" action under the "Task" category that lets you perform an 'If' statement.  I don't deal with times inside tasks very much, so someone else might know the best way to go about doing this, but here's one, probably unnecessarily complicated, way to go about it.

In your task:

Set %TIME (the time in hour.minute format, e.g. 5.30) to a local variable (%mytime).  
Split that local variable with a decimal as the splitter.  
Check to see if %mytime1 (the hour) is greater than 17.  If it is, turn on the light (it's 6pm or later).
If it isn't check to see if %mytime1 is equal to 17.  If it is, check to see if %mytime2 (the minute) is greater than 29 (it's 5:30pm-5:59pm).  If it is, turn on the light.

Rich D

unread,
Oct 24, 2014, 5:18:05 PM10/24/14
to Tasker Google Groups Post

> Set %TIME (the time in hour.minute format, e.g. 5.30) to a local variable (%mytime).  
> Split that local variable with a decimal as the splitter.  
> Check to see if %mytime1 (the hour) is greater than 17.  If it is, turn on the light (it's 6pm or later).
> If it isn't check to see if %mytime1 is equal to 17.  If it is, check to see if %mytime2 (the minute) is greater than 29 (it's 5:30pm-5:59pm).  If it is, turn on the light.

I might be missing something but you should be able to do this without splitting. The %TIME is actually in decimal form so it can be used directly in maths.   and every tasker action has a ' IF' option.  So all you need as the first action in the task is ..

1. Stop ; If %TIME < 17.30

Now the light will come on if you connect any time from 17:30 till 23.59  

Rich D

unread,
Oct 24, 2014, 5:25:15 PM10/24/14
to Tasker Google Groups Post


> Now the light will come on if you connect any time from 17:30 till 23.59  

Of course if you happen to lose your connection for a moment when at home and after 5:30 the light will come on. This is referred to as bouncing and there are a few debouncing  posts on this forum. A search should find them if you need one.

Sean

unread,
Oct 24, 2014, 5:38:26 PM10/24/14
to Tasker Google Groups Post
Thanks for the help Rich!

On Fri, Oct 24, 2014, 5:25 PM Rich D <ricp...@gmail.com> wrote:


> Now the light will come on if you connect any time from 17:30 till 23.59  

Of course if you happen to lose your connection for a moment when at home and after 5:30 the light will come on. This is referred to as bouncing and there are a few debouncing  posts on this forum. A search should find them if you need one.

--

Phil

unread,
Oct 24, 2014, 8:04:36 PM10/24/14
to tas...@googlegroups.com, schl...@schleppy.net
I believe you could also use AutoLocation in combination with your %TIME action to set up a geofence around your house such that it triggers as you approach.... in that case, even if you were at home and your wifi was disconnected and reconnected the lights would come on since you weren't approaching your geofence. 

Rich D

unread,
Oct 24, 2014, 8:38:34 PM10/24/14
to Tasker Google Groups Post


> I believe you could also use AutoLocation in combination with your %TIME action to set up a geofence around your house such that it triggers as you approach.... in that case, even if you were at home and your wifi was disconnected and reconnected the lights would come on since you weren't approaching your geofence. 
>

This is true, however i found geofences to toggle falsely even more then a wifi connection. It could be different for others as i am in i fairly remote area.. 

Scott

unread,
Oct 27, 2014, 9:41:35 AM10/27/14
to tas...@googlegroups.com
So I was right, it was unnecessarily complicated.  ;)

I also agree that you'll want debouncing whether you're using WiFi connected or AutoLocation geofences.  I use AutoLocation a lot, but for this I'd just stick with WiFi connected.

Mike Spector

unread,
Oct 27, 2014, 11:57:20 PM10/27/14
to tas...@googlegroups.com
I suggest that you have another at home task eg wifi on turn off the profile "lights on".
Then have another eg at work turn the lights profile on.
Reply all
Reply to author
Forward
0 new messages