insert into macroheader values ('MSETOPTIONS','Set Motion Sensor Options',0,0,1); insert into macrodetail values ('MSETOPTIONS',1,37,'',NULL,'MSETOPTIONS Beta 3',0,'',''); insert into macrodetail values ('MSETOPTIONS',2,38,'',0,'ph_setvar_s(1,1,ph_insteonwithretext(ph_getvar_s(2,7),46,0,"00 00 00"))',0,'','Read Motion Sensor Options'); insert into macrodetail values ('MSETOPTIONS',3,27,'',NULL,'if(len(ph_getvar_s(1,1))=2,"CONTINUE","USEEXTENDEDDATA")',0,'','TEST TEMP Is 2E working'); insert into macrodetail values ('MSETOPTIONS',4,31,'',NULL,'1',0,'',''); insert into macrodetail values ('MSETOPTIONS',5,38,'',0,'ph_setvar_s(1,2,ph_insteonwithretext(ph_getvar_s(2,7),47,0,"00 00 00 07 01"))',0,'',' TEST TEMP Read MS from old location'); insert into macrodetail values ('MSETOPTIONS',6,36,'',NULL,'ph_getvar_s(1,2)',1,'','TEST TEMP Display MS Memory '); insert into macrodetail values ('MSETOPTIONS',7,38,'',0,'ph_setvar_s(1,1,"000001" + mid(ph_getvar_s(1,2),23,6) + mid(ph_getvar_s(1,2),21,2) + "0000000000000000") ',0,'',' TEST TEMP Build 2E from 2F'); insert into macrodetail values ('MSETOPTIONS',8,36,'',NULL,'ph_getvar_s(1,1)',1,'','TEST TEMP '); insert into macrodetail values ('MSETOPTIONS',9,38,'',0,'ph_setvar_s(1,1,"0000017D0133180086010220580000") ',1,'','TEST TEMP Data String'); insert into macrodetail values ('MSETOPTIONS',10,36,'',NULL,'ph_getvar_s(1,1)',1,'','TEST TEMP'); insert into macrodetail values ('MSETOPTIONS',11,26,'',NULL,'USEEXTENDEDDATA',0,'',''); insert into macrodetail values ('MSETOPTIONS',12,27,'',NULL,'if(ph_getglobal_s("MSWRITE")="Y","WRITEOPTIONS","CONTINUE")',0,'','Is this Motion On Write case'); insert into macrodetail values ('MSETOPTIONS',13,27,'',NULL,'if(ph_getglobal_s("MSWRITE")="N","DISPLAYOPTIONS","CONTINUE")',0,'','Do Global Variables exist'); insert into macrodetail values ('MSETOPTIONS',14,38,'',0,'ph_createglobal("MSWRITE","N") + ph_createglobal("MSFLAGS","00") + ph_createglobal("MSDARK","000") + ph_createglobal("MSLED","000") + ph_createglobal("MSTIMEOUT","000") + ph_createglobal("MSOPTIONS","0")',0,'','Create Global Variables'); insert into macrodetail values ('MSETOPTIONS',15,26,'',NULL,'DISPLAYOPTIONS',0,'',''); insert into macrodetail values ('MSETOPTIONS',16,38,'',0,'ph_setglobal_a("MSOPTIONS",0)',0,'','Clear Options to Write'); insert into macrodetail values ('MSETOPTIONS',17,38,'',0,'ph_setvar_s(1,8," Motion Sensor Options ~r~n")',0,'','Add Title '); insert into macrodetail values ('MSETOPTIONS',18,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + "~r~nID: " + ph_getvar_s(2,7) + " " + ph_getvar_s(2,10) + "~r~n")',0,'','Add ID and Insteon Address'); insert into macrodetail values ('MSETOPTIONS',19,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + "~r~n" + "Current Data: 0x" + ph_getvar_s(1,1))',1,'','TEST Add Current Data '); insert into macrodetail values ('MSETOPTIONS',20,38,'',0,'ph_setvar_s(1,2,mid(ph_getvar_s(1,1),13,2)) + ph_setvar_s(1,3,string(ph_hextonum(ph_getvar_s(1,2))))',0,'','Get Flags'); insert into macrodetail values ('MSETOPTIONS',21,10,'MSFLAGS',NULL,'ph_getvar_s(1,2)',0,'','Set Global Flags'); insert into macrodetail values ('MSETOPTIONS',22,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + "~r~n" + "Option Flags: 0x" + ph_getvar_s(1,2))',1,'','TEST Add Option flags to Popup'); insert into macrodetail values ('MSETOPTIONS',23,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + (if (ph_and(ph_getvar_n(1,3),2)>0, "~r~n1 - On Only mode: ON/OFF Commands *** 2 - On Only mode: On Only Commands", "~r~n1 - On Only mode: ON/OFF Commands 2 - On Only mode: On Only Commands ***")))',0,'','Add On Only mode to Popup'); insert into macrodetail values ('MSETOPTIONS',24,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + (if (ph_and(ph_getvar_n(1,3),8)>0, "~r~n3 - LED: On *** 4 - LED: Off", "~r~n3 - LED: On 4 - LED: Off ***")))',0,'','Add LED Flag to Popup'); insert into macrodetail values ('MSETOPTIONS',25,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + (if (ph_and(ph_getvar_n(1,3),4)>0, "~r~n5 - Night Only mode: Always On *** 6 - Night Only Mode: Night Only", "~r~n5 - Night Only mode: Always On 6 - Night Only Mode: Night Only ***")))',0,'','Add Night mode to Popup'); insert into macrodetail values ('MSETOPTIONS',26,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + (if (ph_and(ph_getvar_n(1,3),16)>0, "~r~n7 - Occupancy mode: On *** 8 - Occupancy mode: Off", "~r~n7 - Occupancy mode: On 8 - Occupancy mode: Off ***")))',0,'','Add Occupancy Flag to Popup'); insert into macrodetail values ('MSETOPTIONS',27,38,'',0,'ph_setvar_s(1,2,mid(ph_getvar_s(1,1),7,2)) + ph_setvar_s(1,3,string(ph_hextonum(ph_getvar_s(1,2))))',0,'','Get LED Bright Level'); insert into macrodetail values ('MSETOPTIONS',28,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + "~r~n~r~n" + "9 - LED Level (larger Brighter, max 255): " + ph_getvar_s(1,3) + " (0x" + ph_getvar_s(1,2) + ")") + ph_setglobal_s("MSLED",ph_getvar_s(1,3))',0,'','Add LED Level to Popup'); insert into macrodetail values ('MSETOPTIONS',29,38,'',0,'ph_setvar_s(1,2,mid(ph_getvar_s(1,1),9,2)) + ph_setvar_s(1,3,string((ph_hextonum(ph_getvar_s(1,2))+1)*30))',0,'','Get Timeout Interval'); insert into macrodetail values ('MSETOPTIONS',30,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + "~r~n" + "10 - Timeout Interval in seconds (max 7680): " + ph_getvar_s(1,3) + " (0x" + ph_getvar_s(1,2) + ")" + " " + ph_getvar_n(1,3)/60 + " minutes") + ph_setglobal_s("MSTIMEOUT",ph_getvar_s(1,3)) ',0,'','Add Timeout Interval to Popup'); insert into macrodetail values ('MSETOPTIONS',31,38,'',0,'ph_setvar_s(1,2,mid(ph_getvar_s(1,1),11,2)) + ph_setvar_s(1,3,string(ph_hextonum(ph_getvar_s(1,2))))',0,'','Get Dusk/Dawn Level'); insert into macrodetail values ('MSETOPTIONS',32,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + "~r~n" + "11 - Dusk/Dawn Level (smaller darker, max 255): " + ph_getvar_s(1,3) + " (0x" + ph_getvar_s(1,2) + ")") + ph_setglobal_s("MSDARK",ph_getvar_s(1,3))',0,'','Add Dusk/Dawn Level to Popup'); insert into macrodetail values ('MSETOPTIONS',33,38,'',0,'ph_setvar_s(1,2,mid(ph_getvar_s(1,1),23,2)) + ph_setvar_s(1,3,string(ph_hextonum(ph_getvar_s(1,2))))',0,'','Get Ambient Light Level'); insert into macrodetail values ('MSETOPTIONS',34,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + "~r~n" + "~r~n" + "Current Ambient Light Level: " + ph_getvar_s(1,3) + " (0x" + ph_getvar_s(1,2) + ")")',0,'','Add Current Ambient Light Level to Popup'); insert into macrodetail values ('MSETOPTIONS',35,38,'',0,'ph_setvar_s(1,2,mid(ph_getvar_s(1,1),25,2)) + ph_setvar_s(1,3,string(ph_hextonum(ph_getvar_s(1,2))))',0,'','Get Battery Level'); insert into macrodetail values ('MSETOPTIONS',36,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + " " + "Battery Level (90> full): " + ph_getvar_s(1,3) + " (0x" + ph_getvar_s(1,2) + ")")',0,'','Add Battery level to Popup'); insert into macrodetail values ('MSETOPTIONS',37,38,'',0,'ph_setvar_s(1,2,mid(ph_getvar_s(1,1),19,2)) + ph_setvar_s(1,3,string(ph_hextonum(ph_getvar_s(1,2))))',0,'','Get Jumper State'); insert into macrodetail values ('MSETOPTIONS',38,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + "~r~n" + "Jumper Flags: 0x" + ph_getvar_s(1,2))',1,'','TEST Add Jumper Flags'); insert into macrodetail values ('MSETOPTIONS',39,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + "~r~n" + (if (ph_and(ph_getvar_n(1,3),8)>0, "Jumper 2: On", "Jumper 2: Off")))',0,'','Add Jump 2 Status'); insert into macrodetail values ('MSETOPTIONS',40,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + " " + (if (ph_and(ph_getvar_n(1,3),4)>0, "Jumper 3: On", "Jumper 3: Off")))',0,'','Add Jumper 3 Statue'); insert into macrodetail values ('MSETOPTIONS',41,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + " " + (if (ph_and(ph_getvar_n(1,3),2)>0, "Jumper 4: On", "Jumper 4: Off")))',0,'','Add Jumper 4 Status'); insert into macrodetail values ('MSETOPTIONS',42,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + " " + (if (ph_and(ph_getvar_n(1,3),1)>0, "Jumper 5: On", "Jumper 5: Off")))',0,'','Add Jumper 5 Status'); insert into macrodetail values ('MSETOPTIONS',43,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + "~r~n~r~n Enter number(s) of Option(s) ex 2 5 7 10(120) 11(80)")',0,'','Add Prompt'); insert into macrodetail values ('MSETOPTIONS',44,36,'',NULL,'"Invoking Input Box"',1,'','TEST Message'); insert into macrodetail values ('MSETOPTIONS',45,25,'No TTS',NULL,'ph_getvar_s(1,8)',0,'','Display Popup'); insert into macrodetail values ('MSETOPTIONS',46,26,'',NULL,'PROCESSINPUT',0,'',''); insert into macrodetail values ('MSETOPTIONS',47,38,'',0,'ph_setvar_s(1,9,"[INPUTRET]" + " ")',0,'','Initialize Search Data'); insert into macrodetail values ('MSETOPTIONS',48,38,'',0,'ph_setvar_a(1,10,1)',0,'','Initialize Index'); insert into macrodetail values ('MSETOPTIONS',49,26,'',NULL,'SCANINPUT',0,'',''); insert into macrodetail values ('MSETOPTIONS',50,38,'',0,'ph_setvar_s(1,7,ph_regexdiff("^"," ",ph_getvar_s(1,9),1,0))',0,'','Scan 1st parm'); insert into macrodetail values ('MSETOPTIONS',51,36,'',NULL,'"Searched Data: " + ph_getvar_s(1,9) + " Returned data: " + ph_getvar_s(1,7) + " Length: " + len(ph_getvar_s(1,7)) + " Index: " + ph_getvar_n(1,10)',1,'','TEST Display Scan of Input data'); insert into macrodetail values ('MSETOPTIONS',52,27,'',NULL,'if(len(ph_getvar_s(1,7))>0,"CONTINUE","EXIT")',0,'',''); insert into macrodetail values ('MSETOPTIONS',53,38,'',0,'ph_setvar_a(1,10,ph_getvar_n(1,10)+len(ph_getvar_s(1,7)))',0,'','Update working Index'); insert into macrodetail values ('MSETOPTIONS',54,38,'',0,'ph_setvar_a(1,6,len(ph_getvar_s(1,9))-len(ph_getvar_s(1,7)+1))',0,'','Update Length of Data remaining'); insert into macrodetail values ('MSETOPTIONS',55,38,'',0,'ph_setvar_s(1,9,right(ph_getvar_s(1,9),ph_getvar_n(1,6)))',0,'','Remove Last Parm'); insert into macrodetail values ('MSETOPTIONS',56,27,'',NULL,'if(ph_getvar_s(1,7)="1","ONOFFCMDS","CONTINUE")',0,'',''); insert into macrodetail values ('MSETOPTIONS',57,27,'',NULL,'if(ph_getvar_s(1,7)="2","ONONLYCMDS","CONTINUE")',0,'',''); insert into macrodetail values ('MSETOPTIONS',58,27,'',NULL,'if(ph_getvar_s(1,7)="3","LEDON","CONTINUE")',0,'',''); insert into macrodetail values ('MSETOPTIONS',59,27,'',NULL,'if(ph_getvar_s(1,7)="4","LEDOFF","CONTINUE")',0,'',''); insert into macrodetail values ('MSETOPTIONS',60,27,'',NULL,'if(ph_getvar_s(1,7)="5","NIGHTALWAYS","CONTINUE")',0,'',''); insert into macrodetail values ('MSETOPTIONS',61,27,'',NULL,'if(ph_getvar_s(1,7)="6","NIGHTNIGHT","CONTINUE")',0,'',''); insert into macrodetail values ('MSETOPTIONS',62,27,'',NULL,'if(ph_getvar_s(1,7)="7","OCCUPANCYON","CONTINUE")',0,'',''); insert into macrodetail values ('MSETOPTIONS',63,27,'',NULL,'if(ph_getvar_s(1,7)="8","OCCUPANCYOFF","CONTINUE")',0,'',''); insert into macrodetail values ('MSETOPTIONS',64,27,'',NULL,'if(left(ph_getvar_s(1,7),2)="9(","LEDLEVEL","CONTINUE")',0,'',''); insert into macrodetail values ('MSETOPTIONS',65,27,'',NULL,'if(left(ph_getvar_s(1,7),3)="10(","TIMEOUTINTERVAL","CONTINUE")',0,'',''); insert into macrodetail values ('MSETOPTIONS',66,27,'',NULL,'if(left(ph_getvar_s(1,7),3)="11(","DARKLEVEL","CONTINUE")',0,'',''); insert into macrodetail values ('MSETOPTIONS',67,37,'',NULL,'INVALID INPUT DATA Entered',0,'',''); insert into macrodetail values ('MSETOPTIONS',68,26,'',NULL,'INVALIDINPUT',0,'','Invalid Option or Data or Syntax error'); insert into macrodetail values ('MSETOPTIONS',69,38,'',0,'ph_setglobal_s("MSWRITE","N")',0,'','Cancel Write Status'); insert into macrodetail values ('MSETOPTIONS',70,38,'',0,'ph_setglobal_a("MSOPTIONS",0)',0,'','Clear Options Processed'); insert into macrodetail values ('MSETOPTIONS',71,24,'No TTS',1,'"Invalid Option/Parameter"',0,'','Display Error Popup'); insert into macrodetail values ('MSETOPTIONS',72,27,'',NULL,'"DISPLAYOPTIONS"',0,'',''); insert into macrodetail values ('MSETOPTIONS',73,27,'',NULL,'if(ph_getvar_n(1,10)>30,"EXIT","SCANINPUT")',0,'','Prevent Loop on syntax error'); insert into macrodetail values ('MSETOPTIONS',74,27,'',NULL,'if(ph_getvar_s(1,7)=" ","EXIT","SCANINPUT")',0,'','Stop Loop at end of Data'); insert into macrodetail values ('MSETOPTIONS',75,26,'',NULL,'EXIT',0,'',''); insert into macrodetail values ('MSETOPTIONS',76,38,'',0,'ph_enabletrigger(ph_getvar_s(2,1))',0,'','Enable Motion Sensor On Trigger'); insert into macrodetail values ('MSETOPTIONS',77,27,'',NULL,'if(ph_getglobal_s("MSWRITE")="Y","CONTINUE","COMPLETE")',0,'',''); insert into macrodetail values ('MSETOPTIONS',78,24,'No TTS',2,'"Click Ok then generate Motion to update"',0,'','Display Popup if writing options'); insert into macrodetail values ('MSETOPTIONS',79,36,'',NULL,'"MBRET: " + "[MBRET]"',1,'','TEST Display button click'); insert into macrodetail values ('MSETOPTIONS',80,27,'',NULL,'if("[MBRET]"="1","COMPLETE","CONTINUE")',0,'','Done If OK/Enter'); insert into macrodetail values ('MSETOPTIONS',81,26,'',NULL,'CANCELUPDATE',0,'',''); insert into macrodetail values ('MSETOPTIONS',82,10,'MSWRITE',NULL,'"N"',0,'',''); insert into macrodetail values ('MSETOPTIONS',83,10,'MSOPTIONS',NULL,'0',0,'',''); insert into macrodetail values ('MSETOPTIONS',84,26,'',NULL,'COMPLETE',0,'','Processing Complete'); insert into macrodetail values ('MSETOPTIONS',85,39,'',NULL,'',0,'','Terminate Macro'); insert into macrodetail values ('MSETOPTIONS',86,37,'',NULL,'PROCESS 2ND MOTION ON and WRITE OPTIONS to MS',0,'',''); insert into macrodetail values ('MSETOPTIONS',87,26,'',NULL,'WRITEOPTIONS',0,'',''); insert into macrodetail values ('MSETOPTIONS',88,36,'',NULL,'"Processing Write Options"',1,'','TEST'); insert into macrodetail values ('MSETOPTIONS',89,38,'',0,'ph_insteon(ph_getvar_s(2,7),32,24)',0,'',''); insert into macrodetail values ('MSETOPTIONS',90,31,'',NULL,'10',1,'',''); insert into macrodetail values ('MSETOPTIONS',91,38,'',0,'ph_setglobal_s("MSWRITE","N")',0,'','Reset Write Switch'); insert into macrodetail values ('MSETOPTIONS',92,38,'',0,'ph_setvar_s(1,8," Motion Sensor Options Updated~r~n")',0,'','Add Title'); insert into macrodetail values ('MSETOPTIONS',93,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + "~r~nID: " + ph_getvar_s(2,7) + " " + ph_getvar_s(2,10) + "~r~n")',0,'','Add ID and Address'); insert into macrodetail values ('MSETOPTIONS',94,27,'',NULL,'if((ph_and(ph_getglobal_n("MSOPTIONS"),1))>0,"CONTINUE","CKLEDLEVEL")',0,'','Skip Flags if not changed'); insert into macrodetail values ('MSETOPTIONS',95,38,'',0,'ph_setvar_s(1,2,ph_getglobal_s("MSFLAGS")) + ph_setvar_s(1,3,string(ph_hextonum(ph_getvar_s(1,2))))',0,'','Get Flags from Global Variable'); insert into macrodetail values ('MSETOPTIONS',96,38,'',0,'ph_setvar_s(1,1,ph_insteonwithretext(ph_getvar_s(2,7),46,0,"00 05 " + ph_getglobal_s("MSFLAGS")))',0,'','Write Flags to Motion Sensor'); insert into macrodetail values ('MSETOPTIONS',97,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + "~r~n" + "Option Flags: 0x" + ph_getvar_s(1,2))',1,'','TEST Add Flags'); insert into macrodetail values ('MSETOPTIONS',98,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + (if (ph_and(ph_getvar_n(1,3),2)>0, "~r~nOn Only mode: ON/OFF Commands ***", "~r~nOn Only mode: On Only Commands ***")))',0,'','Add On Only mode'); insert into macrodetail values ('MSETOPTIONS',99,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + (if (ph_and(ph_getvar_n(1,3),8)>0, "~r~nLED: On ***", "~r~nLED: Off ***")))',0,'','Add LED On/Off'); insert into macrodetail values ('MSETOPTIONS',100,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + (if (ph_and(ph_getvar_n(1,3),4)>0, "~r~nNight Only mode: Always On ***", "~r~nNight Only Mode: Night Only ***")))',0,'','Add Night Only mode'); insert into macrodetail values ('MSETOPTIONS',101,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + (if (ph_and(ph_getvar_n(1,3),16)>0, "~r~nOccupancy mode: On ***", "~r~nOccupancy mode: Off ***")))',0,'','Add Occupancy mode'); insert into macrodetail values ('MSETOPTIONS',102,26,'',NULL,'CKLEDLEVEL',0,'',''); insert into macrodetail values ('MSETOPTIONS',103,27,'',NULL,'if((ph_and(ph_getglobal_n("MSOPTIONS"),2))>0,"CONTINUE","CKTIMEOUT")',0,'','Was LED Level changed'); insert into macrodetail values ('MSETOPTIONS',104,38,'',0,'ph_setvar_s(1,3,ph_getglobal_s("MSLED")) + ph_setvar_s(1,2,ph_numtohex1(ph_getglobal_n("MSLED"),2))',0,'','Get LED Level from Global Variable'); insert into macrodetail values ('MSETOPTIONS',105,38,'',0,'ph_setvar_s(1,1,ph_insteonwithretext(ph_getvar_s(2,7),46,0,"00 02 " + ph_getvar_s(1,2)))',0,'','Write LED Level to Motion Sensor'); insert into macrodetail values ('MSETOPTIONS',106,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + "~r~n~r~n" + "LED Level (larger Brighter, max 255): " + ph_getvar_s(1,3) + " (0x" + ph_getvar_s(1,2) + ")")',0,'','Add LED Level'); insert into macrodetail values ('MSETOPTIONS',107,26,'',NULL,'CKTIMEOUT',0,'',''); insert into macrodetail values ('MSETOPTIONS',108,27,'',NULL,'if((ph_and(ph_getglobal_n("MSOPTIONS"),4))>0,"CONTINUE","CKDARKLEVEL")',0,'','Was Timout changed'); insert into macrodetail values ('MSETOPTIONS',109,38,'',0,'ph_setvar_s(1,2,ph_getglobal_s("MSTIMEOUT")) + ph_setvar_s(1,3,string((ph_hextonum(ph_getvar_s(1,2))+1)*30))',0,'','Get Timeout value from Global Variable'); insert into macrodetail values ('MSETOPTIONS',110,38,'',0,'ph_setvar_s(1,1,ph_insteonwithretext(ph_getvar_s(2,7),46,0,"00 03 " + ph_getglobal_s("MSTIMEOUT")))',0,'','Write Timeout Interval to Motion Sensor'); insert into macrodetail values ('MSETOPTIONS',111,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + "~r~n" + "Timeout Interval in seconds: " + ph_getvar_s(1,3) + " (0x" + ph_getvar_s(1,2) + ")" + " " + ph_getvar_n(1,3)/60 + " minutes")',0,'','Add Timeout Interval'); insert into macrodetail values ('MSETOPTIONS',112,26,'',NULL,'CKDARKLEVEL',0,'',''); insert into macrodetail values ('MSETOPTIONS',113,27,'',NULL,'if((ph_and(ph_getglobal_n("MSOPTIONS"),8))>0,"CONTINUE","DISPLAYUPDATES")',0,'','Was Dark Level changed'); insert into macrodetail values ('MSETOPTIONS',114,38,'',0,'ph_setvar_s(1,3,ph_getglobal_s("MSDARK")) + ph_setvar_s(1,2,ph_numtohex1(ph_getglobal_n("MSDARK"),2))',0,'','Get Dark Level from Global Variable'); insert into macrodetail values ('MSETOPTIONS',115,38,'',0,'ph_setvar_s(1,1,ph_insteonwithretext(ph_getvar_s(2,7),46,0,"00 04 " + ph_getvar_s(1,2)))',0,'','Write Dark level to Motion Sensor'); insert into macrodetail values ('MSETOPTIONS',116,38,'',0,'ph_setvar_s(1,8,ph_getvar_s(1,8) + "~r~n" + "Dusk/Dawn Level (smaller darker, max 255): " + ph_getvar_s(1,3) + " (0x" + ph_getvar_s(1,2) + ")")',0,'','Add Dark Level'); insert into macrodetail values ('MSETOPTIONS',117,26,'',NULL,'DISPLAYUPDATES',0,'',''); insert into macrodetail values ('MSETOPTIONS',118,38,'',0,'ph_insteon(ph_getvar_s(2,7),32,25)',0,'',''); insert into macrodetail values ('MSETOPTIONS',119,24,'No TTS',1,'ph_getvar_s(1,8)',0,'',''); insert into macrodetail values ('MSETOPTIONS',120,27,'',NULL,'"EXIT"',0,'',''); insert into macrodetail values ('MSETOPTIONS',121,37,'',NULL,'',0,'',''); insert into macrodetail values ('MSETOPTIONS',122,37,'',NULL,'PROCESS OPTIONS ENTERED ON FIRST SCREEN',0,'',''); insert into macrodetail values ('MSETOPTIONS',123,26,'',NULL,'ONOFFCMDS',0,'',''); insert into macrodetail values ('MSETOPTIONS',124,38,'',0,'ph_setglobal_s("MSFLAGS",ph_numtohex1(ph_and(ph_hextonum(ph_getglobal_s("MSFLAGS")),255-2)+2,2))',0,'','To Global Variable'); insert into macrodetail values ('MSETOPTIONS',125,27,'',NULL,'"SETFLAGCHANGE"',0,'',''); insert into macrodetail values ('MSETOPTIONS',126,26,'',NULL,'ONONLYCMDS',0,'',''); insert into macrodetail values ('MSETOPTIONS',127,38,'',0,'ph_setglobal_s("MSFLAGS",ph_numtohex1(ph_and(ph_hextonum(ph_getglobal_s("MSFLAGS")),255-2),2))',0,'','To Global Variable'); insert into macrodetail values ('MSETOPTIONS',128,27,'',NULL,'"SETFLAGCHANGE"',0,'',''); insert into macrodetail values ('MSETOPTIONS',129,26,'',NULL,'LEDON',0,'',''); insert into macrodetail values ('MSETOPTIONS',130,38,'',0,'ph_setglobal_s("MSFLAGS",ph_numtohex1(ph_and(ph_hextonum(ph_getglobal_s("MSFLAGS")),255-8)+8,2))',0,'','To Global Variable'); insert into macrodetail values ('MSETOPTIONS',131,27,'',NULL,'"SETFLAGCHANGE"',0,'',''); insert into macrodetail values ('MSETOPTIONS',132,26,'',NULL,'LEDOFF',0,'',''); insert into macrodetail values ('MSETOPTIONS',133,38,'',0,'ph_setglobal_s("MSFLAGS",ph_numtohex1(ph_and(ph_hextonum(ph_getglobal_s("MSFLAGS")),255-8),2))',0,'','To Global Variable'); insert into macrodetail values ('MSETOPTIONS',134,27,'',NULL,'"SETFLAGCHANGE"',0,'',''); insert into macrodetail values ('MSETOPTIONS',135,26,'',NULL,'NIGHTALWAYS',0,'',''); insert into macrodetail values ('MSETOPTIONS',136,38,'',0,'ph_setglobal_s("MSFLAGS",ph_numtohex1(ph_and(ph_hextonum(ph_getglobal_s("MSFLAGS")),255-4)+4,2))',0,'','To Global Variable'); insert into macrodetail values ('MSETOPTIONS',137,27,'',NULL,'"SETFLAGCHANGE"',0,'',''); insert into macrodetail values ('MSETOPTIONS',138,26,'',NULL,'NIGHTNIGHT',0,'',''); insert into macrodetail values ('MSETOPTIONS',139,38,'',0,'ph_setglobal_s("MSFLAGS",ph_numtohex1(ph_and(ph_hextonum(ph_getglobal_s("MSFLAGS")),255-4),2))',0,'','To Global Variable'); insert into macrodetail values ('MSETOPTIONS',140,27,'',NULL,'"SETFLAGCHANGE"',0,'',''); insert into macrodetail values ('MSETOPTIONS',141,26,'',NULL,'OCCUPANCYON',0,'',''); insert into macrodetail values ('MSETOPTIONS',142,38,'',0,'ph_setglobal_s("MSFLAGS",ph_numtohex1(ph_and(ph_hextonum(ph_getglobal_s("MSFLAGS")),255-16)+16,2))',0,'','To Global Variable'); insert into macrodetail values ('MSETOPTIONS',143,27,'',NULL,'"SETFLAGCHANGE"',0,'',''); insert into macrodetail values ('MSETOPTIONS',144,26,'',NULL,'OCCUPANCYOFF',0,'',''); insert into macrodetail values ('MSETOPTIONS',145,38,'',0,'ph_setglobal_s("MSFLAGS",ph_numtohex1(ph_and(ph_hextonum(ph_getglobal_s("MSFLAGS")),255-16),2))',0,'','To Global Variable'); insert into macrodetail values ('MSETOPTIONS',146,27,'',NULL,'"SETFLAGCHANGE"',0,'',''); insert into macrodetail values ('MSETOPTIONS',147,26,'',NULL,'SETFLAGCHANGE',0,'',''); insert into macrodetail values ('MSETOPTIONS',148,38,'',0,'ph_setglobal_a("MSOPTIONS",ph_and(ph_getglobal_n("MSOPTIONS"),14)+1)',0,'','To Global Variable'); insert into macrodetail values ('MSETOPTIONS',149,10,'MSWRITE',NULL,'"Y"',0,'',''); insert into macrodetail values ('MSETOPTIONS',150,27,'',NULL,'"SCANINPUT"',0,'',''); insert into macrodetail values ('MSETOPTIONS',151,26,'',NULL,'LEDLEVEL',0,'','Process LED Level'); insert into macrodetail values ('MSETOPTIONS',152,38,'',0,'ph_setvar_s(1,4,ph_regexdiff("(",")",ph_getvar_s(1,7),1,0))',0,'','Retrieve LED Level'); insert into macrodetail values ('MSETOPTIONS',153,36,'',NULL,'"LED Level: " + ph_getvar_s(1,4)',0,'',''); insert into macrodetail values ('MSETOPTIONS',154,27,'',NULL,'if(isnumber(ph_getvar_s(1,4)),"CONTINUE","INVALIDINPUT")',0,'',''); insert into macrodetail values ('MSETOPTIONS',155,38,'',0,'ph_setglobal_a("MSLED",if(integer(ph_getvar_s(1,4))>255,255,integer(ph_getvar_s(1,4))))',0,'','To Global Variable'); insert into macrodetail values ('MSETOPTIONS',156,38,'',0,'ph_setglobal_a("MSOPTIONS",ph_and(ph_getglobal_n("MSOPTIONS"),13)+2)',0,'','Set LED Level indicator'); insert into macrodetail values ('MSETOPTIONS',157,10,'MSWRITE',NULL,'"Y"',0,'','Update Write required'); insert into macrodetail values ('MSETOPTIONS',158,27,'',NULL,'"SCANINPUT"',0,'',''); insert into macrodetail values ('MSETOPTIONS',159,26,'',NULL,'TIMEOUTINTERVAL',0,'','Process Timeout Interval'); insert into macrodetail values ('MSETOPTIONS',160,38,'',0,'ph_setvar_s(1,4,ph_regexdiff("(",")",ph_getvar_s(1,7),1,0))',0,'','Retrieve Timeout Interval'); insert into macrodetail values ('MSETOPTIONS',161,36,'',NULL,'"Timeout Interval in seconds: " + ph_getvar_s(1,4)',1,'','TEST Timeout value'); insert into macrodetail values ('MSETOPTIONS',162,27,'',NULL,'if(isnumber(ph_getvar_s(1,4)),"CONTINUE","INVALIDINPUT")',0,'',''); insert into macrodetail values ('MSETOPTIONS',163,38,'',0,'ph_setvar_s(1,4,if(ph_getvar_n(1,4)>7680,string(7680),ph_getvar_s(1,4)))',0,'','Override too large value '); insert into macrodetail values ('MSETOPTIONS',164,38,'',0,'ph_setglobal_a("MSTIMEOUT", ph_numtohex1(((integer(ph_getvar_s(1,4))/30)-1),2) )',0,'',''); insert into macrodetail values ('MSETOPTIONS',165,38,'',0,'ph_setglobal_a("MSOPTIONS",ph_and(ph_getglobal_n("MSOPTIONS"),11)+4)',0,'','Set Timeout Interval indicator'); insert into macrodetail values ('MSETOPTIONS',166,10,'MSWRITE',NULL,'"Y"',0,'','Update Write required'); insert into macrodetail values ('MSETOPTIONS',167,27,'',NULL,'"SCANINPUT"',0,'',''); insert into macrodetail values ('MSETOPTIONS',168,26,'',NULL,'DARKLEVEL',0,'','Process Dark value'); insert into macrodetail values ('MSETOPTIONS',169,38,'',0,'ph_setvar_s(1,4,ph_regexdiff("(",")",ph_getvar_s(1,7),1,0))',0,'','Retireve Dark Level value'); insert into macrodetail values ('MSETOPTIONS',170,38,'',0,'"Dark Level: " + ph_getvar_s(1,4)',0,'',''); insert into macrodetail values ('MSETOPTIONS',171,27,'',NULL,'if(isnumber(ph_getvar_s(1,4)),"CONTINUE","INVALIDINPUT")',0,'',''); insert into macrodetail values ('MSETOPTIONS',172,38,'',0,'ph_setglobal_a("MSDARK",if(integer(ph_getvar_s(1,4))>255,255,integer(ph_getvar_s(1,4))))',0,'','To Global Variable'); insert into macrodetail values ('MSETOPTIONS',173,38,'',0,'ph_setglobal_a("MSOPTIONS",ph_and(ph_getglobal_n("MSOPTIONS"),7)+8)',0,'','Set Dark Level indicator'); insert into macrodetail values ('MSETOPTIONS',174,10,'MSWRITE',NULL,'"Y"',0,'','Update Write required'); insert into macrodetail values ('MSETOPTIONS',175,27,'',NULL,'"SCANINPUT"',0,'','');