cwalsh714 Posted April 13, 2012 Share Posted April 13, 2012 I recently installed Pentair Intellibrite pool lights in our backyard pool and spa, and these are both wired to a GFI circuit with an Insteon Icon switch that is then wired to a 12V Intermatic pool transformer. The transformer is used because the lights are run off 12V AC (I couldn't wait to get 120V AC wiring out of the pool niches.. dangerous!). In any event, I'd like to be able to control the programming of these lights. Currently, I can control the lights in terms of single colors or 7 different color changing "shows" by toggling the lights off and on a set number of times (e.g. 8 toggles to get a continuous white color, etc). A couple of questions: 1. Can I set up "virtual" buttons in the ISY? I say this because I mainly use MobiLinc Pro to control my Insteon stuff. I prefer to use my Android phone as a remote instead of KeypadLincs and RemoteLincs. Also, there are 14 different programs for these lights, so I would have to have 14 different buttons, and the most I think possible are 8 buttons on a KPL. 2. Can I use recursive loops (e.g. toggle the light off/on until count is 8 times), or would I have to hard-code this for each virtual button? This would be something of a do-while loop, if such a thing exists in the ISY control code. 14 separate programs seems excessive to me. Thanks! Craig Link to comment
Xathros Posted April 13, 2012 Share Posted April 13, 2012 I recently installed Pentair Intellibrite pool lights in our backyard pool and spa, and these are both wired to a GFI circuit with an Insteon Icon switch that is then wired to a 12V Intermatic pool transformer. The transformer is used because the lights are run off 12V AC (I couldn't wait to get 120V AC wiring out of the pool niches.. dangerous!). In any event, I'd like to be able to control the programming of these lights. Currently, I can control the lights in terms of single colors or 7 different color changing "shows" by toggling the lights off and on a set number of times (e.g. 8 toggles to get a continuous white color, etc). A couple of questions: 1. Can I set up "virtual" buttons in the ISY? I say this because I mainly use MobiLinc Pro to control my Insteon stuff. I prefer to use my Android phone as a remote instead of KeypadLincs and RemoteLincs. Also, there are 14 different programs for these lights, so I would have to have 14 different buttons, and the most I think possible are 8 buttons on a KPL. 2. Can I use recursive loops (e.g. toggle the light off/on until count is 8 times), or would I have to hard-code this for each virtual button? This would be something of a do-while loop, if such a thing exists in the ISY control code. 14 separate programs seems excessive to me. Thanks! Craig Craig- 1) Mobilinc allows access to programs I have a few on my favorites page so those could be your buttons. 2) For your 14 different styles, create 14 programs that each set a STATE variable to the appropriate number of on/off cycles (7 for white. 8-1 as you will see in the following program we need to leave them on after the 7th cycle). Then a 15th program to loop on the state var count as follows. -- Program1 -- Simply turns the lights on (1 cycle) -- if then set scene poolLighs On else -- Program 2 thru 14 -- To set the state var $lightCycle for cycle counts 2 - 14 -- 8 - white shown -- if then $lightCycle=7 else -- Program 15 -- To Process the cycle count and toggle on/off the light circuit-- if $lightcycle > 0 then set scene poolLighs On wait 1 set scene poolLights Off wait 1 $lightcycle =- 1 else set scene poolLights On I am assuming that decrementing the cyclecounter will re-trigger prog 15 when the value changes. If this does not work like that, you can move the then portion of 15 into prog 16's then and simply call 16 then from the 15 then - hope that makes sense. Pretty sure this will do what you want and you could put "if Control KPL-X is switched on" conditions in some of the number set progs to tie them to keypad buttons as well if you wanted. Hope this helps and if im too far off base - I'm sure someone with more knowledge will post a better way. -Xathros Link to comment
cwalsh714 Posted April 14, 2012 Author Share Posted April 14, 2012 Okay, I've programmed all of this in using 15 different programs under one called Pool Lights. The only issue is how do I run the different programs? If I access via MobiLinc, if I click on the Pool Lights folder, it does show the 15 different folders (14 for different modes, 15 for off). But, if I click on one of the buttons for the 15 programs, it shows the "Run If", "Run Else", etc. How do I set it so that if the button is clicked, the program automatically executes? Thanks for all of your help! Craig Link to comment
Xathros Posted April 16, 2012 Share Posted April 16, 2012 Okay, I've programmed all of this in using 15 different programs under one called Pool Lights. The only issue is how do I run the different programs? If I access via MobiLinc, if I click on the Pool Lights folder, it does show the 15 different folders (14 for different modes, 15 for off). But, if I click on one of the buttons for the 15 programs, it shows the "Run If", "Run Else", etc. How do I set it so that if the button is clicked, the program automatically executes? Thanks for all of your help! Craig You would use the "Run Then" option for each program in Mobilinc. if you want to simplify the display, you can go into the advanced settings for each program in Mobilinc and remove the text from the name of each of the un-needed options leaving only the Run Then - Customized if you like. That way when you select the program from your Mobilinc favorites, you don't have to scroll thru the unnecessary stuff. -X Link to comment
cwalsh714 Posted April 16, 2012 Author Share Posted April 16, 2012 Xanthos: Cool. I didn't know I could do that. Okay, the program doesn't seem to work, and this is definitely due to my naivety. I have 15 programs installed in one folder called Pool Lights. Each program is named for the different function, e.g. 00- off , 01-SAm, 02-Party, 03-Royal, etc., to match the programs on the lights. When I click on the Programs on MobiLinc, I see the Pool Lights folder, and I see the individual programs. But, if I click on any, I don't get a response. So, a couple of questions. 1. What do I need to do to let the programs in the Pool Lights folder know that they should run when I click on Run Then? I think the folder has an If Then statement, and I believe that the Folder status is by default false. How do I program the folder to make its status True when it is opened? I think this is preventing the programs from running. 2. In each individual program (except 1-SAm and 0-Off), each program is supposed to call the PoolLightToggle program recursively until LightCycle is 0. Am I supposed to call the PoolLightToggle program from within each of the set programs (which set the LightCycle variable), or does the PoolLightToggle program activate automatically if LightCycle is > 0? Thanks so much for your help. I'm a total newby to more complex programming with variables, etc. Link to comment
Xathros Posted April 16, 2012 Share Posted April 16, 2012 Xanthos: Cool. I didn't know I could do that. Okay, the program doesn't seem to work, and this is definitely due to my naivety. I have 15 programs installed in one folder called Pool Lights. Each program is named for the different function, e.g. 00- off , 01-SAm, 02-Party, 03-Royal, etc., to match the programs on the lights. When I click on the Programs on MobiLinc, I see the Pool Lights folder, and I see the individual programs. But, if I click on any, I don't get a response. So, a couple of questions. 1. What do I need to do to let the programs in the Pool Lights folder know that they should run when I click on Run Then? I think the folder has an If Then statement, and I believe that the Folder status is by default false. How do I program the folder to make its status True when it is opened? I think this is preventing the programs from running. 2. In each individual program (except 1-SAm and 0-Off), each program is supposed to call the PoolLightToggle program recursively until LightCycle is 0. Am I supposed to call the PoolLightToggle program from within each of the set programs (which set the LightCycle variable), or does the PoolLightToggle program activate automatically if LightCycle is > 0? Thanks so much for your help. I'm a total newby to more complex programming with variables, etc. No problem, I'm happy to help. First, in Mobilinc, when you touch a program, it opens up a sheet with several sections: Prog Ststus, Prog Commands and Porg Options. The Commands section is where the "Run Then" or your customized equivalent will be. So if you select your "All white" program, scroll down to the commands section and touch "Run Then" that should set the $lightCycle to 7 and start the toggle routine in motion. 1)The folder needs no conditions unles you want to enable/disable the whole batch of programs manually or by a condition. Just leave the folder if/then/else all blank for now. 2) Make sure $lightCycle is a STATE variable (Defined on the "State" tab rather than the "Integer" tab). It still functions as an integer variable but if its defined as a state variable it can trigger events in other programs. The majority of the programs have nothing in the IF caluse and in the THEN clause say " Set lightcycle to " where is a number greater than 0. When one of these is "Run Then", the value of $lightCycle changes from 0 to the programmed value and at that point the toggle program is triggered because the value of the state variable changed. If you didn't define $lightCycle as a state variable then the toggle program would never trigger. EDIT: You can watch the state variable tab in the admin console when you select the Run Then on any the the "Show Select" programs and see the value get set then count down if things are working correctly. -Xathros Link to comment
cwalsh714 Posted April 18, 2012 Author Share Posted April 18, 2012 Ah, the key was to remove the Toggle program out of the Folder with the other programs. Now, clicking on one of the various color or show programs causes this thing to actually work. A little more tweaking and this thing will replace the functionality of the $250 box Pentair sells to control these things...but you can do this remotely from anywhere in the world using the ISY and MobiLinc or Orchestrator. Very cool! I'll upload my code later to show how it's done. Link to comment
cwalsh714 Posted April 18, 2012 Author Share Posted April 18, 2012 Now, on the HTML/Browser page of the ISY, it lists the status of each of the programs (true, false) next to each of the programs. Is there a way for this to signal which program has run, e.g. which mode is active? I guess the Off and Toggle programs would have to turn the status off on all other programs, except the off program (or the program that was most recently activated for the toggle program). This would be handy so that you would know which program had been activated. Very nice. Thanks again! Craig Link to comment
Xathros Posted April 18, 2012 Share Posted April 18, 2012 Now, on the HTML/Browser page of the ISY, it lists the status of each of the programs (true, false) next to each of the programs. Is there a way for this to signal which program has run, e.g. which mode is active? I guess the Off and Toggle programs would have to turn the status off on all other programs, except the off program (or the program that was most recently activated for the toggle program). This would be handy so that you would know which program had been activated. Very nice. Thanks again! Craig Craig- Glad to hear you got it working! As for the current state, I think I would define another variable - this time a normal integer variable - and add a line to each of the mode set programs to set the mode value in this variable. Have your "Off" program set ithis back to 0. Then at least you only have one variable to look at to tell what the current mode value is. Then, if you wanted, you could have 2 more programs and/or keypad buttons to do next mode / previous mode based on this variable. -Xathros Link to comment
Recommended Posts