Conditions and Triggers: The difference?




Could someone explain what the lightning bolt represents. I was under the impression that it represented triggers, and if I had two triggers in an if statement, then the piston wouldnt fire. (And I’ve been telling this to others on this forum).

However, the help text says that it’s a condition that subscribes to events. Now I’m bamboozled. Does it show conditions or triggers, or both, or something, and is the presence of two lightning bolts in an if statement problematic? (if one doesn’t change the default subscribe method)

I first noticed it when I had some conditions with the lightning bolt, and thought it was an error.


the lighting bolt represents events that the piston is subscribed to.

if there are 2 triggers in an if condition the piston would fire but never be true because only one trigger can be true at a time.

when there are no triggers in a piston all conditions act like triggers but not as triggers. so all events from those conditions would be subscribed to by the piston and the piston would execute every time one of those events was received.


Cool. I am a newby. A lot of good information here!!


Will a conditional statement work with variables, such as the following…


yes it will.


This is a great thread but I just had one thing I am a little confused on…
The little ‘+’ icon next to a tigger which mean always subscribe, but what exactly does that mean? I just having trouble getting my head around that part sorry.


sorry had missed your question. did you still need an answer on this?


I’m sorry but why the heck are the triggers and conditions in a forum. Why is there not a concise page of the definitions for each them. Do I actually have to sift through pages of questions to get simple noobie information.



I think the first post in this thread summarizes quite nicely


so users looking for this information can find it readily. also note that this section of forum is for Instructions & Tutorials.

triggers and conditions work hand in hand so bringing those topics together in one post often makes it easier for users.

no. start by reading this post:


So I finally decided to move my pistons from CoRe to WebCoRe and after reading though a lot of things, I can’t figure out how to remake the below Or-If piston from CoRe in WebCoRe. Any idea would be greatly appreciated. Thanks.


It is usually best to ask new questions in a new thread so more people see your question…

I think basically you can drop the “OR IF” and simply make a new IF statement.

IF contact is open
Motion is active
    Then turn on light

IF contact is closed
    Then do a bunch of stuff

I am not sure of your final logic piece.
What do you want to be the trigger for turning off the light?

I usually do this:

IF motion stays inactive for 2 minutes
    Then turn off light


Oh my, that’s seems so simple, I nearly feel dumb that I couldn’t figure this out. Thanks so much @WCmore.
And for my last piece I think I can do it as:

IF motion stays inactive for 2 minutes
contact is open
    Then turn off light

Cause I want to make sure that the light doesn’t go off if the contact is closed.

Thanks so much!


If your last post doesn’t work, try this slight variation:

IF motion stays inactive for 2 minutes
        IF contact is open
            Then turn off light
        END IF

If memory serves me correctly, your code checks the contact at the beginning of the 2 minutes, and mine doesn’t check until AFTER the 2 minutes have passed.


Hi @bengali

Thanks for the comprehensive write up.

However there was one thing that got me confused, either I havent fully understood the matter yet or perhaps an error sneaked in…

In your last example you are showing a version with two conditions and no triggers.
Yet it says “Temp sensor 1’s temperature rises above 80ºF” - isnt that a trigger and should read “Temp sensor 1’s temperatur is greater than 80ºF” instead?


shows you no one reads the full post.



Perhaps because the matter was so well explained in your posting that people got it very early on and didnt feel the need to read it through the end :wink:

I am just the slow one :smiley:
Thanks again, it was really helpful to read!


Does it still work tho?


Someone posted this piston for help. It does have problems, but I wanted to use it to teach me some things.

This piston subscribes at line 38.

  1. Does piston execution start at that point or does the piston run from the top?
  2. Does this piston execute each time motion changes to active and time falls within 10 pm and sunrise?
  3. Does it also run each day at sunrise and sunset?

Thanks for any help.

  1. top
  2. executes at sunrise, sunset, motion active and motion inactive.
  3. yes