A smart home is an automated house where different operations are driven by sensor data. Door switches, temperature and PIR sensors are just a few inputs for the system and switching lights, fans, heating on and off are few outputs what data can trigger. A smart home can have a simple operation but also very complex ones and AI involved algorithms in making inhabitant lives comfortable and convenient.
You need to create a simple sensor system which monitors the front door and people presence in the rooms. Based on sensor data you need to switch lights on and off. It is vital to deal also with delays that the switching lights off are not disturbing for persons in the rooms.
Running your code:
Saving your code: