Im using Shartools and tasker to play an mp3 on my android Phone.
I have set one switch up so when its turned on an mp3 is played but it also plays when its turned off how to I prevent that
Thanks
You can use conditions in your Tasker profile to determine what actions to take based on the device state.
Are you using the Thing State event plugging along with a subscription to the switch?
Here’s a high level article on that approach:
The short version is to use the IF option on whatever action you are taking and use something like IF %st_attr_value ~ on
Thanks I tried your suggestion still does not work I get nothing
Never mind in Tasker Config under Attribute I typed in “on” once I removed all is well
Thanks for the update and glad to hear that it’s working for you. Good point on the Thing State configuration - the attribute either needs to be blank or match the attribute name (eg. switch
)
The Tasker article on pattern matching might be helpful for other more complex cases:
http://tasker.dinglisch.net/userguide/en/matching.html
Of particular note is the part about case sensitivity:
Matching is case-insensitive (
magic
will match withMagiC
) unless the pattern contains an upper-case letter e.g.Magic*
will not match againstmagically
, but it will match againstMagic Roundabout
So it’s typically best to use all lower case characters unless you specifically are trying to match for a specific capitalized pattern.
And for anyone else who finds this, note that Tasker’s pattern matching only works with the pattern comparison (eg. '~'
). The equality operator is looking for an exact match (eg. '='
).