The Smart Home System is a Java-based application that simulates a smart home system, allowing us to control various smart devices such as lights, thermostats, and door locks via a central hub. Users can set schedules, automate tasks, view device status & reports, and manage triggers.
Java (JDK-20)
- Clone the repository
git clone https://github.com/deveshparmar/Educational_Initiatives.git
- Compile the project
javac src/SmartHomeSystem/*.java src/SmartHomeSystemExceptions/*.java
- Run the Main.java (Entry Point)
java -cp src Main
src/- Source code directorySmartHomeSystem/- Main package for the applicationDevice.java- Interface representing smart home devicesDeviceFactory.java- Factory class for creating devicesDeviceObserver.java- Interface for observing device updatesDeviceProxy.java- Proxy class for device accessLight.java- Class representing light devicesThermostat.java- Class representing thermostat devicesDoor.java- Class representing door devicesSmartHomeHub.java- Main smart home hub classTrigger.java- Class for defining automation triggersSchedule.java- Class for defining schedule for devicesMain.java- Application entry point
SmartHomeSystemExceptions/- Package for custom exceptionsUnsupportedActionException.java- Custom exception for unsupported actionsInvalidTriggerException.java- Custom exception for invalid triggersUnauthorizedAccess- Custom exception for unauthorized access of device
- Initialize the Smart Home System with different devices, each having a unique ID and type (light, thermostat, door lock).
- Turn devices on/off.
- Schedule devices to turn on/off at a particular time.
- Automate tasks based on triggers.
- Add and remove devices dynamically.
- Custom exceptions for handling unsupported actions and invalid trigger conditions.
- Logging for each component activity


