Turn on bluetooth if wifi is not connected to some network and turn off wifi after that 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 home.

So I added if not wifi ~ on clause to 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 wifi 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?
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 :)