Automate may not be simpler than Tasker?

366 views
Skip to first unread message

Shane Hou

unread,
Nov 7, 2015, 1:19:10 AM11/7/15
to Automate
I've been using Tasker for some time, and just started to try Automate. I know Automate looks much simpler and more straightforward, but in some circumstance Tasker may be.easier to use.

For example, I want to enable WiFi near some specific APs (Home WiFi, Office WiFi, etc), and disable it when no such APs are nearby. I know I can use GPS to decide if I'm at home or office, but GPS generally consumes more battery power. Instead, Android now supports WiFi scanning even when WiFi is disabled, so I'd like to use this feature.
In Tasker, I can create a profile using "State - Wifi Near", and set all the WiFi SSIDs and MACs I want, along with specified WiFi signal level and channel. Then I create a task which just turn on WiFi. As for turning off WiFi when I'm not around those APs, I can create a profile using "Wifi Connected" and "Invert" attribute checked, and do an enter task which waits for 1 minute then turns off WiFi, and do an exit task which stops the former task.
But on Automate, I have to do the scanning and SSID / MAC matching myself using "For each" and "Expression true?". What makes it more complicated is that, if I have multiple APs to match, I have to match them one by one, in the meantime set a flag to indicate if there is a matched AP. Then I have to check this flag after foreach call to see if WiFi needs to be turned on. If not, I go back the scanning block, maybe with several seconds delay to prevent too many loops. It's obviously more difficult comparing to Tasker. As for turning off WiFi, I don't know how to stop waiting when WiFi is connected in the middle of waiting state.

In my opinion, Automate provides raw operations and raw flow control, while Tasker provides more target-oriented functions. Automate's way is similar to programming, but dragging blocks is not as convenient as writing codes, so maybe on mobile devices, Tasker's way is simpler.

P.S. I do love Automate's clear and neat user interface. It's way better than Tasker.

gg

unread,
Nov 7, 2015, 3:42:11 AM11/7/15
to Automate
Not sure what you are trying to say. Even developer says Automate is low level, lower than Tasker. If there is some missing functionality in Automate, it's just a matter of adding proper blocks. So far it's development is very promising, from my point of view at least. If you find some functionality missing - share your ideas and if they are valid, I'm sure we all would gain new blocks. As for your example, I'm guessing it's already possible within Automate (though I never tested these exact blocks, so can't say 100% sure).

Shane Hou

unread,
Nov 7, 2015, 8:59:45 AM11/7/15
to Automate
I agree that Automate is low level, but lack of some convenience. I'm thinking if Automate can add some features like internal timer and switch-case expression?

Tony G

unread,
Nov 7, 2015, 2:12:49 PM11/7/15
to Automate
For reference, I just wrote exactly the flow you described. It's a fairly common example in the Community contributions but I wanted my own nuances, and I needed the experience with Automate. I have two flows, one Setup flow that displays available APs for selection, and it stores them for the second flow, which does the connection and disables swipe lock in a trusted area.

Sure, creating that was low level but with the flows complete they're now higher level apps. I think the concepts of simpler or easier are irrelevant here. The apps are targeted to different audiences, not intended to be easier for either one but offering a very different approach which generally only appeals to some people.

All that said, I'm also struggling as a developer who wants to create small utilities for friends. Automate is ideal in that it's like open source code, so friends with interest can make sense of the details and change the flow if they wish - we can't do that with pure code. But other friends and no interest in what's happening inside. They just want to download and run. So while I appreciate Automate for what it is, I'm still hoping that in the future we see more and easier deployment methods.

Henrik Lindqvist

unread,
Nov 7, 2015, 7:49:14 PM11/7/15
to Automate
Automate has never claimed to be simpler that Tasker, but hopefully it's easier to understand.
I've tried to make Automate and its blocks generic and less designed for a particular purpose.
That will likely let you do more with them, but it may be more verbose.

It's probably more battery efficient to use the geofencing provided by Android, the "network" location
provider uses nearby wi-fi and cell towers to establish a location, so there's little need to create your own.

Henrik Lindqvist

unread,
Nov 7, 2015, 8:02:52 PM11/7/15
to Automate
I'll happily add "convenience" blocks to reduce the "boilerplate" code/blocks, but they've got to be useful for often recurring cases, or have multiple uses.

The Delay block is an internal timer, i don't see how that could be any simpler.

How would the switch-case block work? I've never seen those in a flowchart, it would be difficult to fit 10 connector dots?

Shane Hou

unread,
Nov 7, 2015, 9:13:45 PM11/7/15
to Automate
You may misunderstand me. My example here is not that I want the phone to display an AP list and select one, but to know there is a specific AP nearby and turn on the WiFi. In this process there's no user operations at all. I want to do this instead of keeping WiFi turned on all the time because I don't like the notifications about open APs showed up on my phone all the time. I only turn off WiFi when there's a trusted AP nearby, and I don't explicitly connect it because the phone will do it automatically.
And, how do I stop the delay process if some events happen?

在 2015年11月8日星期日 UTC+8上午3:12:49,Tony G写道:

Henrik Lindqvist

unread,
Nov 7, 2015, 11:47:42 PM11/7/15
to Automate
You can use Fiber stop to stop any Forked "process".
In the case i don't see a need for it:
               :
+--------------+
|       Passive Wi-Fi scan
|            ssids
|              |
|       Expression true? ---------------+
| matches(ssids, "(network1|network2)") |
|              |                        |
|         Enable Wi-Fi            Disable Wi-Fi
+--------------+------------------------+

Tony G

unread,
Nov 9, 2015, 4:59:52 PM11/9/15
to Automate
Shane, my flow is similar to the one provided by Henrik here, but I use contains() rather than matches() because I have an array of SSIDs. The array is read from a file so that it doesn't need to be hard-coded in the flow. The file is created by displaying a list of local APs for user selection in a one-time setup.

So the user runs the setup to define the SSIDs that they consider safe. They can re-run that at any time in a different location to build the list of SSIDs. They don't run this to start/stop wi-fi.

The flow that checks for a recognized network is always running, with no manual intervention, and a delay between checks.

This setup eliminates the need for "users" to maintain the flows. I've mentioned this separation in other threads. This is my way of solving the problem of separating users from developers.

Henrik, an issue I see with geofencing is that when there is more than one recognized network in a location we still want to connect to the preferred one. My tablet only supports 2GHz wi-fi but my phone supports 2GHz and 5GHz. So I always want the phone to connect to the faster network even though it's authorized on the slower one. We also have a separate network for guests. So rather than using geofence and still letting my phone choose from three networks, I prefer to have it select from a list of SSIDs, in order of preference.

That said I still want to learn more about the geofence mechanism...

Henrik Lindqvist

unread,
Nov 9, 2015, 7:26:31 PM11/9/15
to Automate
The contains function can only find a single match, that's why i used the matches function.
I'll add an intersect(container1, container2) function that will return the values which are present in both collections.

You should be able to use the Wi-Fi connect block to force connect to a particular network

jirvine...@gmail.com

unread,
Oct 5, 2016, 1:30:56 PM10/5/16
to Automate
This did the trick for me for an audio profile switcher. Thanks!
Reply all
Reply to author
Forward
0 new messages