Jump to content

Need help with simple program


brain shocker

Recommended Posts

Posted

I have four 2477D switches controlling lights in my kitchen, I would like it if any one switch is "on" set a variable to 1 or if all the switches are "off" set the variable to 0. Can this be done with one program?Please excuse the wording just trying to figure out how to make it work and this is my first program using a variable.

 

IF

kitchen island control is on

or

kitchen valence control is on

or

kitchen pots control is on

or

kitchen dining control is on

 

THEN

s.lights_ON = 1

 

ELSE

s.lights_ON = 0

Posted

Hi brain shocker-

 

Program:

If
  Status kitchen island is on
  or Status valencel is on
  or Status kitchen pots is on
  or Status kitchen dining is on

Then
  s.lights_ON = 1

Else
  s.lights_ON = 0

 

Should do what you want. The point is: use the "Status: of the devices rather than "Control".

 

-Xathros

Posted

 

Should do what you want. The point is: use the "Status: of the devices rather than "Control".

 

-Xathros

 

Just curious for future reference why use status? Will this also change the variable if a program turns "on" and "off" one of the lights?

Posted

 

Should do what you want. The point is: use the "Status: of the devices rather than "Control".

 

-Xathros

 

Just curious for future reference why use status? Will this also change the variable if a program turns "on" and "off" one of the lights?

 

"Status" will trigger the program whenever the status of the device changes. From off to On or On to off or to any dim level in between. Status will trigger if the device is manually operated, changed by a scene or directly commanded by a program as long as the device's status actually changes. Status will NOT trigger if a device is already on and is switched on again or off and switched off again.

 

"Control", in contrast, will only trigger when a device is locally operated with its paddle and only for the specified control. For instance:

 

If

Control Kitchen_Counter is Switched On

 

Will trigger if you walk up to the switch and tap the On portion of the paddle regardless of whether its already on or not. It will not trigger if you press the Off portion or if you press and hold to fade up or down or fast on/fast off - all of those have their own control events that can be specified. It also will not trigger if the device is commanded on by a linked scene or by a program. A control event only exists for that brief moment when you activate the control whereas a device always has a status.

 

Example:

 

If

Time is 3:30Pm

and Control Kitchen_Light is Switched On

 

Then

Do something

 

Is quite unlikely to ever do anything because the likelihood of someone turning on the kitchen light at the exact second that is 3:30pm is quite low. If, however, we used status instead:

 

If

Time is 3:30Pm

and Status Kitchen_Light is On

 

Then

Do something

 

Then something will happen at 3:30PM if the kitchen light is on.

 

Hope this helps.

 

-Xathros

Posted

In addition to what Xathros said;

If you wish to set the variable when all lights are completely 'Off' I believe you should use 'is not Off' instead of 'is On' since the 2477D is a dimmer.

~Mike

 

If

Status 'kitchen island' is not Off

or Status 'valence' is not Off

or Status 'kitchen pots' is not Off

or Status 'kitchen dining' is not Off

 

Then

s.lights_ON = 1

 

Else

s.lights_ON = 0

Posted
In addition to what Xathros said;

If you wish to set the variable when all lights are completely 'Off' I believe you should use 'is not Off' instead of 'is On' since the 2477D is a dimmer.

~Mike

 

If

Status 'kitchen island' is not Off

or Status 'valence' is not Off

or Status 'kitchen pots' is not Off

or Status 'kitchen dining' is not Off

 

Then

s.lights_ON = 1

 

Else

s.lights_ON = 0[/quote

 

Excellent point!

 

-Xathros

Guest
This topic is now closed to further replies.

×
×
  • Create New...