Tasker + Autoremote, executing a command when two devices leaves home.

260 views
Skip to first unread message

Kristian Mathisen

unread,
May 15, 2014, 12:38:01 PM5/15/14
to tas...@googlegroups.com
Hey!

This is what I want to do: 

When both my girlfriend and I leave the house, I want to turn off the lamps in the house. If my girlfriend leaves the house, but I am still there, I want the phones to do nothing. I'm turning off the lamps in the house using telldus and a plugin which is working fine. 

I'm using Autoremote to communicate between the two devices. Whenever my phones disconnects from our home wifi, autoremote sends a message requesting status from my girlfriends phone. My girlfriends phone sends back her %wifii status, letting my phone know if she is on our home network. 

Now here is the problem. When I receive the %wifii status from my girlfriends phone, I want my phone to turn off the lamps IF the message received does not contain the name of our network ("Wifihome"). That way it will only execute the commands if my girlfriend also is away from home. I've tried setting up a an autoremote trigger which looks for the word "Wifihome" and then invert it, but it does not work. 

Anyone know how to solve this? Or maybe there is another way of doing this?

Brandon Horwath

unread,
May 15, 2014, 2:07:22 PM5/15/14
to tas...@googlegroups.com
Lets see some more details...

To export a profile as description:

1) Disable beginner mode.
Go to menu > preferences > UI tab > Beginner mode and uncheck it.

2) A profile must be named to export
Long press on the profile that you want to name and a menu bar should appear at the top of the screen.
Select the "A" icon to open a dialog to name the profile.
Note: You can change tasker's profile creation sequence to request a profile name when creating a profile with:
menu > preferences > UI > scroll down to Main Screen section and find 'Ask For New Profile Name' and check it.

3) Post the Tasker description of the profile or task that you are having trouble with.
To do that you long press on the profile name (or task name) and then go to menu > export > description to clipboard (don't select export XML). Then paste the clipboard contexts into a post.

Hopefully someone here can assist you :-)

Kristian Mathisen

unread,
May 15, 2014, 4:21:14 PM5/15/14
to tas...@googlegroups.com
Sure, the profile I am having trouble with is the one where I want to turn on lamps IF the message from Autoremote does not contain the phrase "HomeWIFI". 

Here it is: 

Profile: Trigger Not HomeWIFI (10)
State: Not AutoRemote [ Configuration:"HomeWIFI" (case ins) ]
Enter: Lamps On (12)
A1: CloudStick [ Configuration:Switch Lamps On Package:se.treehou.locale Name:CloudStick Timeout (Seconds):0 ] 

easiuser

unread,
May 15, 2014, 4:54:53 PM5/15/14
to tas...@googlegroups.com
First off I don't think this is what you want unless you are activating the profile only at specific times because if you recieve ANY ar message that does not contain HomeWIFI you will run the Entry Task.
 
Second, make sure the Event Behaviour is checked in the plugin configuration screen.
 
I would suggest you use another string to trigger the profile and then test for "HomeWIFI" in the message.  The message might look something like:
 
WIFI Status=:=....   HomeWIFI ....
 
Then set Message Filter to WIFI Status=:= and do not invert.
 
The Entry task would be:
 
CloudStick [ Configuration:Switch Lamps On Package:se.treehou.locale Name:CloudStick Timeout (Seconds):0 ]  If %arcomm ~ *HomeWIFI*
 
 
 

On Thursday, May 15, 2014 3:21:14 PM UTC-5, Kristian Mathisen wrote:
Sure, the profile I am having trouble with is the one where I want to turn on lamps IF the message from Autoremote does not contain the phrase "HomeWIFI", it will run the Enter task.

Kristian Mathisen

unread,
May 15, 2014, 5:03:11 PM5/15/14
to tas...@googlegroups.com
What does =:= mean?

easiuser

unread,
May 15, 2014, 6:23:42 PM5/15/14
to tas...@googlegroups.com
It is a standard separator that autoremote uses to separate parameters from commands.  Might want to view some of the Autoremote tutorials out there.  You don't have to use it if you don't want to.  When you are running a task triggered by an autoremote event. Single words to the left of =:= are in an array %arpar() and everything to the right is %arcomm and the entire message is stored in %armessage.
 
Whatever method you use, I suggest putting a keyphrase in the message to trigger the profile and then checking the rest of the message to determine how to respond. 

joaomgcd

unread,
May 16, 2014, 4:41:29 AM5/16/14
to tas...@googlegroups.com

Kristian Mathisen

unread,
May 16, 2014, 12:07:47 PM5/16/14
to tas...@googlegroups.com
Ok, I had a new go at it. I figured out how the %arcomm works (or at least I think so) and I tried to make tasker respond if %arcomm is not "HomeWIFI". I also added a wordphrase at the beginning of the message so tasker only responds to the messages with that particular wordphrase. Everything is working fine, exept that Tasker can't figure out the difference if I am on my home network, or any other. If I send the message back, saying I am on a completely different network, Tasker still won't turn on the lamps. 

Here is my try, am I getting closer? :)

1400188877877
1400255573710
18
12
Homestatus Autoremote

5783


Homestatus >>> CONNECTION <<<

=:=
java.lang.String
<null>
java.lang.String
<null>
java.lang.String
true
java.lang.Boolean
Homestatus >>> CONNECTION <<<

=:=
java.lang.String
false
java.lang.Boolean
false
java.lang.Boolean
false
java.lang.Boolean
<null>
java.lang.String
<StringArray sr=""><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0>%armessage
The whole received AutoRemote message.
The whole received AutoRemote message.</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES10>%arvia
Way the message was sent (BT, Wifi, GCM)
</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES10><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES2>%arcomm
Whole of the text to the right of =:=
Whole of the text to the right of =:=</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES2><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES1>%arpar()

Single words to the left of =:=
Single words to the left of =:=</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES1><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES4>%arsenderbtmac
Sender Bluetooth Mac Address
</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES4><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES3>%arfiles()
Files
</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES3><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES6>%arsenderlocalip
Sender Local IP
</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES6><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES5>%arsenderid
Sender Id
</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES5><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES8>%arsenderpublicip
Sender Public IP
</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES8><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES7>%arsendername
Sender Name
</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES7><_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES9>%arsendertype
Sender Type
</_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES9></StringArray>
[Ljava.lang.String;
plugininstanceid plugintypeid messagevar commvar commparamsvar message target 
java.lang.String
true
java.lang.Boolean
b267963a-d90a-4a8e-a0f1-8d713913e602
java.lang.String
com.joaomgcd.autoremote.IntentRemote
java.lang.String
<null>
java.lang.String


com.joaomgcd.autoremote
AutoRemote


165


%Arcomm
0
*»HomeWifi»*





1400101210437
1400190552937
12
Lamps On

5682


Switch Lamps On
java.lang.String
6
java.lang.Long
true
java.lang.Boolean
4000
java.lang.Integer
Switch Lamps On
java.lang.String
0
java.lang.Integer
switch
java.lang.String

easiuser

unread,
May 16, 2014, 12:32:45 PM5/16/14
to tas...@googlegroups.com
Not sure what you posted here. 
 
Longpress on the task/profile and Use Export->Description to clipboard and paste it here. Note: Profile must be named and beginners mode unchecked in settings.

Kristian Mathisen

unread,
May 16, 2014, 12:46:51 PM5/16/14
to tas...@googlegroups.com
Sorry about that, here is the right one: 

Profile: Homestatus Autoremote (18)
State: AutoRemote [ Configuration:Homestatus >>> CONNECTION <<<

 

=:= ]
State: Not Variable Value [ %Arcomm ~ "HomeWifi" ]

nanobrain

unread,
May 16, 2014, 1:26:18 PM5/16/14
to tas...@googlegroups.com
I am not very familiar with the autoapps, but %Arcomm is not the same as %arcomm. Because of the capital letter the first is a global variable while %arcomm only exists during the autoremote task. So unless you defined %Arcomm to be %arcomm somewhere Variable Value [%Arcomm ~ "HomeWifi"] is always false therefore the Not is always true.

Kristian Mathisen

unread,
May 16, 2014, 1:31:52 PM5/16/14
to tas...@googlegroups.com
Yeah, I tried using %arcomm but got the message: Error: Conditions: You cant use local variables (all lower case) here. 

nanobrain

unread,
May 16, 2014, 1:49:24 PM5/16/14
to tas...@googlegroups.com
The way I understand it these variables have values only just after am autoremote action. But you are probably better off asking in the autoapps forum: https://groups.google.com/forum/?fromgroups#!forum/joaomgcd

Good luck

easiuser

unread,
May 16, 2014, 2:19:29 PM5/16/14
to tas...@googlegroups.com
Delete the second state in your profile and and the condition to A1 of your entry task. Open the Cloudstick action screen.  There should be an if with a + sign to the right.  Tap the + sign and add %arcomm !~ *HomeWifi*

easiuser

unread,
May 16, 2014, 2:20:34 PM5/16/14
to tas...@googlegroups.com

On Friday, May 16, 2014 1:19:29 PM UTC-5, easiuser wrote:
Delete the second state in your profile and add the condition to A1 of your entry task. Open the Cloudstick action screen.  There should be an if with a + sign to the right.  Tap the + sign and add %arcomm !~ *HomeWifi*

Kristian Mathisen

unread,
May 16, 2014, 2:35:08 PM5/16/14
to tas...@googlegroups.com
Did what you said, but it is still not working. Are you sure that adding %arcomm !~ *HomeWifi* in the entry task will execute the task if the message does _not_ contain the word HomeWifi ?

easiuser

unread,
May 16, 2014, 3:07:51 PM5/16/14
to tas...@googlegroups.com
It should.  A couple of things I would check.
 
Check the autoremote log to see if you received the message and exaclty what the message was.
 
Add an Alert->Flash %arcomm as the fist ation in the entry task. 
If you don't see the flash, the profile is not getting activated.
If it does flash, does it contain HomeWifi?

Kristian Mathisen

unread,
May 16, 2014, 3:38:37 PM5/16/14
to tas...@googlegroups.com
There is no flash showing. The message is copy and paste from Autoremote logs so I am pretty sure it is correct. I initially forgot a " in the first profiles, but still after correcting this, it is not working. 

Here is my profile now, any more suggestions? :)

Profile: Homestatus Autoremote (18)
State: AutoRemote [ Configuration:"Homestatus >>> CONNECTION <<<

=:= ]
Enter: Lamps On (12)
A1: Flash [ Text:  %arcomm Long:Off ] 
A2: CloudStick [ Configuration:Switch Lamps On Package:se.treehou.locale Name:CloudStick Timeout (Seconds):0 ] If [ %arcomm !~ *HomeWifi* ]

easiuser

unread,
May 16, 2014, 6:14:06 PM5/16/14
to tas...@googlegroups.com
If you don't get a flash, your profile is not activating.  How are you sending the messages?  Do they show up in your phone?
 
You may be having trouble with the white spaces not matching up. Try a simple set up first
 
In your profile change the message filter to Homestatus=:=
 
On your girlfriends phone, use the autoremote app to send Homestatus=:=Connected to your phone.  Does it flash?  Does it show up in the log on your phone?

Kristian Mathisen

unread,
May 17, 2014, 8:11:10 AM5/17/14
to tas...@googlegroups.com
Awesome! It works perfectly now. Thank you for great help easiuser!!

Here are my 3 profiles managing the whole thing: 

Requesting wifi-status from my gf phone when disconnected from Home network: 

Profile: Send Request (21)
State: Wifi Connected [ SSID:HomeWifi MAC:* IP:* ]
Enter: Dummy (22)
A1: Wait [ MS:71 Seconds:0 Minutes:0 Hours:0 Days:0 ]

 

Exit: Automsg Position Off (23)
A1: AutoRemote Message [ Configuration:Recipient: Julie S3
Message: Request position Package:com.joaomgcd.autoremote Name:AutoRemote Message Timeout (Seconds):0 ]


Sending WIFI-status to the other phone when requested 

Profile: Send Wifi Info (24)
State: AutoRemote [ Configuration:Request position ]
Enter: Send Wifi Info (25)
A1: AutoRemote Message [ Configuration:Recipient: Julie S3
Message: Homestatus=:= %WIFII Package:com.joaomgcd.autoremote Name:AutoRemote Message Timeout (Seconds):0 ]


Turning lamps off if the message does not include the word "HomeWifi" 

Profile: Homestatus Autoremote (18)
State: AutoRemote [ Configuration:Homestatus=:= ]
Enter: Lamps Off (12)
A1: CloudStick [ Configuration:Switch Lamps Off Package:se.treehou.locale Name:CloudStick Timeout (Seconds):0 ] If [ %arcomm !~ *HomeWifi* ]

easiuser

unread,
May 17, 2014, 3:52:07 PM5/17/14
to tas...@googlegroups.com
Glad its working.
Reply all
Reply to author
Forward
0 new messages