A web-based Smart Home simulation application built on Object-Oriented Programming (OOP) principles. This project models the management of various smart devices, tracks real-time energy consumption, and features an automatic network overload protection system.
- Centralized Control: The core
Electricityclass monitors the total energy consumption of all active devices in real-time. - Overload Protection: The system enforces a safety limit of 4000W. If consumption exceeds this threshold, a "Simulation Shutdown" is triggered to prevent damage.
- Load Visualization: Visual indicators for network load levels (0-3).
- Interactive Map: An SVG floor plan that visualizes the location and status of devices across different rooms.
- Device Control: A user-friendly web interface with modal windows for adding and configuring new devices.
- Filtering: Easily sort and view devices by room.
- State Preservation: Device states (On/Off, Brightness, Volume, Temperature) and the main switch status are saved to the browser's
LocalStorage. - Auto-Recovery: All settings are automatically restored when the page is reloaded, ensuring a seamless user experience.
- Core: JavaScript / TypeScript (Strong OOP focus)
- Frontend: HTML5, CSS3
- Storage: Browser LocalStorage API
The project utilizes a modular OOP architecture:
- Electricity Class: Manages the global state of the power grid and calculates total consumption.
- Device Classes:
Lighting: Controls brightness levels.SmartTv: Manages volume and channel selection.Freezer: Regulates temperature settings.- Other devices inherit basic consumption and state logic from the parent class.
You can view the working version of the project here:: 🔗 Open Smart Home Simulation