Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Questin regarding If / Then statements

28 views
Skip to first unread message

Steve

unread,
Jan 19, 2025, 7:18:54 AMJan 19
to Tasker
I have a routine that captures the WIFI name of whatever wifi I'm connected to.  The issue is when I want to compare it to a specific list or wifi for an if / then statement.

If %WifiName2 -R %HomeSSID Then
    <actions>
End If

or 

If %WifiName2 ~R *specific wifi* Then
    <actions>
End If

The issue is that this will always fail, even if I get the wifi name directly before the If statement.  If I change the statement to If %HomeSSID -R %WifiName2, then everything works fine and the task fires off like it's supposed to.

Why is that?  I clear the WifiName2 before getting the new WIFI name, just to be sure I'm not holding onto old data, just as a precaution.

Rich D

unread,
Jan 19, 2025, 8:03:29 AMJan 19
to Tasker

Why is that?  

It is in the user guide under "flow control"

  • Matches Regex (~R)
    The right parameter is a regular expression which the left parameter is matched against.
 

aa6vh

unread,
Jan 19, 2025, 10:46:08 AMJan 19
to Tasker
Note that location services needs to be enabled in order to see Wifi names.
Reply all
Reply to author
Forward
0 new messages