Conditions and Triggers: The difference?

difference
faq
conditions
triggers

#105

Bump…anyone?


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.


#106

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.


#107

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


#108

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


#109

yes it will.


#110

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.


#111

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


#112

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.

Thanks
Matt


#113

I think the first post in this thread summarizes quite nicely


#114

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:


#115

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.


#116

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
and
Motion is active
    Then turn on light
END IF

IF contact is closed
    Then do a bunch of stuff
END IF

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
END IF

#117

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
and
contact is open
    Then turn off light
END IF

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

Thanks so much!


#118

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

IF motion stays inactive for 2 minutes
    Then
        IF contact is open
            Then turn off light
        END IF
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.


#120

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?


#121

shows you no one reads the full post.

fixed.


#122

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!


#123

Does it still work tho?


#124

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.


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