Help with "turn everything off" piston


#1

1) Give a description of the problem
I have two actions to carry out at different times depending on the day of the week. The first part (monday, tuesday, wednesday and friday) fires as it is supposed to except when restriction “presence” have not been met. Then nothing happens. Action two (Smart switch) fires as intended. Last part (thursday) doesn´t fire at all.

2) What is the expected behavior?
Monday, tuesday, wednesday and friday when it is 07.45 turn off the mentioned devices, bur only if I am not present and the Switch is off (the switch is for turning off this piston during holidays). When sun rises turn off the smart switch (christmas lights).
On thursdays do as above but at 06.45 in the morning

3) What is happening/not happening?
At 07.45 the action fires if the switch is off and I am not present. But if I stay home until after 07.45 the action doesn´t fire when I leave.
At 06.45 on thursddays nothing is happening.

**4) Post a Green Snapshot of the piston!

Any help is appreciated


#2

I suggest changing you presence sensor 1 is not present to a group with changes to not present or is not present. That will add the trigger for when you leave later. Then take the if statements out of the else sections and let each stand on its own.


#3

Tried that now, but I cannot select Changes to not present. When I select that, I only get the possibility to set seconds:

I never tried groups before, but does this look right:

image


#4

I always have a hard time understanding someone elses piston and find my way in it.

If you can share step by step what it is you want to accomplish with this piston (in your house) I might be able to come up with a draft…


#5

Understandable, I will do so tomorrow


#6

@ike2018 So:

Monday, tuesday, wednesday and friday i want the selected devices to turn off at a specific time.
Thursday I want selected devices to turn off at another specific time.
All weekdays I want switch 3 to turn off at yet another specific time

This should only happen when switch 4 is off and presence sensor is not present
If presence sensor leaves it should turn the selected devices off


#7

Hi @Doozer76
So lets start with the main trigger and condition.

IF Presense sensor changes to OFF (trigger)
and
IF Presense sensor is OFF (condition)
and
IF Switch 4 is OFF (condition)
(now, days will be indivudually IFs inside the main trigger/condition IF)
-------IF Time is X on Monday, Tueday, Wednesday, Friday
-------Then with selected devices
-------Do this do that
-------IF time is X on Thursday
-------Then with selected devices
-------Do this do that
-------IF time is Y
-------Then with switch 3
Turn OFF

Personally I stay away from ELSE unless I MUST to use it:)))


#8

I would probably do something similar to your first piston, but make each IF statement stand-alone.

Only when Switch 4 is off
     and
     Presense Sensor is not present
Every day at 7:45am (but only on M, T, W, or F)
     Turn off lights
End Every

Only when Switch 4 is off
     and
     Presense Sensor is not present
Every day at 6:45am (but only on Thursdays)
     Turn off lights
End Every

I would keep your sunrise commands in a different piston called Sunrise. (since this will likely grow and get more complex as you get comfortable with webCoRE)

Likewise, I would create another piston for when you leave the house (presense sensor changing to away) for the very same reason.


#9

no no no use my way…use my way…@Wcmore is an expert and a coder, this is not even a fair race (poor guy thinks this is a competition) LOL :rofl::rofl::joy::joy::joy::rofl::rofl::rofl:

love it… very neat…as ussual…


#10

I am very thankful for the help. I will test this tomorrow or Sunday and report my findings


#11

Ok so this is what I have done, but I am having doubt about the “else if” part. I am not sure where to put the second if (thursdays):


#12

Skip the ELSE IF and make two IF blocks independent, as shown here.


#13

Yes, sorry I completely misunderstood the syntax, but now I do:

Thanks again


#14

Lookin’ good!!