| ECS-L Home Automation and Security Archives |
| Subject: From: Date: | RE: [ECS] Another beginif question Kevin Keast Sat, 25 Nov 2000 21:39:52 -0500 |
Hi Joe, You are correct. I wasn't not reading your code correctly and wrote my reply hastily. One thing I would note with this code is that if you turned any of your lights off using an x-10 command the system would turn them right back on if your conditions were all true. Sorry about confusing you more than you probably were. Kevin -----Original Message----- From: Joseph LaFerla [mailto:jlafe@ntnet.nt.ca] Sent: Tuesday, November 21, 2000 11:05 PM To: ecs-list@netbloc.com Subject: RE: [ECS] Another beginif question Why would it send continuous commands? I thought that by putting "if the light is off, turn it on" would only turn it on if it was off. I am obviously missing something here. What I am trying to do is that if a light is turned off by another section of code somewhere else it would be turned on again. Using IS NOW negates that, if I understand how it works. -----Original Message----- From: Kevin Keast [mailto:libertyc@prodigy.net] Sent: November 21, 2000 8:45 PM To: ecs-list@netbloc.com Subject: RE: [ECS] Another beginif question The BeginIf applies to the ands as well. But in your code you need to be careful: The code you have below could continuously send ON commands to your lights. ECS will check these conditions every event pass and act accordingly. You may have to break this code up into segments using IS NOW For Example BeginIF Evening is now true And at home is true And awake is true And dusk is true........ The prevents sending continuous commands to lights- a bad thing for your X10 system. With the above code you would need to do other instances keying of when at home, awake, and dusk change to true using IS NOW. There may be a more efficient way and if there is you will probably see it posted. Good Luck Kevin -----Original Message----- From: Joseph LaFerla [mailto:jlafe@ntnet.nt.ca] Sent: Tuesday, November 21, 2000 8:05 PM To: Ecs-List (E-mail) Subject: [ECS] Another beginif question Hi all I have another beginif question and I apologize right away if it has been asked before! I have the following code: BEGINIF Evening Is True And At home Is True And Awake Is True And Dusk Is True If Living room floor lamp Is Off Then Living room floor lamp Set On If Fireplace track light Is Off Then Fireplace track light Set On If Stereo track light Is Off Then Stereo track light Set On ENDIF The idea is that I want to code the following. I want to turn on or off lights depending on evening, at home, awake and dusk all being true. Does the beginif at the beginning incorporate the "ands" or not or does a beginif stand on its own? Thanks in advance. Joe