patrickm Senior Member
Joined: February 22 2007 Location: United States
Online Status: Offline Posts: 188
|
Posted: September 29 2010 at 20:04 | IP Logged
|
|
|
Pete,
Here are the two macros that ran.
insert into macroheader values ('SPRINKLER AUTO PROG 5_2','sprinkler auto prog 5',0,0,1);
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',1,10,'ACTIVE_SPRINKLER_PROG',NULL,'"SPRINKLER AUTO PROG 5_2"',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',2,1,'CHECK_SPRINKLER_CONDITION',0,'',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',3,27,'',NULL,'if(({RUN_SPRINKLERS}= 1), "RUN", "SKIP")',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',4,26,'',NULL,'RUN',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',5,36,'',NULL,'"Run Sprinkler Program"',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',6,38,'',0,'ph_writefile("{SPRINKLERLOG}",0, string( today(), "mm/dd/yy hh:mm:ss") + " " + string((((integer(ph_getanalog("WATER PRESSURE 1")) / 10) - 0.5) / 4) * 150) + " PSI" + char(13) + char(10))',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',7,38,'',0,'ph_writefile("{SPRINKLERLOG}",0, "Z1 {SPRINK ZONE 1 DURATION} min" + char(13) + char(10))',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',8,38,'',0,'ph_insteon("ezrain", 64, 00)',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',9,36,'',NULL,'"Sprinkler Zone 1 ON"',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',10,31,'',NULL,'60',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',11,38,'',0,'ph_writefile("{SPRINKLERLOG}",0, string( today(), "mm/dd/yy hh:mm:ss") + " " + string((((integer(ph_getanalog("WATER PRESSURE 1")) / 10) - 0.5) / 4) * 150) + " PSI" + char(13) + char(10))',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',12,31,'',NULL,'60 * {SPRINK ZONE 1 DURATION}',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',13,36,'',NULL,'"Sprinker Zone 1 OFF"',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',14,38,'',0,'ph_insteon("ezrain", 65, 00)',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',15,31,'',NULL,'{SPRINKLER VALVE DELAY}',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',16,38,'',0,'ph_writefile("{SPRINKLERLOG}",0, "Z2 {SPRINK ZONE 2 DURATION} min" + char(13) + char(10))',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',17,38,'',0,'ph_insteon("ezrain", 64, 01)',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',18,36,'',NULL,'"Sprinkler Zone 2 ON"',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',19,31,'',NULL,'60',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',20,38,'',0,'ph_writefile("{SPRINKLERLOG}",0, string( today(), "mm/dd/yy hh:mm:ss") + " " + string((((integer(ph_getanalog("WATER PRESSURE 1")) / 10) - 0.5) / 4) * 150) + " PSI" + char(13) + char(10))',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',21,31,'',NULL,'60 * {SPRINK ZONE 2 DURATION}',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',22,36,'',NULL,'"Sprinker Zone 2 OFF"',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',23,38,'',0,'ph_insteon("ezrain", 65, 01)',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',24,31,'',NULL,'{SPRINKLER VALVE DELAY}',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',25,38,'',0,'ph_writefile("{SPRINKLERLOG}",0, "Z3 {SPRINK ZONE 3 DURATION} min" + char(13) + char(10))',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',26,38,'',0,'ph_insteon("ezrain", 64, 02)',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',27,36,'',NULL,'"Sprinkler Zone 3 ON"',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',28,31,'',NULL,'60',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',29,38,'',0,'ph_writefile("{SPRINKLERLOG}",0, string( today(), "mm/dd/yy hh:mm:ss") + " " + string((((integer(ph_getanalog("WATER PRESSURE 1")) / 10) - 0.5) / 4) * 150) + " PSI" + char(13) + char(10))',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',30,31,'',NULL,'60 * {SPRINK ZONE 3 DURATION}',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',31,36,'',NULL,'"Sprinker Zone 3 OFF"',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',32,38,'',0,'ph_insteon("ezrain", 65, 02)',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',33,31,'',NULL,'{SPRINKLER VALVE DELAY}',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',34,38,'',0,'ph_writefile("{SPRINKLERLOG}",0, "Z4 {SPRINK ZONE 4 DURATION} min" + char(13) + char(10))',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',35,38,'',0,'ph_insteon("ezrain", 64, 03)',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',36,36,'',NULL,'"Sprinkler Zone 4 ON"',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',37,31,'',NULL,'60',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',38,38,'',0,'ph_writefile("{SPRINKLERLOG}",0, string( today(), "mm/dd/yy hh:mm:ss") + " " + string((((integer(ph_getanalog("WATER PRESSURE 1")) / 10) - 0.5) / 4) * 150) + " PSI" + char(13) + char(10))',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',39,31,'',NULL,'60 * {SPRINK ZONE 4 DURATION}',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',40,36,'',NULL,'"Sprinker Zone 4 OFF"',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',41,38,'',0,'ph_insteon("ezrain", 65, 03)',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',42,31,'',NULL,'{SPRINKLER VALVE DELAY}',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',43,38,'',0,'ph_writefile("{SPRINKLERLOG}",0, "Z5 {SPRINK ZONE 5 DURATION} min" + char(13) + char(10))',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',44,38,'',0,'ph_insteon("ezrain", 64, 04)',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',45,36,'',NULL,'"Sprinkler Zone 5 ON"',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',46,31,'',NULL,'60',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',47,38,'',0,'ph_writefile("{SPRINKLERLOG}",0, string( today(), "mm/dd/yy hh:mm:ss") + " " + string((((integer(ph_getanalog("WATER PRESSURE 1")) / 10) - 0.5) / 4) * 150) + " PSI" + char(13) + char(10))',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',48,31,'',NULL,'60 * {SPRINK ZONE 5 DURATION}',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',49,36,'',NULL,'"Sprinker Zone 5 OFF"',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',50,38,'',0,'ph_insteon("ezrain", 65, 04)',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',51,31,'',NULL,'{SPRINKLER VALVE DELAY}',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',52,38,'',0,'ph_writefile("{SPRINKLERLOG}",0, "Z6 {SPRINK ZONE 6 DURATION} min" + char(13) + char(10))',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',53,38,'',0,'ph_insteon("ezrain", 64, 05)',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',54,36,'',NULL,'"Sprinkler Zone 6 ON"',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',55,31,'',NULL,'60',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',56,38,'',0,'ph_writefile("{SPRINKLERLOG}",0, string( today(), "mm/dd/yy hh:mm:ss") + " " + string((((integer(ph_getanalog("WATER PRESSURE 1")) / 10) - 0.5) / 4) * 150) + " PSI" + char(13) + char(10))',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',57,31,'',NULL,'60 * {SPRINK ZONE 6 DURATION}',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',58,36,'',NULL,'"Sprinker Zone 6 OFF"',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',59,38,'',0,'ph_insteon("ezrain", 65, 05)',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',60,31,'',NULL,'{SPRINKLER VALVE DELAY}',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',61,38,'',0,'ph_writefile("{SPRINKLERLOG}",0, "Z7 {SPRINK ZONE 7 DURATION} min" + char(13) + char(10))',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',62,38,'',0,'ph_insteon("ezrain", 64, 06)',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',63,36,'',NULL,'"Sprinkler Zone 7 ON"',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',64,31,'',NULL,'60',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',65,38,'',0,'ph_writefile("{SPRINKLERLOG}",0, string( today(), "mm/dd/yy hh:mm:ss") + " " + string((((integer(ph_getanalog("WATER PRESSURE 1")) / 10) - 0.5) / 4) * 150) + " PSI" + char(13) + char(10))',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',66,31,'',NULL,'60 * {SPRINK ZONE 7 DURATION}',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',67,38,'',0,'ph_insteon("ezrain",65, 06)',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',68,36,'',NULL,'"Sprinkler Zone 7 OFF"',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',69,10,'ACTIVE_SPRINKLER_PROG',NULL,'""',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',70,10,'SPRINKLER_STATUS',NULL,'1',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',71,16,'',NULL,'6',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',72,26,'',NULL,'SKIP',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',73,16,'',NULL,'if(({SPRINKER_ENABLE} = 1), 1, 999)',1,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',74,36,'',NULL,'"Skip Sprinkler Program"',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',75,10,'SPRINKLER_STATUS',NULL,'1',0,'');
insert into macrodetail values ('SPRINKLER AUTO PROG 5_2',76,38,'',NULL,'ph_writefile("{SPRINKLERLOG}",1, string( today(), "mm/dd/yy hh:mm:ss") + char(13) + char(10) + "The past 24hr rainfall was {VWS_RAIN_24} inches." + char(13) + char(10) + "Sprinklers were disabled.")',1,'');
Here is the sub macro
insert into macroheader values ('CHECK_SPRINKLER_CONDITION','check sprinkler conditions',0,0,1);
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',1,27,'',NULL,'if(( {SPRINKER_ENABLE} = 1), "CHECK_CONDITIONS", "NOT_ENABLED")',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',2,26,'',NULL,'CHECK_CONDITIONS' ,0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',3,36,'',NULL,'"Check Sprinkler Conditions"',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',4,40,'',NULL,'"GET_LAST24HR_RAI N"',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',5,40,'',NULL,'"VWS_READ"',0,'') ;
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',6,40,'',NULL,'"GET_SOIL_MOISTUR E"',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',7,36,'',NULL,'"Check soil moisture"',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',8,36,'',NULL,'"The soil moisture in Zone 1 is {VWS_SOIL_MOISTURE_1}cB and in Zone 2 is {VWS_SOIL_MOISTURE_2}cB."',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',9,27,'',NULL,'if(({VWS_SOIL_MOI STURE_1} < {SOIL_MOISTURE_THRESHOLD_1}) and ({VWS_SOIL_MOISTURE_2} < {SOIL_MOISTURE_THRESHOLD_2}), "ENOUGH_SOIL_MOISTURE", "CHECK_24HR_RAIN")',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',10,26,'',NULL,'ENOUGH_SOIL_MOIS TURE',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',11,36,'',NULL,'"The soil moisture in Zone 1 is {VWS_SOIL_MOISTURE_1}cB and in Zone 2 is {VWS_SOIL_MOISTURE_2}cB. Sprinklers are disabled."',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',12,38,'',0,'ph_writefile("{SPRI NKLERLOG}",1, string( today(), "mm/dd/yy hh:mm:ss") + char(13) + char(10) + "The soil moisture was" + char(13) + char(10) + "Zone 1 {VWS_SOIL_MOISTURE_1}cB < {SOIL_MOISTURE_THRESHOLD_1}cB" + char(13) + char(10) + "Zone 2 {VWS_SOIL_MOISTURE_2}cB < {SOIL_MOISTURE_THRESHOLD_2}cB" + char(13) + char(10) + "Sprinklers were disabled.")',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',13,27,'',NULL,'"SKIP"',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',14,26,'',NULL,'CHECK_24HR_RAIN' ,0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',15,38,'',0,'ph_writefile("{SPRI NKLERLOG}",1, string( today(), "mm/dd/yy hh:mm:ss") + char(13) + char(10) +"The ambient temp was {VWS_OUTTEMP}F" + char(13) + char(10) + "The soil moisture was" + char(13) + char(10) + "Zone 1 {VWS_SOIL_MOISTURE_1}cB" + char(13) + char(10) + "Zone 2 {VWS_SOIL_MOISTURE_2}cB" + char(13) + char(10))',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',16,36,'',NULL,'"Check last 24hr rainfall"',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',17,36,'',NULL,'"The past 24hr rainfall was {VWS_RAIN_24} inches."',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',18,27,'',NULL,'if(({VWS_RAIN_24 } > {SPRINKLER_RAIN_THRESHOLD}), "ENOUGH_RAIN", "CHECK_WIND")',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',19,26,'',NULL,'ENOUGH_RAIN',0,' ');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',20,36,'',NULL,'"The past 24hr rainfall was {VWS_RAIN_24} inches. Sprinklers are disabled."',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',21,38,'',0,'ph_writefile("{SPRI NKLERLOG}",1, string( today(), "mm/dd/yy hh:mm:ss") + char(13) + char(10) + "The past 24hr rainfall was {VWS_RAIN_24} inches." + char(13) + char(10) + "Sprinklers were disabled.")',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',22,27,'',NULL,'"SKIP"',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',23,26,'',NULL,'CHECK_WIND',0,'' );
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',24,36,'',NULL,'"check wind conditions"',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',25,36,'',NULL,'"The wind speed is {VWS_WINDSPEED}kts with gusts to {VWS_WINDGUST}kts."',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',26,38,'',0,'ph_writefile("{SPRI NKLERLOG}",0,"The wind speed was {VWS_WINDSPEED}kts" + char(13) + char(10) + "with gusts to {VWS_WINDGUST}kts." + char(13) + char(10))',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',27,27,'',NULL,'if(({VWS_WINDSPE ED} < {SPRINKLER_WIND_THRESHOLD} or {VWS_WINDGUST} < {SPRINK_WINDGUST_THRESHOLD}), "RUN", "TOO_WINDY")',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',28,26,'',NULL,'TOO_WINDY',0,'') ;
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',29,36,'',NULL,'"The wind speed is {VWS_WINDSPEED}kts with gusts to {VWS_WINDGUST}kts. Sprinklers are disabled."',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',30,38,'',0,'ph_writefile("{SPRI NKLERLOG}",1, string( today(), "mm/dd/yy hh:mm:ss") + char(13) + char(10) + "The wind speed was {VWS_WINDSPEED}kts" + char(13) + char(10) + "with gusts to {VWS_WINDGUST}kts." + char(13) + char(10) + "Sprinklers were disabled.")',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',31,26,'',NULL,'SKIP',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',32,16,'',NULL,'if(({SPRINKER_EN ABLE} = 1), 1, 999)',1,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',33,10,'RUN_SPRINKLERS',NULL,'0' ,0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',34,10,'SPRINKLER_STATUS',NULL,' 1',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',35,38,'',NULL,'ph_writefile("{S PRINKLERLOG}",1, string( today(), "mm/dd/yy hh:mm:ss") + char(13) + char(10) + "The past 24hr rainfall was {VWS_RAIN_24} inches." + char(13) + char(10) + "Sprinklers were disabled.")',1,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',36,16,'',NULL,'999',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',37,26,'',NULL,'NOT_ENABLED',0,' ');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',38,36,'',NULL,'"Sprinklers are manually disabled."',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',39,10,'SPRINKLER_STATUS',NULL,' 0',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',40,10,'RUN_SPRINKLERS',NULL,'0' ,0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',41,16,'',NULL,'999',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',42,26,'',NULL,'RUN',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',43,36,'',NULL,'"Sprinkler run conditions OK"',0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',44,10,'RUN_SPRINKLERS',NULL,'1' ,0,'');
insert into macrodetail values ('CHECK_SPRINKLER_CONDITION',45,10,'SPRINKLER_STATUS',NULL,' 1',0,'');
This has run without issue for at least 3 or 4 years.
-Patrick
|