Friday at 09:14 PM3 days I've got a simple program looking at some values to trigger the Then, but it's not triggering:If $ShadeLowerDesiredHour is $Hour And $ShadeLowerDesiredMin is $Minute And $AnybodyHome is 0 Then...All values on the first two lines are Integer variables, and $AnybodyHome is a State variable.I can watch the values as the desired time approaches, and they do match at the appropriate time - but nothing happens. Is the fact that the first two lines don't include State variables causing the program to never evaluate as true?
Friday at 09:51 PM3 days Solution Yes, state variables exist for the purpose of triggering actions on their values. Integer variables won't do anything in If/And/Or statements, they're only useful for doing calculations, etc.
Saturday at 01:48 AM3 days 3 hours ago, Guy Lavoie said:Yes, state variables exist for the purpose of triggering actions on their values. Integer variables won't do anything in If/And/Or statementsI'd like to add something else here, potentially useful in certain programming situations. My phrase "Integer variables won't do anything in If/And/Or statements" isn't quite true: integer variables can be tested in If/And/Or statements, but they won't trigger the program if they're what end up making the program true, They're useful as static conditions that you might want to be true for other triggering conditions that you want to test for. An example: you might want to test that an alarm system is in armed status to allow some triggering actions, like motion detection to trigger an action. But you might not want that action triggered if motion was already detected and you're now just arming the system. By setting the armed status into an integer variable, you can avoid that second condition from happening.
13 hours ago13 hr To add to the logical possible confusion logic concerning what @Guy Lavoie informed you. State variable do NOT trigger programs if the program is disabled. IOW, if a STATE variable is in a program that is not ENABLED, it will act similar to an INTEGER variable and only act as a filtering condition.
Create an account or sign in to comment