Skip to content

Latest commit

Β 

History

History
87 lines (66 loc) Β· 3.35 KB

File metadata and controls

87 lines (66 loc) Β· 3.35 KB

Domus Control - Home Assistant

Smart device management system developed as part of the Object-Oriented Programming (OOP) course at the University of Minho (2025/2026).

Domus Control allows users to manage their smart homes, organizing them into divisions and associating various types of connected devices, with support for automations, scenarios, and time-based scheduling.

πŸš€ Key Features

  • Entity Management: Creation and management of Users, Houses, Divisions, and Devices.
  • Device Hierarchy: Support for Lamps, Smart Plugs, Curtains, Speakers, Garage Gates, and Sensors (Light and Water).
  • Automation Engine: Configuration of rules based on conditions (e.g., detecting rain or low light) that trigger automatic actions.
  • Scenarios: Execution of predefined sets of actions (e.g., "Movie Mode", "Leaving Home").
  • Schedules: Scheduling of one-time or time-interval actions.
  • Data Persistence: Saving and loading the application's full state through object serialization.
  • Statistics: Analysis of energy consumption, most-used devices, and divisions with the highest hardware density.

πŸ› οΈ Technologies Used

  • Language: Java (JDK 17 or higher).
  • Unit Testing: JUnit 5.
  • Build Management: Makefile.
  • Documentation: Javadoc.

πŸ—οΈ System Architecture

The project follows the MVC (Model-View-Controller) pattern to ensure separation of concerns:

  • Model: Base entities and business logic (User, House, Device, Automation).
  • View: Interactive command-line interface (CLI) with ANSI color support and dynamic dashboards.
  • Controller: DomusControl central class that acts as a facade for state management and rule execution.

Applied OOP Concepts:

  • Encapsulation: Private attributes with access through public methods and "Most Qualified Class" principles.
  • Inheritance and Polymorphism: Abstract hierarchy of devices and actions.
  • Abstraction: Use of interfaces for conditions and abstract classes for base components.

πŸ§ͺ Testing and Robustness

The project includes a suite of 153 unit tests with a 100% success rate, covering:

  • Model and controller logic.
  • Automation engine and complex rules.
  • Interface and input validation.
  • Stress Tests: Verification of resilience with 5,000 users, 500 houses, 1000 divisons and 5,000 devices, along with memory leak testing and fuzzing with giant strings.

πŸ“‹ How to Run

Ensure you have Java installed.

  1. Compile the project:
make compile

Run the application:

make run

Run tests:

make test

πŸ“ Directory Structure

.
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”œβ”€β”€ automacao/    # Rule logic, scenarios, and schedules
β”‚   β”‚   β”œβ”€β”€ controller/   # DomusControl Facade
β”‚   β”‚   β”œβ”€β”€ Exceptions/   # Custom exceptions
β”‚   β”‚   β”œβ”€β”€ model/        # Domain entities
β”‚   β”‚   └── view/         # CLI Interface and Menu
β”‚   └── test/             # JUnit 5 test suite
β”œβ”€β”€ bin/                  # Compiled files
β”œβ”€β”€ lib/                  # External libraries (JUnit)
β”œβ”€β”€ Makefile              # Task automation
└── README.md

πŸ‘₯ Authors - Group 8 Carlos Martins (A109507)

Diogo Vieira (A109744)

TomΓ‘s Machado (A104186)

Project developed for the Object-Oriented Programming course - University of Minho.