| krommetje Super User
 
  
  
 Joined: December 29 2004
 Location: Netherlands
 Online Status: Offline
 Posts: 695
 | 
          Hey guys,
           | Posted: October 22 2006 at 18:35 | IP Logged |   |  
           | 
 |  
 i'd like your opinion about a project i've been working on:
 
 a Powerhome Thermostat for my central heating:
 
 here is the SQL for testing the time:
 
 
 
| Code: 
 
    
    | 
      
       | insert into macroheader values ('THERMOSTAT-TIME','THERMOSTAT-TIME',0,0,1);
 insert into macrodetail values ('THERMOSTAT-TIME',1,38,'',NULL,'if( hour( now()) >= 23 or hour( now()) <= 5, 1, 999)',0,'');
 insert into macrodetail values ('THERMOSTAT-TIME',2,26,'',NULL,'1',0,'');
 insert into macrodetail values ('THERMOSTAT-TIME',3,1,'THERMOSTAT OFF',0,'',0,'');
 insert into macrodetail values ('THERMOSTAT-TIME',4,39,'',NULL,'',0,'');
 insert into macrodetail values ('THERMOSTAT-TIME',5,26,'',NULL,'999',0,'');
 insert into macrodetail values ('THERMOSTAT-TIME',6,1,'THERMOSTAT-TEST',0,'',0,'');
 insert into macrodetail values ('THERMOSTAT-TIME',7,39,'',NULL,'',0,'');
 
 |  |  |  
 and here is the sql for testing the temperarures:
 
 
 
| Code: 
 
    
    | 
      
       | insert into macroheader values ('THERMOSTAT-TEST','THERMOSTAT-TEST',0,0,1);
 insert into macrodetail values ('THERMOSTAT-TEST',1,36,'',NULL,'"{SENSOR1}"',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',2,27,'',NULL,'if({SENSOR1} > 2500,"OK","NEXT")',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',3,26,'',NULL,'OK',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',4,36,'',NULL,'"Inside Temp. Measures {SENSOR1}"',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',5,36,'',NULL,'"Shutting down Thermostat"',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',6,23,'K6',3,'',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',7,36,'',NULL,'"Thermostat switched off"',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',8,39,'',NULL,'',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',9,26,'',NULL,'NEXT',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',10,36,'',NULL,'"Inside Temp. Measures {SENSOR1}"',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',11,36,'',NULL,'"Outside Temp. Measures {CURTEMPA}"',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',12,27,'',NULL,'if ({CURTEMPA} < 10, "NEXT1", "NEXT2")',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',13,39,'',NULL,'',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',14,26,'',NULL,'NEXT1',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',15,23,'K6',2,'',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',16,36,'',NULL,'"Switching ON thermostat"',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',17,39,'',NULL,'',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',18,26,'',NULL,'NEXT2',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',19,27,'',NULL,'if({SENSOR1} > 2000,"OK","NEXT")',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',20,27,'',NULL,'if({SENSOR1} < 2000,"NEXT1","END")',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',21,26,'',NULL,'END',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',22,36,'',NULL,'"Temperature within specified parameters"',0,'');
 insert into macrodetail values ('THERMOSTAT-TEST',23,39,'',NULL,'',0,'');
 
 |  |  |  
 Some explanation:
 
 - The GV {SENSOR1} is the Temparature in the house.
 - The GV {CURTEMPA} is the outside temperature.
 
 Basicly this consist of 4 macros:
 
 Thermostat-time  (the macro for checking time)
 thermostat-test  (the actual temperature checking)
 Thermostat-on    (an On-Macro)
 thermostat-off   (an Off-Macro)
 
 The macro Thermostat-Time calls the other 3 macros when needed, so this will be run every 15 minutes.
 
 Basicly in the thermostat-line a relay has been put in that cuts-off or connects the elektronic thermostat (already in use) to the heating-system...
 
 What do you think of this?
 
 Peter
 
 Edited by krommetje - October 22 2006 at 18:41
 |