insert into analogio values ('THERMOSTAT_MODE','Thermostat Mode',0,'VIRT',0,2,'',1,'Heat','','','case([DATA] when 0 then "Off" when 1 then "Heat" when 2 then "Cool" when 3 then "Auto" when 4 then "Fan" when 5 then "Program" when 6 then "Program Heat" when 7 then "Program Cool" else "Unknown")',0,65535,'','2008-07-25 20:30:00','',''); insert into analogio values ('THERMOSTAT_SP','Thermostat SetPoint',0,'VIRT',0,3,'',68,'68','Degrees','','',0,65535,'' ,'2008-07-25 20:30:00','',''); insert into analogio values ('THERMOSTAT_TEMP','Thermostat Temp',0,'VIRT',0,1,'',71,'71','Degrees','','',0,65535,'','2008-07-25 20:30:00','',''); insert into global_variables values ('THERMOSTAT_DEADBAND','255'); insert into global_variables values ('THERMOSTAT_HUM','31'); insert into global_variables values ('THERMOSTAT_MODE','Unknown'); insert into global_variables values ('THERMOSTAT_SP','-1'); insert into global_variables values ('THERMOSTAT_TEMP','68'); insert into macroheader values ('TSTAT_ALL_OFF','All Off',0,0,1); insert into macrodetail values ('TSTAT_ALL_OFF',1,38,'',0,'ph_insteon("THERMOSTAT",107,9)', 0,''); insert into macroheader values ('TSTAT_FAN_OFF','Turn Off House Fan',0,0,1); insert into macrodetail values ('TSTAT_FAN_OFF',1,38,'',0,'ph_insteon("THERMOSTAT",107,8)', 0,''); insert into macroheader values ('TSTAT_FAN_ON','Turn On House Fan',0,0,1); insert into macrodetail values ('TSTAT_FAN_ON',1,38,'',0,'ph_insteon("THERMOSTAT",107,7)',0 ,''); insert into macroheader values ('TSTAT_GETTSTAT_GLOBAL','Get Thermostat Data',0,0,1); insert into macrodetail values ('TSTAT_GETTSTAT_GLOBAL',1,31,'',NULL,'5',1,''); insert into macrodetail values ('TSTAT_GETTSTAT_GLOBAL',2,38,'',0,'ph_setglobal_a("THERMOSTAT_TEMP", (ph_insteonwithret("THERMOSTAT",107,3) / 2))',0,''); insert into macrodetail values ('TSTAT_GETTSTAT_GLOBAL',3,38,'',0,'ph_setglobal_a("THERMOSTAT_MODE", case(ph_insteonwithret("THERMOSTAT",107,2) when 0 then "Off" when 1 then "Heat" when 2 then "Cool" when 3 then "Auto" when 4 then "Fan" when 5 then "Program" when 6 then "Program Heat" when 7 then "Program Cool" else "Unknown"))',0,''); insert into macrodetail values ('TSTAT_GETTSTAT_GLOBAL',4,38,'',0,'ph_setglobal_a("THERMOSTAT_SP", ph_insteonwithret("THERMOSTAT",106,32) / 2)',0,''); insert into macrodetail values ('TSTAT_GETTSTAT_GLOBAL',5,38,'',0,'ph_setglobal_a("THERMOSTAT_HUM", ph_insteonwithret("THERMOSTAT",106,96))',0,''); insert into macrodetail values ('TSTAT_GETTSTAT_GLOBAL',6,38,'',0,'ph_setglobal_a("THERMOSTAT_DEADBAND", ph_insteonwithret("THERMOSTAT",106,64))',0,''); insert into macroheader values ('TSTAT_SETMODE_AUTO','Auto Mode',0,0,1); insert into macrodetail values ('TSTAT_SETMODE_AUTO',1,38,'',0,'ph_insteon("THERMOSTAT",107,6)',0,''); insert into macrodetail values ('TSTAT_SETMODE_AUTO',2,31,'',NULL,'2',0,''); insert into macrodetail values ('TSTAT_SETMODE_AUTO',3,1,'TSTAT_GETTSTAT_GLOBAL',0,'',0,'') ; insert into macroheader values ('TSTAT_SETMODE_COOL','Cool Mode',0,0,1); insert into macrodetail values ('TSTAT_SETMODE_COOL',1,38,'',0,'ph_insteon("THERMOSTAT",107,5)',0,''); insert into macrodetail values ('TSTAT_SETMODE_COOL',2,31,'',NULL,'2',0,''); insert into macrodetail values ('TSTAT_SETMODE_COOL',3,1,'TSTAT_GETTSTAT_GLOBAL',0,'',0,'') ; insert into macroheader values ('TSTAT_SETMODE_HEAT','Heat Mode',0,0,1); insert into macrodetail values ('TSTAT_SETMODE_HEAT',1,38,'',0,'ph_insteon("THERMOSTAT",107,4)',0,''); insert into macrodetail values ('TSTAT_SETMODE_HEAT',2,31,'',NULL,'2',0,''); insert into macrodetail values ('TSTAT_SETMODE_HEAT',3,1,'TSTAT_GETTSTAT_GLOBAL',0,'',0,'') ; insert into macroheader values ('TSTAT_SETMODE_PGM_AUTO','Program Auto Mode',0,0,1); insert into macrodetail values ('TSTAT_SETMODE_PGM_AUTO',1,38,'',0,'ph_insteon("THERMOSTAT",107,12)',0,''); insert into macrodetail values ('TSTAT_SETMODE_PGM_AUTO',2,31,'',NULL,'2',0,''); insert into macrodetail values ('TSTAT_SETMODE_PGM_AUTO',3,1,'TSTAT_GETTSTAT_GLOBAL',0,'',0 ,''); insert into macroheader values ('TSTAT_SETMODE_PGM_COOL','Cool Mode',0,0,1); insert into macrodetail values ('TSTAT_SETMODE_PGM_COOL',1,38,'',0,'ph_insteon("THERMOSTAT" ,107,11)',0,''); insert into macrodetail values ('TSTAT_SETMODE_PGM_COOL',2,31,'',NULL,'2',0,''); insert into macrodetail values ('TSTAT_SETMODE_PGM_COOL',3,1,'TSTAT_GETTSTAT_GLOBAL',0,'',0 ,''); insert into macroheader values ('TSTAT_SETMODE_PGM_HEAT','Program Heat Mode',0,0,1); insert into macrodetail values ('TSTAT_SETMODE_PGM_HEAT',1,38,'',0,'ph_insteon("THERMOSTAT",107,10)',0,''); insert into macrodetail values ('TSTAT_SETMODE_PGM_HEAT',2,31,'',NULL,'2',0,''); insert into macrodetail values ('TSTAT_SETMODE_PGM_HEAT',3,1,'TSTAT_GETTSTAT_GLOBAL',0,'',0 ,''); insert into macroheader values ('TSTAT_SP_DOWN','Current setpoint do 1 deg',0,0,1); insert into macrodetail values ('TSTAT_SP_DOWN',1,38,'',0,'ph_insteon("THERMOSTAT",105,2)', 0,''); insert into macrodetail values ('TSTAT_SP_DOWN',2,31,'',NULL,'2',0,''); insert into macrodetail values ('TSTAT_SP_DOWN',3,1,'TSTAT_GETTSTAT_GLOBAL',0,'',0,''); insert into macroheader values ('TSTAT_SP_UP','Current setpoint up 1 deg',0,0,1); insert into macrodetail values ('TSTAT_SP_UP',1,38,'',0,'ph_insteon("THERMOSTAT",104,2)',0, ''); insert into macrodetail values ('TSTAT_SP_UP',2,31,'',NULL,'2',0,''); insert into macrodetail values ('TSTAT_SP_UP',3,1,'TSTAT_GETTSTAT_GLOBAL',0,'',0,''); insert into timedevents values ('2008-04-20 10:34:34.000',5,0,'TSTAT_GETTSTAT_GLOBAL',0,'2008-04-20 10:34:34.000',0,0);