@Vacation Global Variable


#1

1) Give a description of the problem
I created a piston that would trigger @vacation variable if my wife and I were both NOT present at sunrise. Based upon the triggering of @vacation lights would randomize yada yada yada

2) What is the expected behavior?
I expect @vacation to become true upon the occurrence of sunrise AND my wife and my phones not being present

3) What is happening/not happening?
Nothing is happening. I don’t even have logs.

**4) Post a Green Snapshot of the piston

5) Attach any logs (From ST IDE and by turning logging level to Full)
I have no logs as nothing seems to happen.


#2

In regards to the last part of the piston, the part that sets @vacation to true, I wonder if it might be the order of things, maybe try switching lines 49 and 51 so that the trigger comes before the condition.

Did you actually test the piston through sunrise with logging to full? You should have got logs at sunrise?

Other than that, the while on line 35 wont work because it is inside a trigger, @vacation changing to true only lasts for about 10 seconds and the while will get cancelled.


#3

The While states while @vacation is True… how is that the same as While @vacation changes to True?


#4

Line 25

If @vacation changes to true
Then
while @vacation is true

After about 10 seconds the IF reverts to standby (waiting for the next ‘changes’ to occur), the cancels following ‘while’

Not sure if it applies to this situation but perhaps click on the ‘while’ and change task cancellation policy to ‘never’

However, as ‘changes’ is the only trigger, I’d suggest just changing to ‘IF @vacation IS true’… then it won’t cancel out.


#5

Got it. Now I have logs at Sunrise.

Now I just have to leave town (or be away at Sunrise to see whether the variable flips to true).

Thank You,


#6

Or you could just use a simulated Presence Sensor and arbitrary time for testing :wink:


#7

#toolazy