Smart home app & server solution for lighting, curtain control, sunrise/sunset tracking, and automated environment-based controls.
🎥 View Demo
·
🐞 Report Bug
·
💬 Request Feature
🗂️ Table of Contents 🗂️
<<사진2개>>
With the recent development of smart home technology, it has become possible to effectively manage and automate lighting and curtain systems in the home. More and more users want to utilize these technologies for a more convenient life. In addition, there is a growing interest in environmental and energy conservation, and there is a growing need for an automatic control system to support it.
The Mr. Sunshine project encompasses the following key functionalities:
-
Login: Users can log in to the app using their Google accounts.
-
Sunrise and Sunset Time Check: Users can conveniently check sunrise and sunset times on the initial screen.
-
Room Registration: Users have the ability to register rooms, which can contain various devices such as LED lights, curtains, and light sensors.
-
Device Registration: Multiple devices can be registered within each room.
-
Device Control: Users can register and control LED devices, adjusting brightness from 0 (off) to 100 (maximum brightness). Similarly, curtain devices can be registered and controlled, managing the curtain openness from 0 (closed) to 100 (fully open).
-
Room-Wide Device Control: Users can control all registered control-related devices (LED lights and curtains) within a room collectively.
-
Auto Mode: Auto mode relies on light sensors (minimum one for LED, curtain, and light) that periodically send light sensor values to the server. The server then compares these values with predefined thresholds. If the light sensor value falls below or exceeds the threshold, the server automatically adjusts the registered devices (LED lights and curtains) within the room to match the desired light level, aligning it with the predefined threshold.
This project uses IoT devices (LED, curtains, sensors) and MQTT for device control and sensor data transmission, while user-server interactions occur over HTTP. The server handles user control requests, AUTO mode, and device registrations, controlling IoT devices through MQTT.
🖼️ Database ERD 🖼️
*changeInitially, we set a deviceValue as an anttribute of a device class. but In this case, it is dangerous by it can be used as two meaning. So, we seperated it as a class.
Category | Technology |
---|---|
Application | |
Server | |
Deployment | |
Database | |
IoT Device | |
Development Environment | |
Collaborative Software |
Our project was developed in an Apple Silicon environment, which provided us with advanced computing capabilities and efficiency. Here are the details:
- Platform: Apple Silicon (M1, M1 Pro, M1 Max, or later)
- Operating System: macOS Big Sur or later
- Memory: 8GB RAM or more
- Storage: 256GB SSD or higher
We recommend using a similar Apple Silicon-based environment for development to ensure compatibility
For setting up the client device in this project, you will need the following hardware components:
- Raspberry Pi 4 4GB(+@): The core computing unit for the kiosk.
- MicroSD Card with webOS Image: Use a microSD card loaded with the webOS image to boot the Raspberry Pi. For this project, we have used the pre-built webOS OSE 2.24.0 image for Raspberry Pi 4, which can be downloaded from here. Additionally, if you need guidance on flashing the webOS Open Source Edition to your microSD card, please refer to flashing webos-ose guide for detailed instructions.
- Touchscreen or Monitor: A display unit to interact with the kiosk. A touchscreen is preferred for a more interactive experience.
we use this - Webcam: An essential component for facial recognition or other interactive features. Ensure compatibility with the Raspberry Pi.
- Optional Input Devices: Devices like a mouse and keyboard for initial setup and troubleshooting.
- Power Supply and Cables: A suitable power supply for the Raspberry Pi and screen, along with necessary cables such as HDMI for connectivity.
Ensure that you have all these components available before proceeding with the setup of your client device for the signage solution project.
This guide will help you set up and run the project in your local environment. Follow these steps to get started.
Note: This guide is tailored for a setup on a single local PC. It can also be adapted for multi-server environments, accommodating both centralized and distributed systems efficiently.
Note: For effective data processing, we recommend hosting both the Flask application and database on the same system. This setup reduces latency and improves operational efficiency, especially for large, user-specific models.
The process for installing and setting up the project is as follows. This template does not rely on any external dependencies or services.
- Clone the repository.
git clone /~https://github.com/noFlowWater/signage_solution.git
- Move into the cloned directory.
cd signage_solution
After cloning and moving into the directory, you will find three folders in the project directory:
react
, flask
, nodejs
.
Proceed with the project in the following order:
- First, Get Start for Kiosk API Server & Init Database
- Then, Get Start for Face Authentication Server
- Finally, Get Start for React for Deploy to webOS Client Device
Each step is detailed in the README.md
file of the respective folder, allowing you to sequentially progress and gather the necessary information.
스크린샷 ㄱㄱ 아님 실사진.
We are largely divided into databases, api, and middleware, and the database directory is divided into a schema and a model created using the schema. api is classified according to its function, and middleware has an error handler for error processing.
dependencies
"axios": "^1.6.5" => use to open API Weather Source
"dotenv": "^16.3.1" => load .env File
"express": "^4.18.2" => to use express.js
"express-session": "^1.17.3" => to use express-session
"moment": "^2.30.1" => to calculate on Date
"mongoose": "^8.0.4" => connect with mongoDB
"mqtt": "^5.3.4" => communication with IOT by MQTT protocol
"uuid": "^9.0.1" => use UUID for Database
We used mongoDB. Since the project had to be carried out within a short period of time, it was decided to use the NOSQL database in anticipation of many changes within the project, and among them, mongoDB with good fluidity and scalability was decided to use. An Object Data Mapping (ODM) library called mongoose was used to connect Node.js and mongoDB.
Connect.js is executed before execution in app.js, which helps MongoDB proceed. Even if it is executed in duplicate, there is no concern about error occurrence because express.js avoids duplicate connections.
Login is executed with the above logic.
It provides users who use Google OAuth with convenient and no additional membership registration is required.
근찬씨 작성 레스고~