Design help for lamp depending on switch status


#1

1) Give a description of the problem
Design of piston for

If time between 8pm and 11am
AND
Kids Door opens

Then
IF hallway lamp switch on
Set level at 60%
Wait 5 minutes
Set level at 20%

OR

If hallway lamp switch off
Set level at 60%
Wait 5 minutes
Turn off

**4)

This is hit or miss, of the door closes the timer exits and the light does not turn off or dim depending on the state.


#2

In edit mode, open your two WITH statements, click on the small cog on the bottom right corner and change the task cancellation policy to Never Cancel Tasks. Where it currently sits on the IF statement at the top of your piston won’t have the same effect.

You might also consider changing the “Time is between” statement to “Time is Not Between 11:00 AM and 8:00 PM” as occasionally webCoRE does strange things when midnight is included in the range.


#3

As suggested, the ‘Never Cancel’ for TCP should go on the ‘with’ statement (or it would work on the wait in your case). I’ve never managed to work out what it does on the ‘if’ but it can be weird.

I would also suggest swapping over the conditions on lines 14 and 16 so the ‘contact changes to open’ trigger comes first. As it stands you might sometimes find the first open of the evening doesn’t get recognised.