Tasker Conditional Actions
Post date: Jan 28, 2015 5:46:19 PM
This is a draft stub of this article and may have formatting and grammatical errors.
High Level Approach
Things
Things: Long press on the thing in the main SharpTools UI and subscribe to the desired Attribute
Things: Setup a Thing State event in Tasker to react to the push event from the subscribed attribute
Create the desired action - such as Notify to display the value
At the bottom of the action, click the + sign next to IF to setup a conditional execution
Things: Set the left variable to the desired SharpTools variable - for example %st_attr_value
Set the conditional operator to the desired type - typically use match (~) rather than equals (=)
Set the value on the right side of the operator to the desired value - use lower-case to case-insensitive matching
Modes
Modes: Open the modes pane in SharpTools, long press on any mode, and choose 'Subscribe to all mode changes'
Modes: Setup a Mode Change event in Tasker to react to mode changes
Create the desired action - such as Notify to display the value
At the bottom of the action, click the + sign next to IF to setup a conditional execution
Modes: Set the left variable to %st_mode
Set the conditional operator to the desired type - typically use match (~) rather than equals (=)
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:
Make sure the Thing State filters will catch the event / attribute change you are looking for:
Setup conditionals on the actions - typically using matches (~) and lowercase:
Make sure you are matching against the desired variable and value: