With the IF statement logic action you can make different kind of comparisons and you can link those statements together.
With the extended IF statement you get a lot of options to compare a state or Value with. Here is an overview of all the options and what they do (A is the actual state or Value, B is the user given comparison value):
Type of Value / State | Comparison | Explanation |
---|---|---|
Universal | is equal to | Will be true if A and B are equal. |
is NOT equal to | Will be true if A and B are not equal. | |
is greater than is later than | If both A and B are numbers, it
will compare them as numbers. So if A is higher then B it will return true. If both A and B are time objects this will return true if time A is later than time B. If A or B is textual, both are compared lexicographically. The comparison is based on the Unicode value of each character in the text. The character sequence represented by A is compared lexicographically to the character sequence represented by B. Will return true if A lexicographically follows B. | |
is less than is earlier than | If both A and B are numbers, it
will compare them as numbers. So if A is less then B it will return true. If both A and B are time objects this will return true if time A is earlier than time B. If A or B is textual, both are compared lexicographically. The comparison is based on the Unicode value of each character in the text. The character sequence represented by A is compared lexicographically to the character sequence represented by B. Will return true if A lexicographically preceeds B. | |
contains | Both A and B are evaluated as Text, will return true if text B is part of text A | |
does not contain | Both A and B are evaluated as Text, will return true if text B is not part of text A | |
begins with | Both A and B are evaluated as Text, will return true if text A starts with text B | |
ends with | Both A and B are evaluated as Text, will return true if text A ends with text B | |
size is equal to | If B is a number, this will return true when the character count of A is the same as the number B If B is text, this will return true when the character count of A is the same as the character count of B | |
size is NOT equal to | If B is a number, this will return true when the character count of A is not the same as the number B If B is text, this will return true when the character count of A is not the same as the character count of B | |
size is greater then | If B is a number, this will return true when the character count of A is greater to the number B If B is text, this will return true when the character count of A is greater than the character count of B | |
size is less then | If B is a number, this will return true when the character count of A is less than the number B If B is text, this will return true when the character count of A is less than the character count of B< | |
Time | is same hour as | if A and B are a time notation and the hours are the same number it will be true |
is same minute as | if A and B are a time notation and the minutes are the same number it will be true | |
is same second as | if A and B are a time notation and the seconds are the same number it will be true | |
is NOT same hour as | if A and B are a time notation and the hours are not the same number it will be true | |
is NOT same minute as | if A and B are a time notation and the minutes are not the same number it will be true | |
is NOT same second as | if A and B are a time notation and the seconds are not the same number it will be true | |
is later in the hour than minute | if A and B are a time notation and the minute part of A is an higher number than the minute part of B it will return true | |
is later in the minute than second | if A and B are a time notation and the second part of A is an higher number than the second part of B it will return true | |
is earlier in the hour than minute | if A and B are a time notation and the minute part of A is a lower number than the minute part of B it will return true | |
is earlier in the minute than second | if A and B are a time notation and the second part of A is a lower number than the second part of B it will return true |
Each line in the extended IF statement represents a check that can either be true or false. The line connector checks the lines together. For example the AND connector checks whether the lines connected both are true. If it is, the extended IF Statement is valuated as true.
As soon as you select a connector, a new line will appear which you can use in your logic. To remove the line, make the connector empty again.
Here is the list of connector options you have and how they will evaluate the connected lines(A is the first statement line, B is the second statement line):
Connector | Outcome of extended IF statement |
---|---|
AND | Will be true if both lines are true |
OR | Will be true if one or both lines are true |
XOR | Will be true only if one of the lines is true, not if both are true or if both are false |
NAND | Will be true if both lines are false or one line is false. |
NOR | Will be true when both lines are false |
XNOR | Will be true if both lines are true or if both lines are false |
One neat little feature is that the Extended If Statement also shows the actual state of the selected state or Value. The state is updated only when the list of actions is reloaded or when a new state or Value is selected.
Touch Portal will show what the state or Value currently is as shown in the image. In this case the button state is currently Off but in some cases this is unknown and in those cases Touch Portal will show No state information available...