Webcore Structure of if then statements (new to webcore)


#1

1) Give a description of the problem
I am new to webcore, I would like to make sure that I am structuring things correctly

2) What is the expected behavior?
I have an if statement at the top. These are presence sensors to detect when certain people arrive. Based on their presence, I would like lots of things to happen. For example, the first thing that happens is a two lights will toggle on and off. The second thing that happens is our cabinet lights turn on to 100%. The third thing is our outside lights turn on (after sunset) for 5 minutes and then turn off). And the final thing I have set up is that a virtual switch showing that someone is present is switched on. What I am not sure of is the structure that this is. It, just doesn’t seem right the way I have it but maybe it is, looking for any help and input to keep it as simple as possible.

3) What is happening/not happening?
(PUT YOUR INFO HERE)

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS THEN HIGHLIGHT ALL OF THE LOGS SND CLICK ON THE </> ICON TO FORMAT THEM)


#2

You are embedding IF blocks within other IF blocks, would be better to build them as separate blocks.

Also, the first and last IF blocks use the same trigger so you could simply put both actions into one IF block.

If presence 1-5 changes to present
With
keypad and outlet
Do
Blah blah
End do
End with

With
Switch 6
Do
Turn on
End do
End with