Examples‎ > ‎

Tasker Conditional Actions

posted Jan 28, 2015, 9:46 AM by Joshua Lyon   [ updated Oct 26, 2015, 2:18 PM ]
This is a draft stub of this article and may have formatting and grammatical errors.

High Level Approach

Things

  1. Things: Long press on the thing in the main SharpTools UI and subscribe to the desired Attribute
  2. Things: Setup a Thing State event in Tasker to react to the push event from the subscribed attribute
  3. Create the desired action - such as Notify to display the value
  4. At the bottom of the action, click the + sign next to IF to setup a conditional execution
  5. Things: Set the left variable to the desired SharpTools variable - for example %st_attr_value
  6. Set the conditional operator to the desired type - typically use match (~) rather than equals (=)
  7. Set the value on the right side of the operator to the desired value - use lower-case to case-insensitive matching

Modes

  1. Modes: Open the modes pane in SharpTools, long press on any mode, and choose 'Subscribe to all mode changes'
  2. Modes: Setup a Mode Change event in Tasker to react to mode changes
  3. Create the desired action - such as Notify to display the value
  4. At the bottom of the action, click the + sign next to IF to setup a conditional execution
  5. Modes: Set the left variable to %st_mode
  6. Set the conditional operator to the desired type - typically use match (~) rather than equals (=)
  7. Set the value on the right side of the operator to the desired value - use lower-case to case-insensitive matching
    Example: %st_mode ~ night
For more details on how to use conditional actions with Mode changes, check out the Conditional Mode Change article which includes a video showing how to react to only specific mode change events.

Key Items to Check

  • Keep in mind the way Tasker does pattern matching
  • Make sure you are subscribed to the thing/attribute
    • A star icon will be displayed next to the thing name if you are subscribed to any of it's attributes
  • Make sure the filter on the Thing State is set to catch the event
    • For testing purposes, try leaving the filters blank to match everything
    • Remember that the filters do partial matching
  • Try using flash or notify to display the contents of the variable to make sure you are getting the values you expect

Screenshots

Ensure the thing/attribute is subscribed:
    SharpTools Subscription
Make sure the Thing State filters will catch the event / attribute change you are looking for:
     Tasker Thing State Filters
Setup conditionals on the actions - typically using matches (~) and lowercase:
     Tasker Conditional Action
Make sure you are matching against the desired variable and value:
     Tasker Conditional Configuration

Comments