Hi Everyone,
I’ve been using the Time Of Day Design Pattern for some time now, using to switch on and off lights at the right time of day for example.
Now that I’m getting a little more confident in how rules are implemented I’d like to clean up an issue I have at present, from using this design pattern.
In my living room I have four light sources, ceiling, floor lamp, table lamp and some fancy twig lights. The ceiling lights are rarely used so out of the equation for now. Using the design pattern and additional inputs from my TV and Illumination sensor I have a good control over the lights, when the light dims and the TV is on the lights become brighter as it gets darker.
To achieve this I check to see if it currently DAY or EVENING then check that the Lux level is below 100. This works great for when it’s getting darker, however as a consequence I have found that because the same reads true in the morning, my Living Room lights are on first thing in the morning. This is because the time of day is DAY and the Lux level is below 100.
Has anyone else found this sort of problem previously and cleverly resolved it? I’m looking for ideas, as I can’t think of a viable solution that works.
Thanks for your help and advise.