Piston waited at a semaphore did the piston actually run?


I have a piston that I’m not sure has ever actually run. I noticed in the logs today that there is an extremely large number of “piston waited at a semaphore”. This piston basically watches to see if a presence switch (virtual) is turned off and a switch is turned on, the Piston will turn it off.
Here is a short list of the log:


12/2/2019, 11:14:46 AM +841ms
+10143ms ║Piston waited at a semaphore for 10013ms
12/1/2019, 6:38:24 PM +422ms
+10152ms ║Piston waited at a semaphore for 10014ms
12/1/2019, 6:38:23 PM +381ms
+10149ms ║Piston waited at a semaphore for 10021ms
12/1/2019, 5:41:45 PM +423ms
+10215ms ║Piston waited at a semaphore for 10070ms
12/1/2019, 5:41:45 PM +321ms
+9948ms ║Piston waited at a semaphore for 9823ms

And here is the piston:


I would recommend that we never code like this:

IF Bulb1, Bulb2 or Switch7 changes to on
    Then turn off Bulb1, Bulb2 and Switch7

The logic is, each time any of them turn on (or off), the piston will run top to bottom. So essentially, by turning off 8 devices that are also a trigger, the piston tries to start at the top (as many as) 8 times in the same second.

Hence, your semaphore delays, and piston’s unreliability.

Basically, don’t control a device’s attributes that is also a trigger in that same piston.


Lesson learned… Thank you. So how would I go about keeping those devices OFF if the first switch is off? Basically, I’m trying to prevent them from being turned on in the first place.


Rap them on the knuckles with a ruler… They will learn quickly, LOL

All jokes aside… Are you trying to prevent other family members from using certain devices when you are not home?

I may be getting a bit philosophical here, but personally, I do not think webCoRE should be used to block our “free-will”. What I usually do is something like this:

IF Device stays on for 15 minutes
    IF Presence is away
        Turn off Device
    END IF

This still allows somewhat user control, but prevents devices from running much when you are gone. It also prevents multiple triggers from firing all at once, so no semaphore delays.

In addition to the above, my “Leaving the house” piston will turn off many (most) of my devices a few minutes after I leave the house. This way I am covered by both angles.


I am perfectly okay with the rap on the knuckles. It is most likely the best solution. LOL

You certainly are on to me with your observation. The problem occurs because one sibling refuses to use SmartThings as she believes it is simply spying on her. I’m sure in time she will outgrow this. Until then though, if she is the only one home and goes into other siblings room and turns things on and leaves them on they would like that not to happen. Just like you, when everyone leaves most devices turn off within a few minutes. It’s when the devices in those other rooms are turned on we would like to work on. Perhaps your suggestion of the 15-minute window will accomplish this.


Im I doing something wrong here! why it gives me this message all the time “Piston waited at a semaphore for 7013ms”


did you figure out an answer to your semaphore question?