Can Tasker be aware of other phones nearby?

819 views
Skip to first unread message

Cjsnet

unread,
Apr 11, 2015, 1:08:23 PM4/11/15
to tas...@googlegroups.com
Hi, is it possible to make a task that only runs if another phone is nearby? Perhaps using Bluetooth?

John Doe

unread,
Apr 11, 2015, 1:47:35 PM4/11/15
to tas...@googlegroups.com

Tasker hasn't got the crystal ball (at least until now :)) so you need a "context". You can use bt connected for example, but there isn't anything simple like "other phone near". Other complex conditions can be used, for example the connection to the same wifi, then you could use the connection in someway.

Christian Simpson

unread,
Apr 11, 2015, 1:51:57 PM4/11/15
to tas...@googlegroups.com

Thanks. How would I indicate a connection to the same WiFi?


On Sat, Apr 11, 2015, 10:47 John Doe <playappa...@gmail.com> wrote:

Tasker hasn't got the crystal ball (at least until now :)) so you need a "context". You can use bt connected for example, but there isn't anything simple like "other phone near". Other complex conditions can be used, for example the connection to the same wifi, then you could use the connection in someway.


Hi, is it possible to make a task that only runs if another phone is nearby? Perhaps using Bluetooth?

--
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/QhaN1xX9lV8/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.

Niles Black

unread,
Apr 11, 2015, 9:27:08 PM4/11/15
to tas...@googlegroups.com
I did it by using an ICMP echo request and then parsing the output to determine whether packet loss was less than 100%. You'd need to know the IP address for the device in question, which you can find out using a tool like Fing. If you don't know what the IP address of the phone will be (e.g. if it doesn't have an open DHCP lease) I don't think there's an easy way. 

If it does (as in the case where the device regularly connects to the specific wifi) this is a basic outline of the steps, which should be enough to get you started;

  1. Use Fing or a similar tool to find out the IP address of the device you want to monitor for
  2. Set up a tasker profile to run the task every 2 minutes or however often you want to check
  3. Make the task execute a shell command, ping -c 3 [the local IP of the device]
  4. Have it store the output in a variable
  5. Split the output variable at 'received, ' and then again at the next % symbol, so that you have just the number
  6. Run a conditional notification i.e. if %packets_lost < 100 (which would mean the device is connected to the network, since it returned a packet) notify me or play a sound or whatever
For bluetooth it's even easier since you can just use BT Near (under Network) but both devices will need to have bluetooth on (which is less common than both having wifi on) and the detection range is much lower. 

Unfortunately since I'm using the profile/task in a production app, I can't release the code. But those are the steps I followed, so they should work for you.

D

unread,
Apr 23, 2015, 9:05:19 AM4/23/15
to tas...@googlegroups.com
What about autoremote?
You would need tasker and Autoremote on the other phone, though.

If you know the wifi on which you wanna do this, you can send an AutoRemote message to the other device upon connection, and then do whatever you want.
If you don't know the wifi, you can send a request to the other device to obtain the name of the wifi to which it is connected. If the two networks match, then you do something.

Rob Campbell

unread,
Mar 9, 2017, 4:21:50 PM3/9/17
to Tasker
I know this is old but...

If you connect to the other phone once using bluetooth or if you know the device address you could do if bluetooth is near
Reply all
Reply to author
Forward
0 new messages