Away lighting simulator not triggering automatically

triggers

#61

Yep, so I’ve said ‘Always subscribe’ to that and can see a little ‘+’ sign next to the SHM condition. But shouldn’t I do that to the time condition instead of the SHM one?


#62

I think you could probably get away with it. If you still have your test one try both


#63

can you try on line 42 use ''else ''should work or ''async if ‘’ in line 24, try this one first let me know


#64

Sorry I don’t quite understand what you mean…


#65

There is no if on line 24. The reason for the async if on 42 is leftover from trying to trouble shoot this piston before.


#66

try something like this in your piston


#67

So basically replace the while loop with an ‘async if’…?

Could you just explain how and why you think that will help please?


#68

If the previous statement includes a Wait task, all the remaining tasks in the previous statement, and any statement after that, will be delayed pleas read the link below and let me know if that work
https://wiki.webcore.co/Execution_Method


#69

But I don’t want the actions after the wait task to be executed until the wait period has elapsed. Wouldn’t making the whole loop asynchronous mean that the piston will proceed to turn off the randomly selected light and send me a push notification even though the wait period hasn’t elapsed? If so, that’s not what I want. I do however want the if logic below the while loop to be processed even if the while loop is in the middle of it’s logic. I want the if logic to interrupt the while loop if a presence sensor arrives, exit out of the while loop and proceed with the actions in the if logic.


#70

ok, can you try line 25 with if and line 42 with else


#71

OK I need to test it as it is and if it doesn’t work I will try your suggestion.


#72

I am going to use this as a model for my vacation lighting. I noticed you arent repeating after line 35. Did you plan to only have it run once?


#73

Sorry which screenshot are you referring to line 35 in? Have what run once?


#74

I thought this was trying to repeat the steps?


#75

This Piston will continue to turn a random light on for a random number of minutes and then off again between sunset and 1am when we are away. When we get back the Piston breaks out of its loop.


#76

What did your final script look like? I am still having trouble with mine.