Originally posted by jvm
View Post
Announcement
Collapse
No announcement yet.
Set Device to Expression - If-Then-Else (Conditional Event Actions)
Collapse
X
-
As an FYI - The new beta (0.61) of Easy Trigger now evaluates the expression part separately for each device in the group, and you also have access to each device's current value using the variable $DEVICEVALUE which you can use in the expression. So, to get the effect you are seeking, you could use the expression:
IF ($$DVR:1458: = 100, 100, $DEVICEVALUE)
In other words, if your Apple TV is on, then for each device in the group TVsOnOff, set the TV device to 100, otherwise, if the Apple TV was off, leave each device in TVsOnOff at its current value (i.e., set it to its existing value of $DEVICEVALUE)
See these post for more information on this new feature and examples: https://forums.homeseer.com/forum/ul...13#post1293313 and https://forums.homeseer.com/forum/ul...66#post1293466
Leave a comment:
-
Originally posted by baudi View PostCode:if($$DVR:123: > $$DVR:234:, 60, $$DVR:123:)
The event action looks like this:
$$DVR:1458: is a virtual device that indicates if my Apple TV is ON (100) or OFF (0). So if the Apple TV is ON ($$DVR:1458: = 100), then I want to turn on all of the TVs (TVsOnOff). But if the AppleTV is OFF, then the TVs should all remain in their current state, whether they are on or off.
But way the action is in the screenshot, if the Apple TV is OFF, the current state of the TV is not taken into consideration, and all TVs will simply be turned off.
Hopefully that clarifies why the "Else" action needs to be omitted in this situation.
Leave a comment:
-
Set Device to Expression - If-Then-Else (Conditional Event Actions)
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...
another interesting function is "if(condition, value if condition is true, value if condition is false)" that allows us to use conditional expression like
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.Tags: None
Leave a comment: