WAIT task does not work even TCP is set to never


#1

1) Give a description of the problem
Seems that I’m not the only one with the challenges with Wait in pistons. I have learn from other posts that TCP should be se to never and this has fixed problems with others, but for some reason it does not fix my issue. So the wait does not work as it should and most probably I’m doing something wrong but what?

2) What is the expected behaviour?
I’m expecting to see specified delay in my code with Wait task. Tried 5…15min.

3) What is happening/not happening?
Piston is not waiting the specified time in Wait task. It’s stopping and starting piston from the beginning right away when state is changed.

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach logs after turning logging level to Full
Log1
Log2


#2

Well, you have two triggers so the piston will be called any time either of those values change so it can check if it meets the conditions. Can’t avoid that as long as you have triggers. Not sure if you really need to trigger off both but that is your call depending on what you are trying to accomplish.


#3

At this point I think I do need both triggers.

Is there any workaround?


#4

I believe you can’t stop the piston from executing again by using wait.
You can try some other ways

  • pausing and resuming a piston
  • using a variable as condition.

let me give you an example for the second one.
you can use two seperate pistons

Piston #1

IF switch changes to ON
AND
IF globalvariable is TRUE
   then 
   Do this do that 
   Set the globalvariable to FALSE 

Now with this piston above after the first time it will never fully execute because of your second condition.

Another piston - piston #2 is the timer.

IF global variable changes to FALSE
Then 
Wait 5 minutes
Set globalvariable to TRUE

#5

So would it look like this then if I use the global variable approach?

I’m assuming that I still need to use TCP never for 2nd IF, right?


#6

this latest piston you posted will execute again again because you need to use the variable as a CONDITION in your first IF BLOCK.

second,
I wouldn’t use the variable (second if block) as a condition but that one needs to be trigger.
IF variable CHANGES TO …

third,
I’ve never use TCP right next to IF, so not sure if that works or not?
I’d use on line 27 with THEN

and,
I never used my suggested two pistons in a single piston. So not sure how well it works in a single piston.
So if you get not efficent results, this might be the problem FYI.


#7

OK, now I got it (probably) - I need to make two pistons which talks together via global variable.

How does them look now?


#8

looks good to me.
My only worry would be 3 conditions acting as a trigger.
I’m not saying it won’t work don’t get me wrong, I’m just saying I’ve never used it this way.
I’m one of those, “First a trigger and them several conditions if you want to” guys…

But please test it.


#9

Okay, I will try it. I will give feedback after tested.

Thanks already of support :grinning:


#10

Just for clarification, the original post will work if the TCP is set on the WITH block.
(instead of the IF block)


But as mentioned previously, it will be triggering all day long…
(any time the temperature or maxHumidity changes at all)


Edit:

Nevermind… I see you have no commands after the WAIT… So the WAIT is useless in that piston


#11

With regard to the original piston, if you need to change the TCP you should do so on either the action (‘with’) containing the wait, or the ‘wait’ task itself.

Although it can also be set on ‘if’ and other conditionals, I have yet to work out what on earth it does when it is there (apart from once seeing it breaking an otherwise trivial piston).

Ah, beaten to it …


#12

This worked. Thank you very much.