After using the sensors in the kitchen along with the weather for a while, we noticed that the weather information was not the most up to date which meant that the lights would not be turned on or off correctly.

I did some digging into it and found the following Light & Motion Sensor which records the level of light in a particular room. This gave me an idea- If I use the sensor to measure the level of light in the room, then I can use that to see if the lights needed to be turned on or off.

I wrote the following code to measure the level of light in the room, and stored it in a variable:

Then I asked mom what level of light in the room needed the lights to be turned on, and found out that the sensor value was 20. So if the value from the sensor is less then 20 then Mom needed the kitchen lights on.

I also had to modify the kitchen routine to take account of the light level and not the weather and modified the code to be the following:

So now the kitchen lights are based on the level of light and we do not need to worry about the old code anymore.