chrishick Posted September 17, 2015 Posted September 17, 2015 I bought some fanlincs for the patio with a KPL for control. I thought there was a way to control fan speed using one button to toggle through the speeds but I can't seem to find any info on how to do this. Is this possible?
larryllix Posted September 17, 2015 Posted September 17, 2015 (edited) I bought some fanlincs for the patio with a KPL for control. I thought there was a way to control fan speed using one button to toggle through the speeds but I can't seem to find any info on how to do this. Is this possible? I haven't done this yet as I have no fanlink and thinking about one doing the same with a simple SwitchLinc running the light and Fan. Define a state variable called something like $sFanSpeed Create a 4 programs. One for each fan speed with a condition like this. Don't forget to write one for Off=0 If $sFanSpeed is 1 <--- this changes for each speed 0,1,2,3 Then Set fanlinc to low speed <-----I don't know how the syntax for how this looks. Now set up a master control program that increments the variable $FanSpeed with a safety to reset it back to Off=0 If Control KPL is switched on AND $sFanSpeed <= 3 <-----top speed Then $sFanSpeed +=1 <---- go faster $sFanLinc init to $sFanSpeed Else $sFanSpeed = 0 <----turn Off $sFanLinc init to $sFanSpeed Hope this helps some. Let us know how this works out for you! Edited September 17, 2015 by larryllix
chrishick Posted September 17, 2015 Author Posted September 17, 2015 Thanks Larry I think I can make that work. I just had in the back of my head that it was possible with a scene but now that I think about it I guess not. Thanks again.
larryllix Posted September 18, 2015 Posted September 18, 2015 (edited) Thanks Larry I think I can make that work. I just had in the back of my head that it was possible with a scene but now that I think about it I guess not. Thanks again. You're welcome. Scenes can work also, but only with one component device in each so there is no point. Edited September 18, 2015 by larryllix
chrishick Posted September 18, 2015 Author Posted September 18, 2015 Thinking this through. If I control one of the fans through iRule then the Fanlinc will be out of sync with the state variable and the next button press won't produce the expected results. So my thought is to make 4 programs to monitor fan status and change variable to correct value upon status change. Does that sound right? Sent from my iPad using Tapatalk
Xathros Posted September 18, 2015 Posted September 18, 2015 (edited) Hi Guys- Here is my solution using a single KPL button in 'Non-toggle Off' mode. LR-FanCycleA - [ID 0068][Parent 0066] If ( Control (Old) 'Living Room / KPLD8 / LR-KPL8-B.dev' is switched Off ) And $i.toggle.LR_Fan_Lvl < 3 Then $i.toggle.LR_Fan_Lvl += 1 Run Program 'LR-FanCycleB' (If) Else $i.toggle.LR_Fan_Lvl = 0 Set 'Living Room / LivingRm Fan.dev' Off Set Scene 'Living Room / LR_KPL8-B(Fan).scn' Off LR-FanCycleB - [ID 0069][Parent 0066] If $i.toggle.LR_Fan_Lvl is 1 Then Set 'Living Room / LivingRm Fan.dev' Low Set Scene 'Living Room / LR_KPL8-B(Fan).scn' 100% Else Run Program 'LR-FanCycleC' (If) LR-FanCycleC - [ID 006A][Parent 0066] If $i.toggle.LR_Fan_Lvl is 2 Then Set 'Living Room / LivingRm Fan.dev' Med Set Scene 'Living Room / LR_KPL8-B(Fan).scn' 100% Else Run Program 'LR-FanCycleD' (If) LR-FanCycleD - [ID 006B][Parent 0066] If $i.toggle.LR_Fan_Lvl is 3 Then Set 'Living Room / LivingRm Fan.dev' High Set Scene 'Living Room / LR_KPL8-B(Fan).scn' 100% Else - No Actions - (To add one, press 'Action') LR-FanCycleE - [ID 006C][Parent 0066] If Control (Old) 'Living Room / KPLD8 / LR-KPL8-B.dev' is switched Fast Off Then $i.toggle.LR_Fan_Lvl = 0 Set 'Living Room / LivingRm Fan.dev' Off Set Scene 'Living Room / LR_KPL8-B(Fan).scn' Off Else - No Actions - (To add one, press 'Action') I don't remember why I went with the integer var/program cascade method rather than using a state variable but I'm sure there was a reason at the time. -Xathros Edited September 18, 2015 by Xathros
larryllix Posted September 18, 2015 Posted September 18, 2015 Hi Guys- Here is my solution using a single KPL button in 'Non-toggle Off' mode. .... I don't remember why I went with the integer var/program cascade method rather than using a state variable but I'm sure there was a reason at the time. -Xathros I was using cascading programs for everything but now I find the state variable triggering works very well. It's a little cryptic with unrelated programs running but that is classic for event based programming. The nice part is viewing the program tree in Admin Console shows the currently selected program automatically as green/true and the rest as red/false in a self managed case style switching arrangement. Now we need to add control from iRule (assuming some apple sauce here) to synchronise the variable from the other influence..
larryllix Posted September 18, 2015 Posted September 18, 2015 (edited) Thinking this through. If I control one of the fans through iRule then the Fanlinc will be out of sync with the state variable and the next button press won't produce the expected results. So my thought is to make 4 programs to monitor fan status and change variable to correct value upon status change. Does that sound right? Sent from my iPad using Tapatalk I am not familiar with iRule. Can the programs not just control the variable? That way all the trigger and supervising programs work based on the variable value. That is the beauty of the event based ISY engine. Multiple programs can just stuff a value into the variable and the fan just shifts gears, seemingly by itself. Perhaps just duplicate the master control program with the iRule as a trigger? If iRule sets a variable then set it back to 0 after the $sFanspeed variable is changed. This could also be incorporated into the existing master control program with an "OR" condition. If ( Control KPL is switched on OR $s.iRule.variable > 0 ) AND $sFanSpeed <= 3 Then $sFanSpeed +=1 $sFanLinc init to $sFanSpeed $s.iRule.variable = 0 Else $sFanSpeed = 0 $sFanLinc init to $sFanSpeed $iRule.variable = 0 EDIT: Added s prefixes for state variable designation. Edited September 19, 2015 by larryllix
chrishick Posted September 18, 2015 Author Posted September 18, 2015 I am not familiar with iRule. Can the programs not just control the variable? iRule can set variables, but I was just using that as an example for outside control. Could be MobiLinc, eKeypad, etc........ It would be better to detect the change within the ISY and set the variable accordingly.
larryllix Posted September 19, 2015 Posted September 19, 2015 iRule can set variables, but I was just using that as an example for outside control. Could be MobiLinc, eKeypad, etc........ It would be better to detect the change within the ISY and set the variable accordingly. That is exactly what my last program example does. IRule sets a variable, ISY uses it and sets it back to 0 after changing the fan speed.
Recommended Posts