0

I want to turn on Bluetooth if WiFi is not connected to some network and turn off WiFi after that using Tasker. I've managed to do that, but I have a problem.

First, Bluetooth turned on even if I was turning WiFi off manually, which is not what I wanted. I wanted Bluetooth to turn once I'm out of the home. So I added the "if not WiFi ~ on" clause to the "Bluetooth turn on" action. And this is working alright.

But now I have another problem. If I'm using "turn off WiFi in sleep mode", then after entering the sleep mode, Bluetooth is turned on. I don't want that.

How can I do what I really need to, which is if I'm on the street, then turn on Bluetooth and turn off WiFi?

1 Answer 1

0

This would require using a "custom variable" – let's call it WANT_BT for a reference ­– and some additional profile:

  • on "monitor start", set an initial value for it. Which that is, depends on your usage: say you've got WiFi on usually, set it to 0 here, otherwise set it to 1 in this place. Experiment a little which is better fitting. Alternatively, make it depending on whether WiFi is on at this time. We'll interprete this as "Do we want BT to be turned on when WiFi switches off?" with "0" as "no" and "1" as "yes".
  • in your sleep-mode profile, set it to 0 in the task. Optionally set it to 1 in the exit task (Tasker should restore the "before-value" automatically)
  • in your BT task, check this variable additionally (i.e. "turn BT on if WiFi is off and %WANT_BT% is 1")

You might have to adjust some other profiles triggering WiFi, but that should basically cover it: BT should only be turned on when "wanted". Even if you manually switch off WiFi via a toggle widget (or the shortcuts), BT would only turn on in situations where you WANT_BT :)

5
  • How to create sleep mode profile? I can't find anything on that. Commented Jun 11, 2014 at 6:57
  • That depends on what you define as "sleep mode" (I've just picked up that term from your question). Closest approach I can think of ad-hoc is "Display off" with a delay ("Tasker → WAIT") of 30..60s.
    – Izzy
    Commented Jun 11, 2014 at 7:02
  • Well... I think I'm talking about CPU sleep. Commented Jun 11, 2014 at 7:20
  • I thought about that. But if the CPU sleeps, so does Tasker. I don't know if that's possible. Sure, there's the %CPUFREQ variable, so you could play with that (and comparision like it being "lower than X"). But that's probably as close as you can get.
    – Izzy
    Commented Jun 11, 2014 at 7:29
  • Note the "probably". It might well be I've overlooked something, e.g. the system broadcasting a "going-to-sleep" signal Tasker might be able to catch and react on. Unlikely, but not impossible. Consulting the Tasker UserGuide is always a good idea :)
    – Izzy
    Commented Jun 11, 2014 at 8:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .