Adding a wait instead of fixed time plus bonus question


#1

1) Give a description of the problem
My wake up piston is designed to start at a fixed time, then turn on one lamp, then at another fixed time turn on another lamp, to give the effect of a smooth sunrise. I do not like the fixed times and want to add a Wait instead, so that when the first lamp turns on, before turning on the other lamp, wait X time. I have tried adding the wait before, but it did not work.
On top of that I have two restrictions (switches), that, when either is on, should stop the piston from running, but it doesn´t work.

2) What is the expected behavior?
When switch 4 or 6 is on, do not run the piston.

3) What is happening/not happening?
Piston runs even though either of the switches are on.

Any help would be appreciated, thanks


#2

For all practical purposes, once a fade begins, it will continue to fade until the time has elapsed.
(IE: if you manually adjust the level during a fade, a few moments later it will resume the fade process)

Personally, I never start a fade unless my intention is to let it run to completion.
(either that, or I make much shorter fade durations)


#3

@WCmore The fade is meant to run until the end. The switches are for the purpose of not running the piston on holidays and days off at all


#4

OK, cool…

Instead of a wait, why not use a structure something like this:


Of course, you could also put those 3 delays into their own variables, like this:


#5

Nice I will try this tomorrow.

What about the restrictions? Any idea why they are not working?


#6

I tend to use conditional IF’s instead of restrictions, but your mileage may vary.


#7

Excellent. I have made it like this no. I am out of house to noght, so I am sure wife will report back very fast tomorrow if I messed it up :slight_smile:


#8

Just a heads up… Your Switch 4 & 6 is only going to be checked for the first block of code. The other 3 blocks will run 5 days a week… I am not sure if that was what you intended.


#9

Oh yeah, thanks. But that was actually the reason why I wanted the restrictions at the beginning.

What is the reason for not using those BTW?


#10

Personal preference. Your mileage may vary


#11

Ok, so the first piston with restrictions should work, but mileage may vary as restrictions doesn´t always work?

I have made the into IFs instead.

Thank you for your help.