Thanks for this post!! I’m brand new to webCoRE, and was having some struggles until I read this. Mostly due to the fact that I did not understand conditions vs triggers and had pistons with several triggers in them. I believe I’m getting a decent understanding now, and was actually able to fix a few of my funky pistons But had a few questions, if you guys don’t mind?
If I have a piston that is simply “at sunset turn on porch light”. The condition/trigger would be sunset and the event would be turn on. Therefore the piston subscribes to the event of turning on the light based on the condition/trigger being true, correct? Just trying to make sure I have the terminology correct.
I have been able to successfully have pistons with 1 trigger and several conditions. To make these work I put the trigger first in the “if” statement followed by each condition (thanks @bobbles). For each condition I check always subscribe. This seems to successfully override the fact that webCoRE will ignore conditions in a piston that also have triggers present. But can I do the same if I want to have more than one trigger in my “if” statement? Checking always subscribe for each trigger?
What about having more than one “if” statement in a piston? Does each “if” statement have separate rules regarding conditions/triggers? Or does the conditions/triggers rule apply to an entire piston regardless of how many “if’s” there are? This piston below is an example that I’ve yet to be able to fully test, but it has 2 “if” statements. What I’m trying to do is when my wife’s or my phone comes home (changes to present) the smart bulb in my porch light goes from 45% to 100% when it is on which is between 45 minutes to sunset - 15 minutes after sunrise (which is controlled by another piston). Then, once either of our phones presence stays present for 10 minutes the light goes back to 45%.
Thanks again for the discussion in this thread. The terms are a little confusing for me, but I’m getting the hang of it. webCoRE is VERY powerful and interesting to me. I’m amazed all you can do with it!! I currently have a smart bulb in my porch light, switches for my foyer light, living room light and 2 kitchen lights as well as a Schlage connect deadbolt. Plan to add some more switches and eventually some cameras. So I’m sure I’ll be using webCoRE more and more as I add all this stuff.