insert into macroheader values ('KPL UPDATE','KeypadLinc Update',0,0,1); insert into macrodetail values ('KPL UPDATE',1,15,'[LOCAL2]',NULL,'1',0,''); insert into macrodetail values ('KPL UPDATE',2,15,'[LOCAL1]',NULL,'ph_sql(0,"select id from insteondevices where typeid in (select typeid from insteontypes where description like ''%keypadlinc%'')")',0,''); insert into macrodetail values ('KPL UPDATE',3,26,'',NULL,'LOOP1',0,''); insert into macrodetail values ('KPL UPDATE',4,27,'',NULL,'if(ph_getvar_n(1,2) = 0,"","C1")',0,''); insert into macrodetail values ('KPL UPDATE',5,39,'',NULL,'',0,''); insert into macrodetail values ('KPL UPDATE',6,26,'',NULL,'C1',0,''); insert into macrodetail values ('KPL UPDATE',7,15,'[LOCAL3]',NULL,'ph_getline(ph_getvar_s(1,1),2)',0,''); insert into macrodetail values ('KPL UPDATE',8,15,'[LOCAL4]',NULL,'ph_insteonwithret(ph_getvar_s(1,3),25,2)',0,''); insert into macrodetail values ('KPL UPDATE',9,15,'[LOCAL5]',NULL,'8',0,''); insert into macrodetail values ('KPL UPDATE',10,26,'',NULL,'LOOP2',0,''); insert into macrodetail values ('KPL UPDATE',11,38,'',0,'ph_setdigitalout(ph_getvar_s(1,3) + "_" + ph_getvar_s(1,5),ph_and(2 ^ (ph_getvar_n(1,5) - 1),ph_getvar_n(1,4)))',0,''); insert into macrodetail values ('KPL UPDATE',12,27,'',NULL,'if(ph_addtovar(1,5, -1) = 0,"","LOOP2")',0,''); insert into macrodetail values ('KPL UPDATE',13,31,'',NULL,'1',0,''); insert into macrodetail values ('KPL UPDATE',14,27,'',NULL,'"LOOP1"',0,'');