Just when I thought that I was understanding the IF condition, I ran into this issue. I have a light over our kitchen table that I want to come on only if it is dark enough outside. I have a program that tells me if the light level is low outside (using weatherbug). I have set the climate module to poll every 900 seconds or 15 minutes so that I not getting a status change every minute. I am using this program as a variable and would like to use it in other programs.
What I was expecting to happen was that the Kitchen Table Light would only come on between 5:50PM and 7:10PM if it was Dark Outside. If during that time frame the light level increased above 12, then the light would go out. Any time outside the time frame of 5:50PM to 7:10PM the light level could do what it wanted, but the Kitchen Table light would not come on. However, at 5:37PM this afternoon Program Dark Outside became true due to the light level dropping below 12, and my kitchen light came on very briefly, more of a flicker, and then went out again. In Program summary Last Run time of the Kitchen Table Light was 5:37:46 PM and Last Finish Time was the exactly the same. The Last Run and Last Finish Times for the Dark Outside were both 5:37:46 as well. It was that I did not expect the IF statement of Kitchen Table Light to execute as the schedule should have still been false at 5:37:46PM even though Dark Outside Program was true. Since the schedule was ANDed with Dark Outside the IF should have still been false until at 5:50PM.
Just to clarify, at 5:50PM the light did come on and stay on which was expected since the light level was still below 12. The light stayed on until 7:10PM when it went out as expected.
Any help would be much appreciated.
Program Dark Outside
If
Module 'Climate' Light < 12
Then
- No Actions - (To add one, press 'Action')
Else
- No Actions - (To add one, press 'Action')
Program Kitchen Table Light
If
From 5:50:00PM
To 7:10:00PM (same day)
And Program 'Dark Outside' is True
Then
Send X10 'D3/On (3)'
Else
Send X10 'D3/Off (11)'