u/iconb0y

▲ 1 r/tasker

Struggling to get AND/OR and the AND+/OR+ precedence working correctly.

My task gets the status of inside and outside temperatures.

This is what I want to accomplish:

If both or either of the temperatures are 0 (sensor takes a short time to wake up), and temperature scale is C, then loop back to the action to get the states (which refreshes) again, adding 1 to the attempt counter.

Keep doing this until both temperatures are not 0. Stop the loop if attempts = 5, so it doesn't go on infinitely. (The same IF statement is copied and pasted below this one in the task, but if the temperature scale is F, then it checks for 32 instead of 0.)

The flow is:

  1. Get the states.
  2. Add 1 to the attempt counter.
  3. Check if the info is valid.
  4. If all okay, carry on, if not, loop back and try again.

I have tried:

  • IF %inside_temp = 0
  • OR+ %outside_temp = 0
  • AND %attempts < 5
  • AND %temperature_units ~ C
  • GOTO Label Status

Tried this:

  • IF %attempts < 0
  • AND %temperature_units ~ C
  • AND %inside_temp = 0
  • OR+ %attempts < 5
  • AND %temperature_units ~ C
  • AND %outside_temp = 0
  • GOTO Label Status

Tried this:

  • IF %inside_temp = 0
  • AND+
  • %outside_temp = 0
  • AND %attempts < 5
  • AND %temperature_units ~ C
  • GOTO Label Status

Tried this:

  • IF %attempts < 5
  • AND
  • %temperature_units ~ C
  • AND
  • %inside_temp = 0
  • OR
  • %outside_temp = 0
  • GOTO Label Status

Tried this:

  • IF %attempts < 5
  • AND
  • %temperature_units ~ C
  • AND+
  • %inside_temp = 0
  • OR
  • %outside_temp = 0
  • GOTO Label Status

Sometimes, one of the temps is 0 and the task continues. Sometimes both temps are non 0 (what I want...success!) but it loops back to do it again, which doesn't make sense.

What's the correct way to get this working?

reddit.com
u/iconb0y — 1 day ago
▲ 1 r/tasker

Multiple profiles running the same task

My task is to copy files from a folder /storage/emulated/0/Xyz and overwrite the same files in these folders:

- /storage/emulated/0/Download

- /storage/emulated/0/Download/Image Temp

- /storage/emulated/0/Pictures/Snapseed

- /storage/emulated/0/Pictures/Screenshots

It uses a profile event:

- File modified:

in all those folders.

Is there a better way to run the same task when monitoring multiple folders (about 10) in different places on the phone?

reddit.com
u/iconb0y — 10 days ago
▲ 2 r/tasker

Countdown progress bar using Scene v2

I'm trying to create a simple countdown bar (using the new Progress Bar in Scenes v2) that updates every second, getting shorter and shorter, from right to left.

When it reaches zero, it must flash "Restarting...".

If I press cancel or swipe away, the countdown must stop, and the scene must go away.

I'd prefer the countdown animation be smooth if possible, instead of a jerky bar getting shorter.

The length of the countdown is set by local %timer variable.

This is what I've tried:

Task: Countdown Progress
A1: Variable Set [
Name: %timer
To: 60
Structure Output (JSON, etc): On ]
A2: Show Scene v2 [
Name/JSON: ProgressBar
Blocking Overlay: On ]
A3: For [
Variable: %timer
Items: 60:1 ]
A4: Wait [
MS: 1000
Seconds: 0
Minutes: 0
Hours: 0
Days: 0 ]
A5: Update Scene v2 [ ]
A6: End For
A7: Flash [
Text: Restarting...
Continue Task Immediately: On
Dismiss On Click: On ]

This is the Progress Bar code:

{
 "root": {
  "type": "Column",
  "id": "Root",
  "horizontalAlignment": "Center",
  "verticalArrangement": "Center",
  "spacing": "24",
  "modifiers": [
   {
    "type": "FillSize"
   },
   {
    "type": "Padding",
    "all": "16"
   }
  ],
  "children": [
   {
    "type": "ProgressBar",
    "id": "CountdownBar",
    "progress": "%timer",
    "maxProgress": "60",
    "color": "#B71C1C",
    "trackColor": "#FFFFFF",
    "animateChanges": "true",
    "animationDuration": "1000",
    "modifiers": [
     {
      "type": "FillWidth"
     }
    ]
   },
   {
    "type": "Button",
    "id": "CancelButton",
    "text": "Cancel",
    "modifiers": [
     {
      "type": "Padding",
      "all": "16"
     }
    ],
    "eventHandlers": {
     "handlers": [
      {
       "events": [
        {
         "type": "click"
        }
       ],
       "actions": [
        {
         "type": "DismissLayout"
        }
       ]
      }
     ]
    }
   }
  ]
 },
 "name": "ProgressBar"
}

Anyone recommend a Taskernet share or a working solution? Is there a better way to count down instead of using For/End For?

If I inserted a flash with the variable %timer, would the actual seconds show in real time?

reddit.com
u/iconb0y — 26 days ago
▲ 0 r/tasker

What situations do you use (or suggest) for automatically locking your device?

Please share when (also why and how) you automatically lock your device.

I have my device automatically lock when I leave home (i.e. disconnect from home WiFi). There is about a 30 second wait before it locks. That way, if I disconnect from WiFi but connect again quickly, it doesn't lock.

I was thinking of other cases when it would be good to auto lock:

  • When airplane mode turns on.
  • When leaving a specific location.

In light of current world events, I realized being able to lock your device very quickly is not reserved for journalists, whistleblowers and such like. Normal folks need to be able to do the same, whether your device is stolen, you're questioned by someone in power etc.

Perhaps some of your daily uses will be of help to others.

reddit.com
u/iconb0y — 1 month ago