Lighting System

mkleynhansmkleynhans Junior MemberPosts: 76
Hi guys,
I have written some pretty basic code to control an iLight lighting system and am worried about the feedback for the lighting buttons. Its all running in mainline and have around 12 panels (9x MSD1001i's and 3 iPad Minis) on the system. I happened to be watching as one of the iPads came online and the button updates seemed to take a long time in the events and diagnostics...

Anyway, mainline code below, do you think this is too much for within Define_Program? ... would a wait 5 { ....enclose the current code.... } help??
DEFINE_PROGRAM

//Master Bedroom
[dvTPiLight,10] = (iLight_A001 == 0 )    //LIGHTS OFF
[dvTPiLight,11] = (iLight_A001 == 1 )    //LIGHTS SC1
[dvTPiLight,12] = (iLight_A001 == 2 )    //LIGHTS SC2
[dvTPiLight,13] = (iLight_A001 == 3 )    //LIGHTS SC3
[dvTPiLight,14] = (iLight_A001 == 4 )    //LIGHTS SC4
[dvTPiLight,19] = !(iLight_A001 == 0 )    //LIGHTS OFF
//Master Ensuite Shower
[dvTPiLight,20] = (iLight_A002 == 0 )    //LIGHTS OFF
[dvTPiLight,21] = (iLight_A002 == 1 )    //LIGHTS SC1
[dvTPiLight,22] = (iLight_A002 == 2 )    //LIGHTS SC2
[dvTPiLight,23] = (iLight_A002 == 3 )    //LIGHTS SC3
[dvTPiLight,24] = (iLight_A002 == 4 )    //LIGHTS SC4
[dvTPiLight,29] = !(iLight_A002 == 0 )    //LIGHTS OFF
//Master Morning Room
[dvTPiLight,30] = (iLight_A003 == 0 )    //LIGHTS OFF
[dvTPiLight,31] = (iLight_A003 == 1 )    //LIGHTS SC1
[dvTPiLight,32] = (iLight_A003 == 2 )    //LIGHTS SC2
[dvTPiLight,33] = (iLight_A003 == 3 )    //LIGHTS SC3
[dvTPiLight,34] = (iLight_A003 == 4 )    //LIGHTS SC4
[dvTPiLight,39] = !(iLight_A003 == 0 )    //LIGHTS OFF
//Master Ensuite Bathroom
[dvTPiLight,40] = (iLight_A004 == 0 )    //LIGHTS OFF
[dvTPiLight,41] = (iLight_A004 == 1 )    //LIGHTS SC1
[dvTPiLight,42] = (iLight_A004 == 2 )    //LIGHTS SC2
[dvTPiLight,43] = (iLight_A004 == 3 )    //LIGHTS SC3
[dvTPiLight,44] = (iLight_A004 == 4 )    //LIGHTS SC4
[dvTPiLight,49] = !(iLight_A004 == 0 )    //LIGHTS OFF
//Dressing Room
[dvTPiLight,50] = (iLight_A005 == 0 )    //LIGHTS OFF
[dvTPiLight,51] = (iLight_A005 == 1 )    //LIGHTS SC1
[dvTPiLight,52] = (iLight_A005 == 2 )    //LIGHTS SC2
[dvTPiLight,53] = (iLight_A005 == 3 )    //LIGHTS SC3
[dvTPiLight,54] = (iLight_A005 == 4 )    //LIGHTS SC4
[dvTPiLight,59] = !(iLight_A005 == 0 )    //LIGHTS OFF
//1st Floor Landing
[dvTPiLight,60] = (iLight_A006 == 0 )    //LIGHTS OFF
[dvTPiLight,61] = (iLight_A006 == 1 )    //LIGHTS SC1
[dvTPiLight,62] = (iLight_A006 == 2 )    //LIGHTS SC2
[dvTPiLight,63] = (iLight_A006 == 3 )    //LIGHTS SC3
[dvTPiLight,64] = (iLight_A006 == 4 )    //LIGHTS SC4
[dvTPiLight,69] = !(iLight_A006 == 0 )    //LIGHTS OFF
//Brians Room
[dvTPiLight,70] = (iLight_A007 == 0 )    //LIGHTS OFF
[dvTPiLight,71] = (iLight_A007 == 1 )    //LIGHTS SC1
[dvTPiLight,72] = (iLight_A007 == 2 )    //LIGHTS SC2
[dvTPiLight,73] = (iLight_A007 == 3 )    //LIGHTS SC3
[dvTPiLight,74] = (iLight_A007 == 4 )    //LIGHTS SC4
[dvTPiLight,79] = !(iLight_A007 == 0 )    //LIGHTS OFF
//Brians Ensuite
[dvTPiLight,80] = (iLight_A008 == 0 )    //LIGHTS OFF
[dvTPiLight,81] = (iLight_A008 == 1 )    //LIGHTS SC1
[dvTPiLight,82] = (iLight_A008 == 2 )    //LIGHTS SC2
[dvTPiLight,83] = (iLight_A008 == 3 )    //LIGHTS SC3
[dvTPiLight,84] = (iLight_A008 == 4 )    //LIGHTS SC4
[dvTPiLight,89] = !(iLight_A008 == 0 )    //LIGHTS OFF
//Guest Room
[dvTPiLight,90] = (iLight_A009 == 0 )    //LIGHTS OFF
[dvTPiLight,91] = (iLight_A009 == 1 )    //LIGHTS SC1
[dvTPiLight,92] = (iLight_A009 == 2 )    //LIGHTS SC2
[dvTPiLight,93] = (iLight_A009 == 3 )    //LIGHTS SC3
[dvTPiLight,94] = (iLight_A009 == 4 )    //LIGHTS SC4
[dvTPiLight,99] = !(iLight_A009 == 0 )    //LIGHTS OFF
//Leo's Ensuite
[dvTPiLight,100] = (iLight_A010 == 0 )    //LIGHTS OFF
[dvTPiLight,101] = (iLight_A010 == 1 )    //LIGHTS SC1
[dvTPiLight,102] = (iLight_A010 == 2 )    //LIGHTS SC2
[dvTPiLight,103] = (iLight_A010 == 3 )    //LIGHTS SC3
[dvTPiLight,104] = (iLight_A010 == 4 )    //LIGHTS SC4
[dvTPiLight,109] = !(iLight_A010 == 0 )    //LIGHTS OFF
//Leo's Room
[dvTPiLight,110] = (iLight_A011 == 0 )    //LIGHTS OFF
[dvTPiLight,111] = (iLight_A011 == 1 )    //LIGHTS SC1
[dvTPiLight,112] = (iLight_A011 == 2 )    //LIGHTS SC2
[dvTPiLight,113] = (iLight_A011 == 3 )    //LIGHTS SC3
[dvTPiLight,114] = (iLight_A011 == 4 )    //LIGHTS SC4
[dvTPiLight,119] = !(iLight_A011 == 0 )    //LIGHTS OFF
//Sam & Ed's Room
[dvTPiLight,120] = (iLight_A012 == 0 )    //LIGHTS OFF
[dvTPiLight,121] = (iLight_A012 == 1 )    //LIGHTS SC1
[dvTPiLight,122] = (iLight_A012 == 2 )    //LIGHTS SC2
[dvTPiLight,123] = (iLight_A012 == 3 )    //LIGHTS SC3
[dvTPiLight,124] = (iLight_A012 == 4 )    //LIGHTS SC4
[dvTPiLight,129] = !(iLight_A012 == 0 )    //LIGHTS OFF
//Sam & Ed's Ensuite
[dvTPiLight,130] = (iLight_A013 == 0 )    //LIGHTS OFF
[dvTPiLight,131] = (iLight_A013 == 1 )    //LIGHTS SC1
[dvTPiLight,132] = (iLight_A013 == 2 )    //LIGHTS SC2
[dvTPiLight,133] = (iLight_A013 == 3 )    //LIGHTS SC3
[dvTPiLight,134] = (iLight_A013 == 4 )    //LIGHTS SC4
[dvTPiLight,139] = !(iLight_A013 == 0 )    //LIGHTS OFF
//Poppys Room
[dvTPiLight,140] = (iLight_A014 == 0 )    //LIGHTS OFF
[dvTPiLight,141] = (iLight_A014 == 1 )    //LIGHTS SC1
[dvTPiLight,142] = (iLight_A014 == 2 )    //LIGHTS SC2
[dvTPiLight,143] = (iLight_A014 == 3 )    //LIGHTS SC3
[dvTPiLight,144] = (iLight_A014 == 4 )    //LIGHTS SC4
[dvTPiLight,149] = !(iLight_A014 == 0 )    //LIGHTS OFF
//Poppys Ensuite
[dvTPiLight,150] = (iLight_A015 == 0 )    //LIGHTS OFF
[dvTPiLight,151] = (iLight_A015 == 1 )    //LIGHTS SC1
[dvTPiLight,152] = (iLight_A015 == 2 )    //LIGHTS SC2
[dvTPiLight,153] = (iLight_A015 == 3 )    //LIGHTS SC3
[dvTPiLight,154] = (iLight_A015 == 4 )    //LIGHTS SC4
[dvTPiLight,159] = !(iLight_A015 == 0 )    //LIGHTS OFF
//Laundry Room
[dvTPiLight,160] = (iLight_A016 == 0 )    //LIGHTS OFF
[dvTPiLight,161] = (iLight_A016 == 1 )    //LIGHTS SC1
[dvTPiLight,162] = (iLight_A016 == 2 )    //LIGHTS SC2
[dvTPiLight,163] = (iLight_A016 == 3 )    //LIGHTS SC3
[dvTPiLight,164] = (iLight_A016 == 4 )    //LIGHTS SC4
[dvTPiLight,169] = !(iLight_A016 == 0 )    //LIGHTS OFF
//Above Bootroom
[dvTPiLight,170] = (iLight_A017 == 0 )    //LIGHTS OFF
[dvTPiLight,171] = (iLight_A017 == 1 )    //LIGHTS SC1
[dvTPiLight,172] = (iLight_A017 == 2 )    //LIGHTS SC2
[dvTPiLight,173] = (iLight_A017 == 3 )    //LIGHTS SC3
[dvTPiLight,174] = (iLight_A017 == 4 )    //LIGHTS SC4
[dvTPiLight,179] = !(iLight_A017 == 0 )    //LIGHTS OFF
//Above Garage Lobby
[dvTPiLight,180] = (iLight_A018 == 0 )    //LIGHTS OFF
[dvTPiLight,181] = (iLight_A018 == 1 )    //LIGHTS SC1
[dvTPiLight,182] = (iLight_A018 == 2 )    //LIGHTS SC2
[dvTPiLight,183] = (iLight_A018 == 3 )    //LIGHTS SC3
[dvTPiLight,184] = (iLight_A018 == 4 )    //LIGHTS SC4
[dvTPiLight,189] = !(iLight_A018 == 0 )    //LIGHTS OFF
//Annexe Kitchen
[dvTPiLight,190] = (iLight_A019 == 0 )    //LIGHTS OFF
[dvTPiLight,191] = (iLight_A019 == 1 )    //LIGHTS SC1
[dvTPiLight,192] = (iLight_A019 == 2 )    //LIGHTS SC2
[dvTPiLight,193] = (iLight_A019 == 3 )    //LIGHTS SC3
[dvTPiLight,194] = (iLight_A019 == 4 )    //LIGHTS SC4
[dvTPiLight,199] = !(iLight_A019 == 0 )    //LIGHTS OFF
//Annexe Walkway Right
[dvTPiLight,200] = (iLight_A020 == 0 )    //LIGHTS OFF
[dvTPiLight,201] = (iLight_A020 == 1 )    //LIGHTS SC1
[dvTPiLight,202] = (iLight_A020 == 2 )    //LIGHTS SC2
[dvTPiLight,203] = (iLight_A020 == 3 )    //LIGHTS SC3
[dvTPiLight,204] = (iLight_A020 == 4 )    //LIGHTS SC4
[dvTPiLight,209] = !(iLight_A020 == 0 )    //LIGHTS OFF
//Annexe Walkway Left
[dvTPiLight,210] = (iLight_A021 == 0 )    //LIGHTS OFF
[dvTPiLight,211] = (iLight_A021 == 1 )    //LIGHTS SC1
[dvTPiLight,212] = (iLight_A021 == 2 )    //LIGHTS SC2
[dvTPiLight,213] = (iLight_A021 == 3 )    //LIGHTS SC3
[dvTPiLight,214] = (iLight_A021 == 4 )    //LIGHTS SC4
[dvTPiLight,219] = !(iLight_A021 == 0 )    //LIGHTS OFF
//Annexe Ensuite
[dvTPiLight,220] = (iLight_A022 == 0 )    //LIGHTS OFF
[dvTPiLight,221] = (iLight_A022 == 1 )    //LIGHTS SC1
[dvTPiLight,222] = (iLight_A022 == 2 )    //LIGHTS SC2
[dvTPiLight,223] = (iLight_A022 == 3 )    //LIGHTS SC3
[dvTPiLight,224] = (iLight_A022 == 4 )    //LIGHTS SC4
[dvTPiLight,229] = !(iLight_A022 == 0 )    //LIGHTS OFF
//Gallery
[dvTPiLight,230] = (iLight_A023 == 0 )    //LIGHTS OFF
[dvTPiLight,231] = (iLight_A023 == 1 )    //LIGHTS SC1
[dvTPiLight,232] = (iLight_A023 == 2 )    //LIGHTS SC2
[dvTPiLight,233] = (iLight_A023 == 3 )    //LIGHTS SC3
[dvTPiLight,234] = (iLight_A023 == 4 )    //LIGHTS SC4
[dvTPiLight,239] = !(iLight_A023 == 0 )    //LIGHTS OFF
//Poolside Floods (Outdoor)
[dvTPiLight,240] = (iLight_A024 == 0 )    //LIGHTS OFF
[dvTPiLight,241] = (iLight_A024 == 1 )    //LIGHTS SC1
[dvTPiLight,242] = (iLight_A024 == 2 )    //LIGHTS SC2
[dvTPiLight,243] = (iLight_A024 == 3 )    //LIGHTS SC3
[dvTPiLight,244] = (iLight_A024 == 4 )    //LIGHTS SC4
[dvTPiLight,249] = !(iLight_A024 == 0 )    //LIGHTS OFF
//Entertainment Room
[dvTPiLight,250] = (iLight_A025 == 0 )    //LIGHTS OFF
[dvTPiLight,251] = (iLight_A025 == 1 )    //LIGHTS SC1
[dvTPiLight,252] = (iLight_A025 == 2 )    //LIGHTS SC2
[dvTPiLight,253] = (iLight_A025 == 3 )    //LIGHTS SC3
[dvTPiLight,254] = (iLight_A025 == 4 )    //LIGHTS SC4
[dvTPiLight,259] = !(iLight_A025 == 0 )    //LIGHTS OFF
//Basement Lobby (Outside Cinema)
[dvTPiLight,260] = (iLight_A026 == 0 )    //LIGHTS OFF
[dvTPiLight,261] = (iLight_A026 == 1 )    //LIGHTS SC1
[dvTPiLight,262] = (iLight_A026 == 2 )    //LIGHTS SC2
[dvTPiLight,263] = (iLight_A026 == 3 )    //LIGHTS SC3
[dvTPiLight,264] = (iLight_A026 == 4 )    //LIGHTS SC4
[dvTPiLight,269] = !(iLight_A026 == 0 )    //LIGHTS OFF
//Basement Changing Room
[dvTPiLight,270] = (iLight_A027 == 0 )    //LIGHTS OFF
[dvTPiLight,271] = (iLight_A027 == 1 )    //LIGHTS SC1
[dvTPiLight,272] = (iLight_A027 == 2 )    //LIGHTS SC2
[dvTPiLight,273] = (iLight_A027 == 3 )    //LIGHTS SC3
[dvTPiLight,274] = (iLight_A027 == 4 )    //LIGHTS SC4
[dvTPiLight,279] = !(iLight_A027 == 0 )    //LIGHTS OFF
//Pool
[dvTPiLight,280] = (iLight_A028 == 0 )    //LIGHTS OFF
[dvTPiLight,281] = (iLight_A028 == 1 )    //LIGHTS SC1
[dvTPiLight,282] = (iLight_A028 == 2 )    //LIGHTS SC2
[dvTPiLight,283] = (iLight_A028 == 3 )    //LIGHTS SC3
[dvTPiLight,284] = (iLight_A028 == 4 )    //LIGHTS SC4
[dvTPiLight,289] = !(iLight_A028 == 0 )    //LIGHTS OFF
//NO RECORDED AREA FOR A029
[dvTPiLight,290] = (iLight_A029 == 0 )    //LIGHTS OFF
[dvTPiLight,291] = (iLight_A029 == 1 )    //LIGHTS SC1
[dvTPiLight,292] = (iLight_A029 == 2 )    //LIGHTS SC2
[dvTPiLight,293] = (iLight_A029 == 3 )    //LIGHTS SC3
[dvTPiLight,294] = (iLight_A029 == 4 )    //LIGHTS SC4
[dvTPiLight,299] = !(iLight_A029 == 0 )    //LIGHTS OFF
//Gnd Flr Hallway
[dvTPiLight,300] = (iLight_A030 == 0 )    //LIGHTS OFF
[dvTPiLight,301] = (iLight_A030 == 1 )    //LIGHTS SC1
[dvTPiLight,302] = (iLight_A030 == 2 )    //LIGHTS SC2
[dvTPiLight,303] = (iLight_A030 == 3 )    //LIGHTS SC3
[dvTPiLight,304] = (iLight_A030 == 4 )    //LIGHTS SC4
[dvTPiLight,309] = !(iLight_A030 == 0 )    //LIGHTS OFF
//Pool DMX
[dvTPiLight,310] = (iLight_A031 == 0 )    //LIGHTS OFF
[dvTPiLight,311] = (iLight_A031 == 1 )    //LIGHTS SC1
[dvTPiLight,312] = (iLight_A031 == 2 )    //LIGHTS SC2
[dvTPiLight,313] = (iLight_A031 == 3 )    //LIGHTS SC3
[dvTPiLight,314] = (iLight_A031 == 4 )    //LIGHTS SC4
[dvTPiLight,319] = !(iLight_A031 == 0 )    //LIGHTS OFF
//Gnd Flr Hallway Toilet
[dvTPiLight,320] = (iLight_A032 == 0 )    //LIGHTS OFF
[dvTPiLight,321] = (iLight_A032 == 1 )    //LIGHTS SC1
[dvTPiLight,322] = (iLight_A032 == 2 )    //LIGHTS SC2
[dvTPiLight,323] = (iLight_A032 == 3 )    //LIGHTS SC3
[dvTPiLight,324] = (iLight_A032 == 4 )    //LIGHTS SC4
[dvTPiLight,329] = !(iLight_A032 == 0 )    //LIGHTS OFF
//Living Room
[dvTPiLight,330] = (iLight_A033 == 0 )    //LIGHTS OFF
[dvTPiLight,331] = (iLight_A033 == 1 )    //LIGHTS SC1
[dvTPiLight,332] = (iLight_A033 == 2 )    //LIGHTS SC2
[dvTPiLight,333] = (iLight_A033 == 3 )    //LIGHTS SC3
[dvTPiLight,334] = (iLight_A033 == 4 )    //LIGHTS SC4
[dvTPiLight,339] = !(iLight_A033 == 0 )    //LIGHTS OFF
//Kitchen Dining Area
[dvTPiLight,340] = (iLight_A034 == 0 )    //LIGHTS OFF
[dvTPiLight,341] = (iLight_A034 == 1 )    //LIGHTS SC1
[dvTPiLight,342] = (iLight_A034 == 2 )    //LIGHTS SC2
[dvTPiLight,343] = (iLight_A034 == 3 )    //LIGHTS SC3
[dvTPiLight,344] = (iLight_A034 == 4 )    //LIGHTS SC4
[dvTPiLight,349] = !(iLight_A034 == 0 )    //LIGHTS OFF
//Walk In Fridge
[dvTPiLight,350] = (iLight_A035 == 0 )    //LIGHTS OFF
[dvTPiLight,351] = (iLight_A035 == 1 )    //LIGHTS SC1
[dvTPiLight,352] = (iLight_A035 == 2 )    //LIGHTS SC2
[dvTPiLight,353] = (iLight_A035 == 3 )    //LIGHTS SC3
[dvTPiLight,354] = (iLight_A035 == 4 )    //LIGHTS SC4
[dvTPiLight,359] = !(iLight_A035 == 0 )    //LIGHTS OFF
//Kitchen Over Island
[dvTPiLight,360] = (iLight_A036 == 0 )    //LIGHTS OFF
[dvTPiLight,361] = (iLight_A036 == 1 )    //LIGHTS SC1
[dvTPiLight,362] = (iLight_A036 == 2 )    //LIGHTS SC2
[dvTPiLight,363] = (iLight_A036 == 3 )    //LIGHTS SC3
[dvTPiLight,364] = (iLight_A036 == 4 )    //LIGHTS SC4
[dvTPiLight,369] = !(iLight_A036 == 0 )    //LIGHTS OFF
//Kitchen Seating Area
[dvTPiLight,370] = (iLight_A037 == 0 )    //LIGHTS OFF
[dvTPiLight,371] = (iLight_A037 == 1 )    //LIGHTS SC1
[dvTPiLight,372] = (iLight_A037 == 2 )    //LIGHTS SC2
[dvTPiLight,373] = (iLight_A037 == 3 )    //LIGHTS SC3
[dvTPiLight,374] = (iLight_A037 == 4 )    //LIGHTS SC4
[dvTPiLight,379] = !(iLight_A037 == 0 )    //LIGHTS OFF
//Kitchen Glass Room
[dvTPiLight,380] = (iLight_A038 == 0 )    //LIGHTS OFF
[dvTPiLight,381] = (iLight_A038 == 1 )    //LIGHTS SC1
[dvTPiLight,382] = (iLight_A038 == 2 )    //LIGHTS SC2
[dvTPiLight,383] = (iLight_A038 == 3 )    //LIGHTS SC3
[dvTPiLight,384] = (iLight_A038 == 4 )    //LIGHTS SC4
[dvTPiLight,389] = !(iLight_A038 == 0 )    //LIGHTS OFF
//Office
[dvTPiLight,390] = (iLight_A039 == 0 )    //LIGHTS OFF
[dvTPiLight,391] = (iLight_A039 == 1 )    //LIGHTS SC1
[dvTPiLight,392] = (iLight_A039 == 2 )    //LIGHTS SC2
[dvTPiLight,393] = (iLight_A039 == 3 )    //LIGHTS SC3
[dvTPiLight,394] = (iLight_A039 == 4 )    //LIGHTS SC4
[dvTPiLight,399] = !(iLight_A039 == 0 )    //LIGHTS OFF
//Boot Room
[dvTPiLight,400] = (iLight_A040 == 0 )    //LIGHTS OFF
[dvTPiLight,401] = (iLight_A040 == 1 )    //LIGHTS SC1
[dvTPiLight,402] = (iLight_A040 == 2 )    //LIGHTS SC2
[dvTPiLight,403] = (iLight_A040 == 3 )    //LIGHTS SC3
[dvTPiLight,404] = (iLight_A040 == 4 )    //LIGHTS SC4
[dvTPiLight,409] = !(iLight_A040 == 0 )    //LIGHTS OFF
//Utility Room
[dvTPiLight,410] = (iLight_A041 == 0 )    //LIGHTS OFF
[dvTPiLight,411] = (iLight_A041 == 1 )    //LIGHTS SC1
[dvTPiLight,412] = (iLight_A041 == 2 )    //LIGHTS SC2
[dvTPiLight,413] = (iLight_A041 == 3 )    //LIGHTS SC3
[dvTPiLight,414] = (iLight_A041 == 4 )    //LIGHTS SC4
[dvTPiLight,419] = !(iLight_A041 == 0 )    //LIGHTS OFF
//Sewing Room Ensuite
[dvTPiLight,420] = (iLight_A042 == 0 )    //LIGHTS OFF
[dvTPiLight,421] = (iLight_A042 == 1 )    //LIGHTS SC1
[dvTPiLight,422] = (iLight_A042 == 2 )    //LIGHTS SC2
[dvTPiLight,423] = (iLight_A042 == 3 )    //LIGHTS SC3
[dvTPiLight,424] = (iLight_A042 == 4 )    //LIGHTS SC4
[dvTPiLight,429] = !(iLight_A042 == 0 )    //LIGHTS OFF
//Sewing Room Stores
[dvTPiLight,430] = (iLight_A043 == 0 )    //LIGHTS OFF
[dvTPiLight,431] = (iLight_A043 == 1 )    //LIGHTS SC1
[dvTPiLight,432] = (iLight_A043 == 2 )    //LIGHTS SC2
[dvTPiLight,433] = (iLight_A043 == 3 )    //LIGHTS SC3
[dvTPiLight,434] = (iLight_A043 == 4 )    //LIGHTS SC4
[dvTPiLight,439] = !(iLight_A043 == 0 )    //LIGHTS OFF
//Sewing Room
[dvTPiLight,440] = (iLight_A044 == 0 )    //LIGHTS OFF
[dvTPiLight,441] = (iLight_A044 == 1 )    //LIGHTS SC1
[dvTPiLight,442] = (iLight_A044 == 2 )    //LIGHTS SC2
[dvTPiLight,443] = (iLight_A044 == 3 )    //LIGHTS SC3
[dvTPiLight,444] = (iLight_A044 == 4 )    //LIGHTS SC4
[dvTPiLight,449] = !(iLight_A044 == 0 )    //LIGHTS OFF
//Courtyard (External)
[dvTPiLight,450] = (iLight_A045 == 0 )    //LIGHTS OFF
[dvTPiLight,451] = (iLight_A045 == 1 )    //LIGHTS SC1
[dvTPiLight,452] = (iLight_A045 == 2 )    //LIGHTS SC2
[dvTPiLight,453] = (iLight_A045 == 3 )    //LIGHTS SC3
[dvTPiLight,454] = (iLight_A045 == 4 )    //LIGHTS SC4
[dvTPiLight,459] = !(iLight_A045 == 0 )    //LIGHTS OFF
//Garage Lobby
[dvTPiLight,460] = (iLight_A046 == 0 )    //LIGHTS OFF
[dvTPiLight,461] = (iLight_A046 == 1 )    //LIGHTS SC1
[dvTPiLight,462] = (iLight_A046 == 2 )    //LIGHTS SC2
[dvTPiLight,463] = (iLight_A046 == 3 )    //LIGHTS SC3
[dvTPiLight,464] = (iLight_A046 == 4 )    //LIGHTS SC4
[dvTPiLight,469] = !(iLight_A046 == 0 )    //LIGHTS OFF
//Garage Ensuite
[dvTPiLight,470] = (iLight_A047 == 0 )    //LIGHTS OFF
[dvTPiLight,471] = (iLight_A047 == 1 )    //LIGHTS SC1
[dvTPiLight,472] = (iLight_A047 == 2 )    //LIGHTS SC2
[dvTPiLight,473] = (iLight_A047 == 3 )    //LIGHTS SC3
[dvTPiLight,474] = (iLight_A047 == 4 )    //LIGHTS SC4
[dvTPiLight,479] = !(iLight_A047 == 0 )    //LIGHTS OFF
//Left Garage
[dvTPiLight,480] = (iLight_A048 == 0 )    //LIGHTS OFF
[dvTPiLight,481] = (iLight_A048 == 1 )    //LIGHTS SC1
[dvTPiLight,482] = (iLight_A048 == 2 )    //LIGHTS SC2
[dvTPiLight,483] = (iLight_A048 == 3 )    //LIGHTS SC3
[dvTPiLight,484] = (iLight_A048 == 4 )    //LIGHTS SC4
[dvTPiLight,489] = !(iLight_A048 == 0 )    //LIGHTS OFF
//Basement Toilet
[dvTPiLight,490] = (iLight_A049 == 0 )    //LIGHTS OFF
[dvTPiLight,491] = (iLight_A049 == 1 )    //LIGHTS SC1
[dvTPiLight,492] = (iLight_A049 == 2 )    //LIGHTS SC2
[dvTPiLight,493] = (iLight_A049 == 3 )    //LIGHTS SC3
[dvTPiLight,494] = (iLight_A049 == 4 )    //LIGHTS SC4
[dvTPiLight,499] = !(iLight_A049 == 0 )    //LIGHTS OFF
//Middle Garage
[dvTPiLight,500] = (iLight_A050 == 0 )    //LIGHTS OFF
[dvTPiLight,501] = (iLight_A050 == 1 )    //LIGHTS SC1
[dvTPiLight,502] = (iLight_A050 == 2 )    //LIGHTS SC2
[dvTPiLight,503] = (iLight_A050 == 3 )    //LIGHTS SC3
[dvTPiLight,504] = (iLight_A050 == 4 )    //LIGHTS SC4
[dvTPiLight,509] = !(iLight_A050 == 0 )    //LIGHTS OFF
//Right Garage
[dvTPiLight,510] = (iLight_A051 == 0 )    //LIGHTS OFF
[dvTPiLight,511] = (iLight_A051 == 1 )    //LIGHTS SC1
[dvTPiLight,512] = (iLight_A051 == 2 )    //LIGHTS SC2
[dvTPiLight,513] = (iLight_A051 == 3 )    //LIGHTS SC3
[dvTPiLight,514] = (iLight_A051 == 4 )    //LIGHTS SC4
[dvTPiLight,519] = !(iLight_A051 == 0 )    //LIGHTS OFF
//Front Garden Lighting (External)
[dvTPiLight,520] = (iLight_A052 == 0 )    //LIGHTS OFF
[dvTPiLight,521] = (iLight_A052 == 1 )    //LIGHTS SC1
[dvTPiLight,522] = (iLight_A052 == 2 )    //LIGHTS SC2
[dvTPiLight,523] = (iLight_A052 == 3 )    //LIGHTS SC3
[dvTPiLight,524] = (iLight_A052 == 4 )    //LIGHTS SC4
[dvTPiLight,529] = !(iLight_A052 == 0 )    //LIGHTS OFF
//Rear Garden Lighting (External)
[dvTPiLight,530] = (iLight_A053 == 0 )    //LIGHTS OFF
[dvTPiLight,531] = (iLight_A053 == 1 )    //LIGHTS SC1
[dvTPiLight,532] = (iLight_A053 == 2 )    //LIGHTS SC2
[dvTPiLight,533] = (iLight_A053 == 3 )    //LIGHTS SC3
[dvTPiLight,534] = (iLight_A053 == 4 )    //LIGHTS SC4
[dvTPiLight,539] = !(iLight_A053 == 0 )    //LIGHTS OFF
//Christmas Tree
[dvTPiLight,540] = (iLight_A054 == 0 )    //LIGHTS OFF
[dvTPiLight,541] = (iLight_A054 == 1 )    //LIGHTS SC1
[dvTPiLight,542] = (iLight_A054 == 2 )    //LIGHTS SC2
[dvTPiLight,543] = (iLight_A054 == 3 )    //LIGHTS SC3
[dvTPiLight,544] = (iLight_A054 == 4 )    //LIGHTS SC4
[dvTPiLight,549] = !(iLight_A054 == 0 )    //LIGHTS OFF
//Gate Lights
[dvTPiLight,550] = (iLight_A055 == 0 )    //LIGHTS OFF
[dvTPiLight,551] = (iLight_A055 == 1 )    //LIGHTS SC1
[dvTPiLight,552] = (iLight_A055 == 2 )    //LIGHTS SC2
[dvTPiLight,553] = (iLight_A055 == 3 )    //LIGHTS SC3
[dvTPiLight,554] = (iLight_A055 == 4 )    //LIGHTS SC4
[dvTPiLight,559] = !(iLight_A055 == 0 )    //LIGHTS OFF
//Spares
[dvTPiLight,990] = (iLight_A099 == 0 )    //LIGHTS OFF
[dvTPiLight,991] = (iLight_A099 == 1 )    //LIGHTS SC1
[dvTPiLight,992] = (iLight_A099 == 2 )    //LIGHTS SC2
[dvTPiLight,993] = (iLight_A099 == 3 )    //LIGHTS SC3
[dvTPiLight,994] = (iLight_A099 == 4 )    //LIGHTS SC4
[dvTPiLight,999] = !(iLight_A099 == 0 )    //LIGHTS OFF
//Disco Ball 1
[dvTPiLight,1500] = (iLight_A150 == 0 )    //LIGHTS OFF
[dvTPiLight,1501] = (iLight_A150 == 1 )    //LIGHTS SC1
[dvTPiLight,1502] = (iLight_A150 == 2 )    //LIGHTS SC2
[dvTPiLight,1503] = (iLight_A150 == 3 )    //LIGHTS SC3
[dvTPiLight,1504] = (iLight_A150 == 4 )    //LIGHTS SC4
[dvTPiLight,1509] = !(iLight_A150 == 0 )    //LIGHTS OFF
//Disco Ball 2
[dvTPiLight,1510] = (iLight_A151 == 0 )    //LIGHTS OFF
[dvTPiLight,1511] = (iLight_A151 == 1 )    //LIGHTS SC1
[dvTPiLight,1512] = (iLight_A151 == 2 )    //LIGHTS SC2
[dvTPiLight,1513] = (iLight_A151 == 3 )    //LIGHTS SC3
[dvTPiLight,1514] = (iLight_A151 == 4 )    //LIGHTS SC4
[dvTPiLight,1519] = !(iLight_A151 == 0 )    //LIGHTS OFF
//Cinema Windows (SS002 = Close, SS001 = Open)
[dvTPiLight,2000] = (iLight_A200 == 0 )    //Unsure
[dvTPiLight,2001] = (iLight_A200 == 1 )    //Open Windows
[dvTPiLight,2002] = (iLight_A200 == 2 )    //Close Windows
[dvTPiLight,2009] = !(iLight_A200 == 2 )    //Windows Closing / Closed
//Pool Door (L000 = Locked, L100 = Unlocked)
[dvTPiLight,2010] = (iLight_A201 == 1 )    //Lock Door
[dvTPiLight,2011] = (iLight_A201 == 2 )    //Unlock Door
[dvTPiLight,2019] = !(iLight_A201 == 1 )    //If door is not locked
//Pool Cover (SS001 = Open, SS000 = Stop, SS002 Close)
//[dvTPiLight,2020] =  (iLight_A202 == 0 )    //Stop
[dvTPiLight,2021] =  (iLight_A202 == 1 )    //Uncover Pool
[dvTPiLight,2022] =  (iLight_A202 == 2 )    //Cover Pool
[dvTPiLight,2029] = !(iLight_A202 == 2 )  
//Garage 1 (LHS) Door - L100 = Open, Close, Stop
[dvTPiLight,2030] = (iLight_A203 == 1 )    //Open & Close Door
//Garage 2 (RHS) Door - L100 = Open, Close, Stop
[dvTPiLight,2040] = (iLight_A204 == 1 )    //Open & Close Door
//Front Gates - Open timed wait close = SS001, Button for Open/Hold same SS... ???
[dvTPiLight,2050] = ((iLight_A205 == 0 )  & (iLightGates = 1))      //Open
[dvTPiLight,2051] = ((iLight_A205 == 1 )  & (iLightGates = 1))    //Keep Open
[dvTPiLight,2059] = (!(iLight_A205 == 0 ) & !(iLightGates = 0))    //Gates are not shut
//Area 206
[dvTPiLight,2060] = (iLight_A206 == 0 )    //LIGHTS OFF
[dvTPiLight,2061] = (iLight_A206 == 1 )    //LIGHTS SC1
[dvTPiLight,2062] = (iLight_A206 == 2 )    //LIGHTS SC2
[dvTPiLight,2063] = (iLight_A206 == 3 )    //LIGHTS SC3
[dvTPiLight,2064] = (iLight_A206 == 4 )    //LIGHTS SC4
[dvTPiLight,2069] = !(iLight_A206 == 0 )    //LIGHTS OFF
//Area 207
[dvTPiLight,2070] = (iLight_A207 == 0 )    //LIGHTS OFF
[dvTPiLight,2071] = (iLight_A207 == 1 )    //LIGHTS SC1
[dvTPiLight,2072] = (iLight_A207 == 2 )    //LIGHTS SC2
[dvTPiLight,2073] = (iLight_A207 == 3 )    //LIGHTS SC3
[dvTPiLight,2074] = (iLight_A207 == 4 )    //LIGHTS SC4
[dvTPiLight,2079] = !(iLight_A207 == 0 )    //LIGHTS OFF
//Area 208
[dvTPiLight,2080] = (iLight_A208 == 0 )    //LIGHTS OFF
[dvTPiLight,2081] = (iLight_A208 == 1 )    //LIGHTS SC1
[dvTPiLight,2082] = (iLight_A208 == 2 )    //LIGHTS SC2
[dvTPiLight,2083] = (iLight_A208 == 3 )    //LIGHTS SC3
[dvTPiLight,2084] = (iLight_A208 == 4 )    //LIGHTS SC4
[dvTPiLight,2089] = !(iLight_A208 == 0 )    //LIGHTS OFF
//Cinema Fan (SS000 = Off, SS001 = Low, SS002 = Med, SS003=High)
[dvTPiLight,2090] = (iLight_A209 == 0 )    //FAN OFF
[dvTPiLight,2091] = (iLight_A209 == 1 )    //FAN LOW
[dvTPiLight,2092] = (iLight_A209 == 2 )    //FAN MED
[dvTPiLight,2093] = (iLight_A209 == 3 )    //FAN HIGH
[dvTPiLight,2099] = !(iLight_A209 == 0 )    //FAN OFF
//Area 258
[dvTPiLight,2580] = (iLight_A258 == 0 )    //LIGHTS OFF
[dvTPiLight,2581] = (iLight_A258 == 1 )    //LIGHTS SC1
[dvTPiLight,2582] = (iLight_A258 == 2 )    //LIGHTS SC2
[dvTPiLight,2583] = (iLight_A258 == 3 )    //LIGHTS SC3
[dvTPiLight,2584] = (iLight_A258 == 4 )    //LIGHTS SC4
[dvTPiLight,2589] = !(iLight_A258 == 0 )    //LIGHTS OFF
//Pool Ceiling 1
[dvTPiLight,3010] = (iLight_A301 == 0 )    //LIGHTS OFF
[dvTPiLight,3011] = (iLight_A301 == 1 )    //LIGHTS SC1
[dvTPiLight,3012] = (iLight_A301 == 2 )    //LIGHTS SC2
[dvTPiLight,3013] = (iLight_A301 == 3 )    //LIGHTS SC3
[dvTPiLight,3014] = (iLight_A301 == 4 )    //LIGHTS SC4
[dvTPiLight,3019] = !(iLight_A301 == 0 )    //LIGHTS OFF

Comments

  • a_riot42a_riot42 AMX Wizard Posts: 1,619
    I certainly wouldn't do it this way. Mainline is for asynchronous events. Like a timed event, something that happens at noon every day for instance. I don't see the point of a wait in mainline, since that's kind of a "hurry up and wait" situation. Why check feedback incessantly, but then only every half second?

    You are going to be better off doing this in events according to the feedback you get. What I typically do is store the state of the lights, and then update the panel when the user clicks on the lighting page using the stored values. What you are doing might work, but it will slow down everything, so it will operate like a C4 system.
    Paul
  • mkleynhansmkleynhans Junior Member Posts: 76
    Thanks for the feedback Paul, I was worried about so much feedback in mainline after reading elsewhere that this is bad practice to do it like this. It is working but I want to improve it.

    I have been stuck on what to do though. I am thinking of trying to write a module (havent done one before) and use channels for feedback rather. The only thing is that I believe that I can only have up to 255 channels per virtual device so how would you guys go about this?
    There are about 65 areas and I am hoping to provide feedback on whether the lights are on or off + which scene is selected on the actual lighting page for the zone... circa 325 channels needed....
  • a_riot42a_riot42 AMX Wizard Posts: 1,619
    mkleynhans wrote: »
    Thanks for the feedback Paul, I was worried about so much feedback in mainline after reading elsewhere that this is bad practice to do it like this. It is working but I want to improve it.

    I have been stuck on what to do though. I am thinking of trying to write a module (havent done one before) and use channels for feedback rather. The only thing is that I believe that I can only have up to 255 channels per virtual device so how would you guys go about this?
    There are about 65 areas and I am hoping to provide feedback on whether the lights are on or off + which scene is selected on the actual lighting page for the zone... circa 325 channels needed....

    I'm not sure why you need to worry about virtual channel counts it should be fine, and there are functions to set extra channels, levels, etc should you need more. I'm not familiar with the iLight lighting system, but presumably it sends feedback about the status of loads. You parse the feedback regarding which load was triggered and its state and store it in your program somehow, so your program reflects the state of the lighting system at all times.

    Then when a user flips to the lighting page, you turn on the appropriate channels on the actual TP not a virtual device, that reflects the light status, and that should do it. Some people will use a different channel for each button using lots of channels, which works, but I typically only use a few buttons, usually the number of buttons on the largest physical keypad, and update the page dynamically with the button label and state, reusing the channels. This pushes most of the work to the code, rather than the touch panel, which is my preference.

    Sometimes you have to get creative depending on the scenario. If a user needs access to many lighting buttons at the same time, you have no choice but to use lots of channels/buttons. Each situation is different. I would certainly write a module for this type of thing, and I use a different TP port for lighting as well so for lighting I'll have a TP defined like 10001:3:1 and use port 3 for lighting so feedback doesn't get crossed up with other buttons using the same channel numbers. If you write a module and it doesn't work then post it and folks can help you with it.
    Paul
  • mkleynhansmkleynhans Junior Member Posts: 76
    Thanks again Paul. Yep, we have 10" panels showing a floor plan which has icons for the lighting (this is where I feedback the on / off status ) then if you touch the lightbulb icon for that zone it gives you the facility to control that zone with buttons for on, off, Scene 1 through to scene 4.. This all working by me parsing the serial strings for the scenes etc. but it's now just a matter of finding the most efficient way of doing this...
    I have started writing a module that has the tp's button events sending commands to a vdv which then sends the strings to the dv. For feedback I have the dv strings coming in and currently updating an area var with 0 ... 4 but don't know the best way to handle this info now... Should I rather turn on channels on the tp straight away with this info?



    Sent from my iPhone using Tapatalk
  • a_riot42a_riot42 AMX Wizard Posts: 1,619
    mkleynhans wrote: »
    Thanks again Paul. Yep, we have 10" panels showing a floor plan which has icons for the lighting (this is where I feedback the on / off status ) then if you touch the lightbulb icon for that zone it gives you the facility to control that zone with buttons for on, off, Scene 1 through to scene 4.. This all working by me parsing the serial strings for the scenes etc. but it's now just a matter of finding the most efficient way of doing this...
    I have started writing a module that has the tp's button events sending commands to a vdv which then sends the strings to the dv. For feedback I have the dv strings coming in and currently updating an area var with 0 ... 4 but don't know the best way to handle this info now... Should I rather turn on channels on the tp straight away with this info?



    Sent from my iPhone using Tapatalk

    You could, although my preference is to store the state of the lighting system in memory first, and then update panels. Should a panel go offline, you can easily update it with the proper states instead of waiting for the next round of feedback. So store the data in a structure or array or some other data structure, and update the panels.
    Paul
  • mkleynhansmkleynhans Junior Member Posts: 76
    Thanks Paul, will give it a try. I really appreciate the suggestions.


    Sent from my iPhone using Tapatalk
Sign In or Register to comment.