I have been using the If-Then-Else functionality in the "Set Device to Expression" EasyTrigger action with great success. In my opinion this is a real "hidden gem" that allows event actions to be executed conditionally (functionality that HS3 should probably have natively).
The EasyTrigger User Guide explains the functionality like this...
I've recently come across a use case where I would like to omit the "Else" part of the expression, so that the action executes if the "If" part is True, but does nothing if the "If" part is false.
Using the example above, what I would like to do is omit the "else 70" part, so something like this:
But when I try using this expression, the plugin complains in the log:
Is it possible to omit the "Else"?
BTW, I am aware that it is possible to accomplish the end result using other methods in HS3. But I am specifically interested if it is possible with this EasyTrigger "Set Device to Expression" functionality.
The EasyTrigger User Guide explains the functionality like this...
another interesting function is "if(condition, value if condition is true, value if condition is false)" that allows us to use conditional expression like
which means if device #123 has a value greater than device #234 then returns 60 else 70
Code:
if($$DVR:123: > $$DVR:234:, 60, 70)
Using the example above, what I would like to do is omit the "else 70" part, so something like this:
Code:
if($$DVR:123: > $$DVR:234:, 60)
Code:
EasyTrigger ERROR if() takes exactly 3 arguments
BTW, I am aware that it is possible to accomplish the end result using other methods in HS3. But I am specifically interested if it is possible with this EasyTrigger "Set Device to Expression" functionality.
Comment