Jump to content

Correct way to program a fan or light to turn off? control vs status.


chachdog

Recommended Posts

I am a bit confused status vs condition for the If statement. These switches are not in any scenes. 

 

On/off bath fan switch. Would like to program if fan is on, wait 15 min turn it off. 

 

 

control is on, fast on, fade up 

vs

status is responding

or

status is not off. 

 

I have it working with status is not off. just curious if this is right. 

 

 

 

Also have a dimmer in the bathroom and would like to program: 

 

if light is on , wait 15 min turn it off. 

 

not sure which is the preferred method. 

 

control is on, fast on, fade up 

vs

status is responding. 

or again status is not off. 

 

thanks!

Link to comment

"If Control" is reacting to manual action of the device by a human.  Someone pushed the paddle/button.   "If Control" does not trigger the Program when the device is reacting to another device/Scene/Program.

"If Status" is reacting to the state of the device.  The device can be manually operated, turned On/Off by another device/Scene/Program.   Anything that changes the state of the device can trigger a Program.

 

As a side note, "responding/not responding" is used to check comm with the device, not to check what state the device is in.

 

Since these devices/switches are only being operated manually either type check works but using "If Status" is easier as it is not necessary to check for multiple commands.

 

If Status 'device' is not Off

Then

     Wait 15 minutes

     Set 'device' Off

Else 

Link to comment

ah I didn't know that about the responding/not responding. I though it was responding meaning any level of on or not responding was off. 

 

Control Q. 

 

So when trying to setup a program override and someone controls the light switch button manually how can i have it disable a program.

 

Do you have to specify all actions? If control is switched on, fast on, fade up, fade down?  

 

or will a control is not off cover all of them? 

Link to comment

There is no catch all for "If Control".   Each command that can be expected must be checked.

 

If Control 'device' is switched On

Or Control 'device' is switched Fast On

Or Control 'device' is switched Fade Up
Or Control ' device' is switched Bright

Or Control 'device' is switched Dim

Or Control 'device' is switched Fade Down

etc .......

Link to comment

Regarding control versus status, both are useful, but I would focus on what triggers a control/status statement and what does not, then understand that, once triggered, whether it is true or false.

 

As far as disabling a program, yes, another program can disable the first. You need to decide under what conditions you want the program disabled. When someone turns on a switch (is it a dimmer or relay switch)? When someone turns off a switch? When a switch achieves a certain brightness level? When somebody dims or brightens a switch? Are there multiple switches involved?

 

Rather than offer specific solutions, I suggest you simply decide what actions you want to cause a program to be disabled and we can go from there.

Link to comment

user turns on light via dimmer switch > disables program. 

user turns off lights via dimmer switch > enables program again. 

 

Why isn't "control not off"  the same as any one or all of those on commands you specified?

 

Does this not work like this? 

 

user turns on light via dimmer switch > disables program.

 

It is no longer control off: so "control not off"  triggers true and disables the program. 

 

and then: 

person switches the dimmer off. 

 

"control not ON" enables the program again. 

Link to comment

When using "If Control" the commands must match the If statements.
 

If Control 'device' is switched On

Or Control 'device' is not switched Off

Then

   Disable Program

   .

Else

   Enable Program

   . 

 

The Then clause is driven when On command received from device

 

The Else clause is driven when Off command received from device 

 

 

The Actions/rules that If Control uses are not the same as If Status.

Link to comment

For CONTROL DEVICE XXX statements, they will trigger an evaluation only when the device is acted upon manually, and only when the specific XXX is recieved and will always evaluate TRUE when triggered.  IOW, Control Dimmer is ON will trigger only when the dimmer button is pressed directly and only when pressed ON.  OFF will not trigger it.  DIM or BRIGHT will not trigger it.  Additionally, CONTROL DEVICE IS NOT XXX will only trigger when the XXX command is received and will always evaluate FALSE when triggered.

 

If you want a program that disables a program when a dimmer button is pressed ON and enable a program when pressed OFF:

 

If

Control Dimmer Button is ON  <<<will trigger from ON command and evaluate true...all other times be false

and

Control Dimmer Button is NOT OFF  <<<will trigger from OFF command and evaluate false...all other times be true

then

disable program

else

enable program

 

If not obvious, a condition with multiple statements will trigger and evaluation when any of the individual statements are triggered, but the entire condition will be evaluated.  So, when the ON command is received, the first condition triggers an evaluation, but both statements must be true for the condition to be true (AND) and runs THEN path.  When the OFF command is received, the second condition triggers an evaluation, and if any of the statements are false, then the entire condition is false and runs ELSE path. 

Link to comment
So if someone touches a dimmer, it will disable the program based on this program?

 

is this right? 

 

If

Control Dimmer Button is ON  <<<will trigger from ON command and evaluate true...all other times be false

Or Control 'device' is switched Fast On

Or Control 'device' is switched Fade Up

Or Control ' device' is switched Bright

Or Control 'device' is switched Dim

Or Control 'device' is switched Fade Down

 

and (

Control Dimmer Button is NOT OFF  <<<will trigger from OFF command and evaluate false...all other times be true

or Control Dimmer button is NOT FAST OFF

)

 

then

disable program

else

enable program

 

 

Edited: added And() to off section

 

thanks!

Link to comment

 

So if someone touches a dimmer, it will disable the program based on this program?
 
is this right? 
 
If
Control Dimmer Button is ON  <<<will trigger from ON command and evaluate true...all other times be false
Or Control 'device' is switched Fast On
Or Control 'device' is switched Fade Up
Or Control ' device' is switched Bright
Or Control 'device' is switched Dim
Or Control 'device' is switched Fade Down
 
and (
Control Dimmer Button is NOT OFF  <<<will trigger from OFF command and evaluate false...all other times be true
or Control Dimmer button is NOT FAST OFF
)
 
then
disable program
else
enable program
 
 
Edited: added And() to off section
 
thanks!

 

 

By this line

 

Control Dimmer Button is ON

 

Do you actually mean

Control 'Dimmer Button' is switched on

 

Is "Dimmer Button" the name of the device that your refer to as "device" in all the other lines of code?  And the other two lines in your and clause also?

 

If indeed that is the case, then any action on that switch will trigger the program with off and fast off trigger the else clause.  Keep in mind, that someone could dim down the switch all the way to off and your program will still run true, which I don't think is your intent.

Link to comment
If

Control Dimmer Button is ON  <<<will trigger from ON command and evaluate true...all other times be false Not so. Each and any one of the following statements will cause the program to evaluate as true.

Or Control 'device' is switched Fast On

Or Control 'device' is switched Fade Up

Or Control ' device' is switched Bright

Or Control 'device' is switched Dim

Or Control 'device' is switched Fade Down

Link to comment

By this line

 

Control Dimmer Button is ON

 

Do you actually mean

Control 'Dimmer Button' is switched on

 

I assume this is, simply, cut from my earlier suggested program (post #8).  Yes, the syntax is probably inaccurate and should be "switched" on.  I also assume "device" and "dimmer button" are synonymous.

 

Not so. Each and any one of the following statements will cause the program to evaluate as true.

 

stusviews...I suspect the statement in red is also left over from my earlier suggestion (post #8) and no longer applies, given the additional statements in the condition that you correctly point out would also trigger a TRUE result.

Link to comment
  • 2 weeks later...

"For CONTROL DEVICE XXX statements, they will trigger an evaluation only when the device is acted upon manually, and only when the specific XXX is recieved and will always evaluate TRUE when triggered.  IOW, Control Dimmer is ON will trigger only when the dimmer button is pressed directly and only when pressed ON.  OFF will not trigger it.  DIM or BRIGHT will not trigger it.  Additionally, CONTROL DEVICE IS NOT XXX will only trigger when the XXX command is received and will always evaluate FALSE when triggered.

 

If you want a program that disables a program when a dimmer button is pressed ON and enable a program when pressed OFF:

 

If

Control Dimmer Button is ON  <<<will trigger from ON command and evaluate true...all other times be false

and

Control Dimmer Button is NOT OFF  <<<will trigger from OFF command and evaluate false...all other times be true

then

disable program

else

enable program

 

If not obvious, a condition with multiple statements will trigger and evaluation when any of the individual statements are triggered, but the entire condition will be evaluated.  So, when the ON command is received, the first condition triggers an evaluation, but both statements must be true for the condition to be true (AND) and runs THEN path.  When the OFF command is received, the second condition triggers an evaluation, and if any of the statements are false, then the entire condition is false and runs ELSE path. 

 

"

 

 

I am testing this again. Turning the switch off or fast off or one touch fade down to i assume ends in a fade stop when the lights go out doesn't trigger the else statement.   I

 

Turning the switch up or down (not off) does disable the program though. 

 

Is something missing?

 

Can i just create a new program that says if control is off, is fast off is fade stop then enable? 

 

 

 

 

Kitchen Cabinet Motion Override - [iD 0016][Parent 001A]
 
If
        Control 'Kitchen / Kitchen Cabinets' is switched On
     Or Control 'Kitchen / Kitchen Cabinets' is switched Fast On
     Or Control 'Kitchen / Kitchen Cabinets' is switched Fade Up
     Or Control 'Kitchen / Kitchen Cabinets' is switched Fade Down
     Or Control 'Kitchen / Kitchen Cabinets' is switched Bright
     Or Control 'Kitchen / Kitchen Cabinets' is switched Dim
     Or Control 'Kitchen / Kitchen Cabinets' is not switched Off
     Or Control 'Kitchen / Kitchen Cabinets' is not switched Fast Off
     Or Control 'Kitchen / Kitchen Cabinets' is not switched Fade Stop
 
Then
        Disable Program 'Kitchen Cabinet Motion'
 
Else
        Wait  45 seconds
        Enable Program 'Kitchen Cabinet Motion'
 
 
Link to comment

The groupings are tricky for these multiple Then and Else invocations conditions.

Negative conditions require ANDs for the logic to be treated as a group negative of (positive ORs). DeMorgans theorem.

 

ie.  not(D or E or F) =  (not D)  and  (not E)  and  (not F)....   substitute 'and'  for  'not(or)'

Kitchen Cabinet Motion Override - [ID 0016][Parent 001A]

If
     (
        Control 'Kitchen / Kitchen Cabinets' is switched On
     Or Control 'Kitchen / Kitchen Cabinets' is switched Fast On
     Or Control 'Kitchen / Kitchen Cabinets' is switched Fade Up
     Or Control 'Kitchen / Kitchen Cabinets' is switched Fade Down
     Or Control 'Kitchen / Kitchen Cabinets' is switched Bright
     Or Control 'Kitchen / Kitchen Cabinets' is switched Dim
     )
    AND
       Control 'Kitchen / Kitchen Cabinets' is not switched Off
    AND
       Control 'Kitchen / Kitchen Cabinets' is not switched Fast Off
    AND 
       Control 'Kitchen / Kitchen Cabinets' is not switched Fade Stop

Then
        Disable Program 'Kitchen Cabinet Motion'

Else
        Wait  45 seconds
        Enable Program 'Kitchen Cabinet Motion'

Link to comment

ah thanks that seems to work better.

 

I can disable the program by pushing up or down on the dimmer but when I push and hold the down button, the lights turn off but the program does not re enable. It does with a fast off or a one click off. 

 

I am kind of confused about the fade down and fade stop. Could I add an and if "status is off" line to the bottom section? 

Link to comment

ah thanks that seems to work better.

 

I can disable the program by pushing up or down on the dimmer but when I push and hold the down button, the lights turn off but the program does not re enable. It does with a fast off or a one click off. 

 

I am kind of confused about the fade down and fade stop. Could I add an and if "status is off" line to the bottom section? 

One If section per program. Your program can call another program and do another "If". Disbale this program if triggers are not wanted to interfere with the logic.

 

I never use Fade Up/Down or Fade Stop. Holding the paddle Up or Down for longer than a tap sends a Dim/Brighten  command that I trap for setting scenes.

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...