Skip to content

gediz/dehumidifier-dashboard

Repository files navigation

Dehumidifier Dashboard

A web-based dashboard for monitoring and controlling Tuya-powered dehumidifiers. Monitor humidity levels, view historical data, and control your device from any web browser on your local network.

demo.mp4

What It Does

This dashboard connects directly to your Tuya dehumidifier over your local network and provides:

  • Real-time monitoring of humidity, temperature, and device status
  • Historical charts showing trends over time (1 hour to 7 days)
  • Remote control of all device functions
  • Event logging of all state changes
  • Statistics and runtime tracking
  • Electricity cost calculation

All data is stored locally in a SQLite database, and the dashboard works without internet connectivity.

Requirements

  • Python 3.10 or higher
  • Node.js 18 or higher
  • Tuya-compatible dehumidifier on the same network
  • Linux, macOS, or Windows

Quick Start

1. Clone and Setup

 git clone https://github.com/gediz/dehumidifier-dashboard.git
cd dehumidifier-dashboard

2. Get Your Device Credentials

You need three pieces of information from your Tuya device:

  • Device ID
  • Device Local Key
  • Device IP address (optional, for faster connection)

See docs/TUYA_SETUP.md for step-by-step instructions on getting these credentials.

3. Configure

Copy the example environment file:

cp .env.example .env

Edit .env and add your device credentials (Device ID, Local Key, IP).

4. Install Dependencies

Backend:

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r backend/requirements.txt

Frontend:

cd frontend
npm install
cd ..

5. Set Password

Generate a secure password hash:

source venv/bin/activate  # On Windows: venv\Scripts\activate
python generate_password.py

Copy the generated hash to the PASSWORD field in your .env file.

6. Run

Open two terminal windows:

Terminal 1 - Backend:

./start-backend.sh

Or manually:

source venv/bin/activate
cd backend
python main.py

Backend will start on: http://localhost:8000

Terminal 2 - Frontend:

./start-frontend.sh

Or manually:

cd frontend
npm run dev

Frontend will start on: http://localhost:5173

7. Access the Dashboard

  1. Open browser to: http://localhost:5173
  2. Login with the password you used when generating the hash

Features

Dashboard Tab

Monitor live device status and control all functions:

  • Turn device on/off
  • Set target humidity (30-80%)
  • Adjust fan speed

Charts Tab

View historical data with interactive charts:

  • Humidity and temperature trends
  • Configurable time ranges (1h, 6h, 24h, 7 days)
  • Compare current vs target humidity

Events Tab

Track all device activity:

  • State changes (power, humidity, fan, etc.)
  • User actions highlighted separately
  • Full event history with timestamps
  • Filter by event type

Statistics Tab

Analyze device usage:

  • Average humidity and temperature
  • Total runtime hours
  • Energy consumption (kWh)
  • Electricity cost
  • View by period: today, week, month, all time

Technology

Backend:

  • Python with FastAPI
  • TinyTuya for local device control
  • SQLite for data storage
  • APScheduler for background polling
  • WebSocket for real-time updates

Frontend:

  • Svelte for reactive UI
  • Chart.js for visualization
  • Modern, responsive design

Why Local Control?

This dashboard uses TinyTuya to control your device directly over your local network:

  • No cloud API limits or quotas
  • Works without internet
  • Faster response times
  • Your data stays private
  • More reliable connection

Documentation

Tested Devices

  • Olefini OL12-BD023B

This dashboard should work with any Tuya-based dehumidifier. If you test it with another model, please let us know.

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome. Please feel free to submit issues or pull requests.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors