Repeat until state changes

conditions
time
triggers
piston

#1

1) Give a description of the problem
Piston works, but not how I want it to

2) What is the expected behaviour?
Constant notifications until change back state.

3) What is happening/not happening?
This piston works in that it detects the open sensor, waits the correct time, and opens the virtual sensor, giving me a notification that the sensor has been open for 5 minutes. But I want it to tell me that it’s STILL open after another 5 minutes, and so on until the sensor closes.
I added the “Repeat” and have tried this at different time lengths, but I think it’s in the wrong place???

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)


#2

I just took a quick look at it and one of the problems is,
1 - every 30 minutes when piston executes, your contact sensor MUST BE in CHANGING TO OPEN state, not 10 seconds after not 10 seconds before which will be almost impossible.

2 - What do you mean at line 41?
is that a real contact sensor or a simulated switch?


#3

With your first if, you wait 5 minutes but you don’t know if the door is still open or not. I would suggest something like this:

if contact sensor stays open for 5 minutes
   and
   time is between 5:29 and 22:30 
then
   while contact sensor is open
      with contact sensor 3             <-- Never cancel tasks
        turn on
        wait 2 minutes
        turn off
        wait 3 minutes
     end with
   end while
end if

This will only run when the sensor has been open for 5 minutes instead of running every 30 minutes and potentially slowing down other pistons. The one case this will not cover is if the sensor is already open at 5:29.


#4

At line 41 is the virtual switch


#5

This piston looks nice and simple… will it repeat if contact sensor remains open?


#6

Yes, the while loop will repeat until the condition is false so it will keep going until the contact sensor closes.