Jump to content

Cycle FanLinc speeds on KPL


iostream212

Recommended Posts

Are 4 buttons being used for Off, Low. Med, High or trying to move through each of the 4 possible settings with a single KeypadLinc button. If the later a variable reflecting the last setting so a different Program can be triggered by the single KeypadLinc button to move to the next setting.

 

A single button requires 4 Programs (maybe three if creative with True/False condition). Each Program triggers with a button press and a different variable value to move to the next Fan speed. Also updates the variable value so next button press invokes the next Program.

Link to comment

Here's what I am using. Only had it going for a couple days (since 3.2.0) but so far no problems. The only thing I haven't got in place yet is a scene to control the keypad LEDs, as right now the LED can be off when the fan is on and vice versa.

 

Total of 5 programs - 4 to cycle between speeds, and 1 to turn off on a double-click (this one isn't required, just for convenience). The cycle programs are all identical except for respective speeds. I have one using a KPL button, and one using a RL2 button.

 

Living Room Fan Off

If

Control 'Living Room KPL - B' is switched Fast On

Or Control 'Living Room KPL - B' is switched Fast Off

 

Then

Set 'Living Room FanLinc-Fan' Off

 

Else

- No Actions - (To add one, press 'Action')

 

Living Room Fan Cycle Off-Low

If

(

Control 'Living Room KPL - B' is switched On

Or Control 'Living Room KPL - B' is switched Off

)

And Status 'Living Room FanLinc-Fan' is Off

 

Then

Set 'Living Room FanLinc-Fan' Low

 

Else

- No Actions - (To add one, press 'Action')

 

 

Living Room Fan Cycle Low-Med

If

(

Control 'Living Room KPL - B' is switched On

Or Control 'Living Room KPL - B' is switched Off

)

And Status 'Living Room FanLinc-Fan' is Low

 

Then

Set 'Living Room FanLinc-Fan' Med

 

Else

- No Actions - (To add one, press 'Action')

 

 

Living Room Fan Cycle Med-Hi

If

(

Control 'Living Room KPL - B' is switched On

Or Control 'Living Room KPL - B' is switched Off

)

And Status 'Living Room FanLinc-Fan' is Med

 

Then

Set 'Living Room FanLinc-Fan' High

 

Else

- No Actions - (To add one, press 'Action')

 

 

Living Room Fan Cycle Hi-Off

If

(

Control 'Living Room KPL - B' is switched On

Or Control 'Living Room KPL - B' is switched Off

)

And Status 'Living Room FanLinc-Fan' is High

 

Then

Set 'Living Room FanLinc-Fan' Off

 

Else

- No Actions - (To add one, press 'Action')

Link to comment

Thank you LeeG! That got the ball rolling again. I forgot about state variables. Also to check the variable with different programs was the piece that I was missing. So this is what I did (for single KPL button to cycle fan modes):

1.) Create a state variable for fan speed

 

Program 1: Adds 1 to the state variable when KPL button is turned on.

If
       Control 'Office Fan Light / Office - D - Fan' is switched On

Then
       $OfficeFanSpeed += 1

Else
  - No Actions - (To add one, press 'Action')

 

Program 2, 3, and 4 respond based on the state variable's value. (Showing only one program that sets fan speed).

If
       $OfficeFanSpeed is 1

Then
       Set 'Office Fan-Fan' Low

Else
  - No Actions - (To add one, press 'Action')

 

Program 5 acts when the KPL is turned off and the fan speed is on high. It turns off the fan and resets the variable.

If
       Control 'Office Fan Light / Office - D - Fan' is switched Off
   And $OfficeFanSpeed is 3

Then
       $OfficeFanSpeed  = 0
       Set 'Office Fan-Fan' Off

Else
  - No Actions - (To add one, press 'Action')

 

Edit:

dzarn - We must have been posting at the same time! I like your idea on the fast off. I'm editing my program now to add that. Thanks guys you are awesome.

Link to comment
Thank you LeeG! That got the ball rolling again. I forgot about state variables. Also to check the variable with different programs was the piece that I was missing. So this is what I did (for single KPL button to cycle fan modes):

1.) Create a state variable for fan speed

 

Program 1: Adds 1 to the state variable when KPL button is turned on.

If
       Control 'Office Fan Light / Office - D - Fan' is switched On

Then
       $OfficeFanSpeed += 1

Else
  - No Actions - (To add one, press 'Action')

 

Program 2, 3, and 4 respond based on the state variable's value. (Showing only one program that sets fan speed).

If
       $OfficeFanSpeed is 1

Then
       Set 'Office Fan-Fan' Low

Else
  - No Actions - (To add one, press 'Action')

 

Program 5 acts when the KPL is turned off and the fan speed is on high. It turns off the fan and resets the variable.

If
       Control 'Office Fan Light / Office - D - Fan' is switched Off
   And $OfficeFanSpeed is 3

Then
       $OfficeFanSpeed  = 0
       Set 'Office Fan-Fan' Off

Else
  - No Actions - (To add one, press 'Action')

 

Edit:

dzarn - We must have been posting at the same time! I like your idea on the fast off. I'm editing my program now to add that. Thanks guys you are awesome.

 

 

Thank you all for the programs. They will come in handy when I am ready to deploy all of the fans in my home later this summer. :mrgreen:

 

Teken . . .

Link to comment
The only thing I haven't got in place yet is a scene to control the keypad LEDs, as right now the LED can be off when the fan is on and vice versa.

 

I wonder if changing your KPL button mode to non-toggle ON would be one part of the solution. The second part would be to crate the mentioned keypad-controlling scene, then add a program step to the "fan off" and "hi-off" programs to turn the keypad scene off when the fan is off.

Link to comment

Hi,

 

I have tried both the examples above , but in both instances the result was the same the fan only makes it to medium speed and the next botton press results in returning to low speed. For some reason the medium to high speed action never takes place.

 

Any Ideas what I might be doing wrong?

Link to comment
Right click on the Program name in the left pane and select Copy to Clipboard. Then paste in the post. All the Programs will be needed.

 

Thanks here they are.

 

 

 

FIREPLACE FAN HIGH

 

If

Control 'Downstairs KPL / Downstairs KPL- D' is switched On

And Control 'Downstairs KPL / Downstairs KPL- D' is switched Off

And Status 'Fireplace-Fan' is Med

 

Then

Set 'Fireplace-Fan' High

 

Else

- No Actions - (To add one, press 'Action')

 

FIREPLACE FAN HIGH-OFF

 

If

Control 'Downstairs KPL / Downstairs KPL- D' is switched On

Or Control 'Downstairs KPL / Downstairs KPL- D' is switched Off

And Status 'Fireplace-Fan' is High

 

Then

Set 'Fireplace-Fan' Off

 

Else

- No Actions - (To add one, press 'Action')

 

FIREPLACE FAN LOW

 

If

Control 'Downstairs KPL / Downstairs KPL- D' is switched On

Or Control 'Downstairs KPL / Downstairs KPL- D' is switched Off

And Status 'Fireplace-Fan' is Off

 

Then

Set 'Fireplace-Fan' Low

 

Else

- No Actions - (To add one, press 'Action')

 

FIREPLACE FAN MED

 

If

Control 'Downstairs KPL / Downstairs KPL- D' is switched On

Or Control 'Downstairs KPL / Downstairs KPL- D' is switched Off

And Status 'Fireplace-Fan' is Low

 

Then

Set 'Fireplace-Fan' Med

 

Else

- No Actions - (To add one, press 'Action')

 

FIREPLACE FAN OFF

 

If

Control 'Downstairs KPL / Downstairs KPL- D' is switched Fast On

Or Control 'Downstairs KPL / Downstairs KPL- D' is switched Fast Off

 

Then

Set 'Fireplace-Fan' Off

 

Else

- No Actions - (To add one, press 'Action')

Link to comment

The two Control statements should be ORed together, not Anded. As in the other Programs.

 

If

Control 'Downstairs KPL / Downstairs KPL- D' is switched On

And Control 'Downstairs KPL / Downstairs KPL- D' is switched Off

And Status 'Fireplace-Fan' is Med

Link to comment
The two Control statements should be ORed together, not Anded. As in the other Programs.

 

If

Control 'Downstairs KPL / Downstairs KPL- D' is switched On

And Control 'Downstairs KPL / Downstairs KPL- D' is switched Off

And Status 'Fireplace-Fan' is Med

 

Sorry for my ignorance, could you explain a bit more.

 

Is what you posted an example of the control statments being or'ed?

Link to comment

Also I dont think I actually ever had the program with the variable working I have a feeling I was still using the first example program when I thought I was.

 

Maybe I am totally tring to do the varible version the wrong way, but I am not givin the chance to select what I am choosing to use for a variable, the dropdown box stays blank.

Link to comment

In the “FIREPLACE FAN LOW†Program the two If Control statements are ORed together. See the red Or below. This says if either an On command is received OR an Off command is received.

 

FIREPLACE FAN LOW

 

If

Control 'Downstairs KPL / Downstairs KPL- D' is switched On

Or Control 'Downstairs KPL / Downstairs KPL- D' is switched Off

And Status 'Fireplace-Fan' is Off

 

Then

Set 'Fireplace-Fan' Low

 

In the “FIREPLACE FAN HIGH†Program the two If Control statement are ANDed together. See the red And below. This says if an On command is received AND an Off command is received at the same time. It is IMPROSSIBLE to receive an On command AND an Off command at the same time. The And should be changed to an Or.

 

In addition to changing the And to an Or, parens need to be added as shown. This needs to be done in all the Programs. It has to do with the Order of Precedence which is described in detail in the UDI Wiki if you want to know why this is needed.

 

 

FIREPLACE FAN HIGH

 

If

(

Control 'Downstairs KPL / Downstairs KPL- D' is switched On

And Control 'Downstairs KPL / Downstairs KPL- D' is switched Off

)

And Status 'Fireplace-Fan' is Med

 

Then

Set 'Fireplace-Fan' High

Link to comment

Click on one of the If Control lines in the If section. The bottom of the pane that contains the Program detail will contain two buttons at the lower right side "Add And (..)" "Add Or (..)". Click the "Add Or (..) button. Two lines will be added to If Section. Use the Move Line Up button along the lower left section to move the parens to the desired location.

Link to comment
Click on one of the If Control lines in the If section. The bottom of the pane that contains the Program detail will contain two buttons at the lower right side "Add And (..)" "Add Or (..)". Click the "Add Or (..) button. Two lines will be added to If Section. Use the Move Line Up button along the lower left section to move the parens to the desired location.

 

Awesome that was it!

 

I was so close, I even once used the arrow up botton once, but I was not sure of what I was doing so I deleted it.

 

Thank you so much for all your help!

 

The only issue now is and I could live with it is the light on the keypad does not always reflect if the fan is on or off now.

Link to comment

Put the KeypadLinc button in non-toggle On mode. Each time the button is pressed the button LED will be On after two flashes indicating non toggle mode. Define an ISY Scene with the KeypadLinc button as a Responder. In any Program that turns the Fan Off, add a

 

Set Scene xxxxx Off

 

for the Scene with the KeypadLinc button as a Responder. The KeypadLinc button will be On anytime the Fan is running at any speed and Off when the Fan is Off.

Link to comment

Hi Lee

I tryed to use the fanlinc in a scene but it does not seem to want to work.I have four scenes,for example for low speed the controller button lets say Button "A" is set to 100% and the fanlinc speed is set to low. All others buttons are responders set to off.When I turn any button on KPD the button that is lit is the state of the fan.This worked when I programed the fanlinc manualy and the keypad through the ISY.Now that I update still have it working like that but it does not update the status on the console?? Will it only work by programs and not by a scene?

 

Thanks Tim

Link to comment

remedy1234

 

There are a number of things I'm not following. When the KeypadLinc button A name listed under the ISY Scene name is selected as the Controller of the Scene there is no Button A On Level slider setting as it is the Controller. There are no sliders for other Secondary buttons in the Scene as they cannot be turned Off with an On command. The very newest KPL v.40 firmware does have the ability to turn a Secondary button LED Off with an On command but the ISY has not picked up support for that yet.

 

What Status is not updated on the Admin Console?

Link to comment

Following is part of a set of 9 programs to handle cycling the fan speed. The

ELSE conditions are unused so removed for brevity

 

First set of programs controls the modifications to a state variable based on

user actions from 2 RemoteLincs and 1 keypad. Only one button is used on each.

State variable values are 0 to 3 representing the fan speeds off through high.

 

RemoteLinc Key operations are:

On - Turn on at last speed

Off / Fast off - Turn off

Fast On - Turn on at max speed

Fade up - Step speed up to max

Fade down - Step speed down to min

 

KeypadLinc operations are identical except that both FADE UP and FADE DOWN step

up the speed to max. This is because with KPL its difficult to know the fade direction

 

#Program: Fan increase speed
If
       (
            Control 'Bedroom 1 / Remote 1 / Be1, Rem1 - KeyE: Fan' is switched Fade Up
         Or Control 'Bedroom 1 / Remote 2 / Be1, Rem2 - KeyE: Fan' is switched Fade Up
         Or Control 'Bedroom 1 / Keypad / Be1 - KeyF: Fan' is switched Fade Up
         Or Control 'Bedroom 1 / Keypad / Be1 - KeyF: Fan' is switched Fade Down
       )
   And $sBed1FanState < 3
Then
       $sBed1FanState += 1

#Program: Fan-Decrease-Speed
If
       (
            Control 'Bedroom 1 / Remote 1 / Be1, Rem1 - KeyE: Fan' is switched Fade Down
         Or Control 'Bedroom 1 / Remote 2 / Be1, Rem2 - KeyE: Fan' is switched Fade Down
       )
   And $sBed1FanState > 1
Then
       $sBed1FanState -= 1


#Fan turn on at max speed
If
       Control 'Bedroom 1 / Remote 1 / Be1, Rem1 - KeyE: Fan' is switched Fast On
    Or Control 'Bedroom 1 / Remote 2 / Be1, Rem2 - KeyE: Fan' is switched Fast On
    Or Control 'Bedroom 1 / Keypad / Be1 - KeyF: Fan' is switched Fast On
Then
       $sBed1FanState  = 3

#Program: Fan turn on
If
       Control 'Bedroom 1 / Remote 1 / Be1, Rem1 - KeyE: Fan' is switched On
    Or Control 'Bedroom 1 / Remote 2 / Be1, Rem2 - KeyE: Fan' is switched On
    Or Control 'Bedroom 1 / Keypad / Be1 - KeyF: Fan' is switched On
Then
       $sBed1FanState  = $iBed1FanOnValue


#Program: Fan turn off
If
       Control 'Bedroom 1 / Remote 1 / Be1, Rem1 - KeyE: Fan' is switched Off
    Or Control 'Bedroom 1 / Remote 1 / Be1, Rem1 - KeyE: Fan' is switched Fast Off
    Or Control 'Bedroom 1 / Remote 2 / Be1, Rem2 - KeyE: Fan' is switched Off
    Or Control 'Bedroom 1 / Remote 2 / Be1, Rem2 - KeyE: Fan' is switched Fast Off
    Or Control 'Bedroom 1 / Keypad / Be1 - KeyF: Fan' is switched Off
    Or Control 'Bedroom 1 / Keypad / Be1 - KeyF: Fan' is switched Fast Off
Then
       $sBed1FanState  = 0

 

Second set of programs has one program per state variable value and sets the fan

speed appropriately. It also maintains the last ON state and any scenes to indicate

fan state. Only one representativie on state is show here - the others are

very similar.

 

#Program: Set High Speed
If
       $sBed1FanState is 3
Then
       Set 'Bedroom 1 / Be1 - Fan-Motor' High
       $iBed1FanOnValue  = 3
       Set Scene 'Bedroom 1 / Sc: Be1 Fan Status' On


#Program: Set Off
If
       $sBed1FanState is 0
Then
       Set 'Bedroom 1 / Be1 - Fan-Motor' Off
       Set Scene 'Bedroom 1 / Sc: Be1 Fan Status' Off

Link to comment

Archived

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


×
×
  • Create New...