Conditions with Time frames


#1

I’ve got a piston that I intended for it to turn on if between sunset and midnight and door contact is closed. The piston never executes. I’m aware that both are conditions and not triggers, but I thought time conditions were evaluated when the even happens. In this case, the piston will evaluate at sunrise and if the door contact is close, it’ll turn the light on, yet it doesn’t. Am I not understanding this correctly or do I have something else going on?

Thank you.


#2

Please can you post a green snapshot of the piston.


#3

Line 59 is where I’m having the problem. Thank you.


#4

Give this a try.

Ok so what I’ve done here is to move all three of your triggers that turn the light off into a single list for the one action.

Your time between was causing problems having 2 triggers in the same if so I’ve changed it to a door trigger with the time as a restriction instead. And a time trigger with the door as a restriction.


#5

Thank you, I’ll try it when I get home. What is the “async if”? I’m not familiar with that


#6

Async allows asynchronous actions. It won’t wait for the first one in line to finish before starting the next one. Something like that anyway.


#7

No need for the async ifs. Not going to cause problems but it doesn’t change anything either.

Since none of these ifs will happen at the same time they are not needed. Also there are no waits in the piston which is what the async would allow the piston to skip over continuing to evaluate anything beyond that wait.

More info can be found here about async and sync execution.


#8

Here it is with no async. Sorry it’s a habit of mine coz I’m always using waits.

Another habit you may have noticed is the forcing of subscriptions!


#9

Where do I see that you are forcing subsriptions? I think I know what you mean…but not sure.


#10

The purple plus symbol at the end of the lines.
It’s not normally necessary but I do it all the time it’s only used when mixing triggers and conditions in the same piston and when you require them both to trigger the piston to re-evaluate.