• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

setting a wait / kill task

It is too bad I can't use the if function on a stop task right before the shutdown task that was as simple as
If power = 1 then stop

Of if Bluetooth status = 1 then stop or w/e but I guess it doesn't work that way.
 
Welcome to Android Forums.

I had a similar need ... if near my office WiFi network(s) then have WiFi on ... if not (like visiting a client location) have WiFi off. It is done with two profiles that are always on and the exit task is not used in either.

Profile: tlaOfficeFar
State: Not Wifi Connected [ SSID:TLANET-2.4GHz/TLANET-5GHz MAC:* IP:* ]
Enter: tlaOfficeFar
A1: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
A2: Variable Split [ Name:%WIFII Splitter: Delete Base:Off ]
A3: Perform Task [ Name:tlaWiFiDisable Priority:5 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ] If [ %WIFII2 !~ CONNECTION ]

Profile: tlaOfficeNear
State: Wifi Near [ SSID:TLANET-2.4GHz/TLANET-5GHz MAC:* Capabilities:* Min. Activate Signal Level:5 Channel:0 Toggle Wifi:Off ]
Enter: tlaOfficeNear
A1: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
A2: Perform Task [ Name:tlaWiFiEnable Priority:5 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]

Note that tlaOfficeFar only turns off WiFi after one minute if not near either of my WiFi networks. (The reason is my snail mailbox is down the hall and this allows me to get the snail mail and not turn my WiFi off.

(Something I always forget is that some event types do not allow you to have an Exit task ... like Time. It is simply not listed in an option in the dropdown when you long-click on the Enter task.))

... Thom
 
I appreciate the response but it doesn't help me any.

I can't even find within tasker where you guys are creating just text based scripts. Like I said I have no knowledge of peogramming. I've tried the past few days and of course all day today and I just am to dumb to do it. Really is the truth I just don't have it.

My question again if anyone could possible help me out.

Two profiles... On runs when it has any power the other runs when power is not on the device.

The profile that runs when the power is off will turn off the tablet after 30 seconds.
I would like for if I plug it back in within that 30 seconds to kill that profile. That way it will not turn off my tablet no matter what every time it loses power.
 
Using the distributed Tasker without Plug-Ins ...

I can find no way to power off.
I can find no way in an If statement to test the power source.

Sorry.

... Thom
 
Thank you for your response I appreciate your time.

Let me simplify and try again...

If I have a profile that is currently active and threw the wait task is waiting 30 seconds and a new profile is then activated during that 30 second wait time. How in the second active profile can I kill the first profile?

My tablet is rooted and shutsdown after the wait task is complete.
 
I believe after two days of messing with it I finally got it to do what I want. This is a car tablet so it must go on and off with ignition. So instead of paying 40 ****ong dollars for Timur ROM I did this.

The profile for ignition on sets up my volumes and screen timeout and what ever else. It also turns on Bluetooth for odb2 elm.

Now for auto shut down of my tablet, when I take my keys out = power off. So that was my other only profile to shut down the tablet when acc is off which is when I take out my keys basically. However I wanted that to delay for example if I'm getting gas for a few minute I don't want to turn off the tablet cmpletely or I might be removing itand taking it with me when I get home or maybe a quick turn off and back on of the car.

So I put a 'wait' 10 minutes atas the second to last task followed by 'reboot' (shutdown task). Before these were screen timeout to 7secs and volume off and such to basically put it to sleep. Now like I explained I wanted it just delay a shutdown and if I return briefly and return power I don't want it to carry put the entire profile and of course turn off completely. So finally shutdown i task I used "if %bluetooth is equal to off" then its okay to shut down. The first task on this list is to turn off blue tooth.

On my ignition on profile it waits 2 seconds first and one of the tasks is to turn on Bluetooth. So of I return and put power back on to tablet within those 10 minues it turns all my settings back including Bluetooth and it will not shit down in the 10 minutes.

If I leave and don't come back in ten mins it turns off completely.

I have to "fastboot OEM charge 0" so it turns on auto with acc power.


So I think it works it worked just now in my house so hopefully I'm good.
 
OK ... I finally got it ... two profiles ...
PowerState - sets the power state on a variable
ExternalPower uses the state to do what you want.

Profile: PowerState
State: Power [ Source:Any ]
Enter: Anon
A1: Variable Set [ Name:%HavePower To:on Do Maths:Off Append:Off ]
Exit: Anon
A1: Variable Set [ Name:%HavePower To:off Do Maths:Off Append:Off ]

Profile: ExternalPower
State: Not Power [ Source:Any ]
Enter: Anon
A1: Wait [ MS:0 Seconds:0 Minutes:10 Hours:0 Days:0 ]
A2: If [ %HavePower ~ off ]
A3: Flash [ Text:Power is Off Long:Off ]
A4: End If

You would need to replace the Flash command with whatever you do to power off.

... Thom
 
Thom thank you so much. I will see if I can figure out how to get that going.

The way I described in my last post was only working half the time and obviously not the correct way of doing it. Yours looks legit. Thanks again!
 
in the 'system' section, there's a 'reboot' option with a 'shutdown' setting. That should get you going in just one line.

The way I envision the task working:

PROFILE - State > Power (invert) > Any
TASK - System > Reboot > Shutdown

I just tested this on my phone and it works. Hope that helps.
 
Back
Top Bottom