Skip to content

snickerdoodle2/household

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HouseHold

About The Project

This code was developed as part of the project "A system for managing smart home infrastructure optimizing the consumption of natural resources." The project was undertaken as part of a Bachelor of Engineering degree at AGH University of Science and Technology (AGH UST).

The goal of the project was to create a smart home management system, allowing the easy optimisation of resource consumption and allowing the simple integration of customised devices. Based on user-defined policies and sensor input, the system is able to control effectors, increasing user comfort while reducing resource consumption. The basic components of the system are devices, a web-based client application, and a backend that acts as a server for the client application and a client for the devices.

The devices could be differentiated into sensors and effectors. Sensors provide data to the system in an active or passive manner. Passive sensors are queried by the system every user-defined time interval, while active sensors send data on their own. Effectors have a state that can be changed by the user. These devices could be either physical or virtual, running locally or in the cloud. The only requirement for the devices is to expose an appropriate API through which the backend communicates with them. Software templates for ESP-based boards are provided, as well as a virtual weather sensor server and a virtual sensor for solar installation data.

The application provides rule and sequence mechanisms. A rule is a logical expression based on the state of the sensors. When the expression is satisfied, the system automatically changes the state of an effector or executes a sequence. A sequence is a change of state of specific effectors, in a specific order, with an optional time interval in between. A sequence can be executed as an effect of a rule or can be manually triggered by the user. 

The web application, the frontend of the system, presents the data collected from the sensors in a clear and aesthetically pleasing way. The main page of the application displays graphs of the data collected in real time. Using a clear and intuitive interface, the user is able, among other things, to manage devices, create and manage sequences and rules, and receive notifications.

Conscious use of all the application's components gives the user the opportunity to create a personalized system, facilitating household management while reducing resource consumption. Creating your own devices and adding them to the system is intuitive and simple, and the ability to create your own rules and sequences allows you to automate everyday tasks.

Built With

  • Svelte
  • Bun
  • Tailwind CSS
  • Go
  • Docker
  • Just
  • Migrate
  • Postgres

Getting Started

Backend

Requirements

  1. golang 1.22
  2. docker
  3. just - github
  4. watchexec - github
  5. migrate cli - github

Setup

.env Configuration

Fill in the .env file:

DATABASE_ADDRESS=localhost:5432
POSTGRES_PASSWORD=<DB_PASSWORD>
POSTGRES_DB=<DB_NAME>
DATABASE_URL=postgresql://postgres:<DB_PASSWORD>@localhost:5432/<DB_NAME>?sslmode=disable

First run

  1. docker compose up -d
  2. just up
  3. just run

Frontend

Requirements

  1. bun - bun.sh

Setup

  1. bun install

Run

  1. bun run dev

Usage

The main page of the application displays tiles that provide latest device measurements. The base system functionalities are communication with IoT devices, running Sequences and evaluating Rules.

Devices

Sensors and effectors, which are external devices interacting with the system, can take any form. Their only requirement is to expose a REST API that is understood by the backend part of Household. This API can be exposed by Arduino boards managing any connected devices, "virtual" devices running as a server on a personal computer, in the cloud, or in any other way.

Creating new devices, adding them to the system and using of the ones provided with the system is described here.

Sequences

Changing the state of individual effectors in a specific order. Between subsequent state changes it is possible to introduce a delay.

Rules

In addition to the name and description, it has a logical condition and an effect. When the condition is fulfilled, an action is executed, which is the effect of the rule. This action can be a change of the state of the effector, or execution of a sequence.

License

Distributed under the CC BY-NC-SA 4.0. See LICENSE for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •