Decision Support System (DSS) untuk Monitoring dan Analisis Penggunaan Listrik Rumah Tangga dengan Fuzzy Logic
Features • Screenshots • Tech Stack • Installation • Usage • API Documentation
Voltify adalah aplikasi web Decision Support System (DSS) yang membantu pengguna menganalisis dan mengoptimalkan penggunaan listrik rumah tangga. Sistem ini menggunakan Fuzzy Logic untuk mengklasifikasikan pola penggunaan listrik menjadi kategori Hemat, Normal, atau Boros, serta memberikan rekomendasi untuk penghematan energi.
- Membantu pengguna memantau konsumsi listrik harian
- Memberikan analisis otomatis menggunakan Fuzzy Logic
- Menyediakan visualisasi data dalam bentuk grafik
- Memberikan rekomendasi penghematan energi
- Mengestimasi biaya listrik bulanan
- ✅ Tambah, lihat, dan hapus alat elektronik
- ✅ Input spesifikasi: Nama, Daya (Watt), Jam Pemakaian, Kategori
- ✅ Perhitungan otomatis kWh per hari
- ✅ Klasifikasi penggunaan: Hemat / Normal / Boros
- ✅ Fuzzy Score (0-100)
- ✅ Membership values visualization
- ✅ Rekomendasi berdasarkan kategori
- ✅ Total penggunaan kWh
- ✅ Total biaya listrik
- ✅ Rata-rata harian
- ✅ Estimasi bulanan
- ✅ Breakdown kategori (Hemat/Normal/Boros)
- ✅ Line Chart & Bar Chart
- ✅ Tracking penggunaan 7/14/30 hari
- ✅ Grafik biaya dan konsumsi
- ✅ Lihat riwayat penggunaan harian
- ✅ Input tanggal manual (untuk data historis)
- ✅ Hapus data per item atau semua history
- ✅ Konfigurasi harga per kWh
- ✅ Set target bulanan
- ✅ Referensi tarif listrik PLN
Halaman utama yang menampilkan statistik penggunaan listrik, grafik tren konsumsi, dan breakdown kategori hemat/normal/boros
Form untuk menambahkan alat elektronik dan menghitung total penggunaan listrik harian dengan analisis fuzzy logic
History lengkap penggunaan listrik harian dengan detail breakdown per alat dan kategori fuzzy
Halaman login untuk mengakses sistem monitoring listrik
Halaman pendaftaran akun baru untuk pengguna baru
Konfigurasi harga per kWh, target bulanan, dan referensi tarif PLN
| Technology | Version | Purpose |
|---|---|---|
| React | 18.x | UI Framework |
| Vite | 5.x | Build Tool |
| Axios | 1.x | HTTP Client |
| Recharts | 2.x | Data Visualization |
| Lucide React | Latest | Icons |
| Technology | Version | Purpose |
|---|---|---|
| Node.js | 18.x+ | JavaScript Runtime |
| Express.js | 5.x | Web Framework |
| Mongoose | 8.x | MongoDB ODM |
| CORS | 2.x | Cross-Origin Resource Sharing |
| Dotenv | 17.x | Environment Variables |
| Technology | Version | Purpose |
|---|---|---|
| MongoDB | 6.x+ | NoSQL Database |
- Nodemon - Auto-restart server
- MongoDB Compass - Database GUI (optional)
Sebelum memulai, pastikan Anda sudah install:
- Node.js (v18 atau lebih baru) - Download
- MongoDB (v6 atau lebih baru) - Download
- Git (optional) - Download
- VS Code atau text editor lainnya
git clone https://github.com/eufroshine/voltify.git
cd voltify# Install MongoDB Community Edition
# Jalankan MongoDB service
mongod --dbpath="C:\data\db" # Windows
# atau
sudo systemctl start mongod # Linux- Buat akun di MongoDB Atlas
- Create Free Cluster (M0)
- Setup Database User & Network Access
- Copy Connection String
# Masuk ke folder backend
cd backend
# Install dependencies
npm install
# Buat file .env
touch .env # atau buat manual di WindowsEdit file .env:
PORT=5000
# MongoDB Local
MONGODB_URI=mongodb://localhost:27017/voltify
# Atau MongoDB Atlas
# MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/voltify?retryWrites=true&w=majority# Masuk ke folder frontend
cd ../frontend
# Install dependencies
npm installUntuk mengisi data contoh:
cd backend
node seed.jscd backend
npm run devOutput:
🚀 Voltify Server running on port 5000
📡 API URL: http://localhost:5000
✅ MongoDB connected successfully
cd frontend
npm run devOutput:
VITE v7.1.11 ready in 1729 ms
➜ Local: http://localhost:5173/
http://localhost:5173
- Buka tab "⚙️ Pengaturan"
- Set Harga per kWh sesuai tarif PLN Anda (default: Rp 1.445)
- Set Target Bulanan (default: 300 kWh)
- Klik "Simpan Pengaturan"
- Buka tab "⚡ Hitung Penggunaan"
- Isi form:
- Nama Alat: Contoh "Kulkas"
- Kategori: Pilih kategori (Pendingin, Penerangan, dll)
- Daya (Watt): Contoh 150
- Jam Pemakaian per Hari: Contoh 24
- Klik "Tambah Alat"
- Ulangi untuk semua alat elektronik Anda
- Di tab "⚡ Hitung Penggunaan"
- Pilih tanggal (default: hari ini)
- Centang alat-alat yang ingin dihitung
- Klik "Hitung Penggunaan"
- Lihat hasil analisis:
- Kategori (Hemat/Normal/Boros)
- Total kWh dan Biaya
- Fuzzy Score
- Breakdown per alat
- Saran & Rekomendasi
- Buka tab "📊 Dashboard"
- Pilih periode (7/14/30 hari)
- Lihat statistik:
- Total penggunaan & biaya
- Rata-rata harian
- Estimasi bulanan
- Breakdown kategori
- Lihat grafik tren penggunaan
- Buka tab "📜 History"
- Lihat semua riwayat penggunaan
- Hapus data yang tidak diperlukan
- Atau klik "Hapus Semua History" untuk reset
Alat Elektronik:
1. Kulkas : 150W × 24h = 3.6 kWh
2. Lampu LED (3x) : 15W × 10h = 0.15 kWh
3. TV LED 32" : 80W × 6h = 0.48 kWh
4. Rice Cooker : 400W × 2h = 0.8 kWh
5. Kipas Angin : 60W × 10h = 0.6 kWh
6. Charger HP (2x) : 10W × 4h = 0.04 kWh
--------------------------------
Total : 5.67 kWh/hari
Biaya : Rp 8.193/hari
Estimasi Bulanan : 170 kWh = Rp 245.650/bulan
Kategori : HEMAT ✅
http://localhost:5000/api
| Method | Endpoint | Description |
|---|---|---|
| GET | /appliances |
Get all appliances |
| GET | /appliances/:id |
Get appliance by ID |
| POST | /appliances |
Create new appliance |
| PUT | /appliances/:id |
Update appliance |
| DELETE | /appliances/:id |
Delete appliance |
| Method | Endpoint | Description |
|---|---|---|
| GET | /usage |
Get usage history |
| POST | /usage/calculate |
Calculate daily usage |
| GET | /usage/summary?days=7 |
Get summary statistics |
| DELETE | /usage/:id |
Delete usage record |
| DELETE | /usage |
Delete all history |
| Method | Endpoint | Description |
|---|---|---|
| GET | /settings |
Get settings |
| PUT | /settings |
Update settings |
POST /api/usage/calculate
{
"applianceIds": ["67123abc...", "67124def..."],
"date": "2025-10-23T00:00:00.000Z"
}Response:
{
"success": true,
"message": "Usage calculated and saved",
"data": {
"totalKwh": 6.207,
"totalCost": 8969,
"fuzzyCategory": "Hemat",
"fuzzyScore": 32,
"suggestions": ["✅ Excellent! Penggunaan listrik sangat HEMAT"]
}
}Membership Functions:
- Low (Hemat): μ(x) = 1 if x ≤ 3
= (7-x)/4 if 3 < x < 7
= 0 if x ≥ 7
- Medium (Normal): μ(x) = (x-5)/3 if 5 < x < 8
= 1 if 8 ≤ x ≤ 12
= (15-x)/3 if 12 < x < 15
- High (Boros): μ(x) = 0 if x ≤ 10
= (x-10)/5 if 10 < x < 15
= 1 if x ≥ 15
IF penggunaan Low THEN Hemat (score ~20)
IF penggunaan Medium THEN Normal (score ~50)
IF penggunaan High THEN Boros (score ~85)
Weighted Average Method:
Score = (μ_hemat × 20 + μ_normal × 50 + μ_boros × 85) / (μ_hemat + μ_normal + μ_boros)
voltify/
├── backend/
│ ├── config/
│ │ └── db.js # MongoDB connection
│ ├── controllers/
│ │ └── fuzzyLogic.js # Fuzzy logic algorithm
│ ├── models/
│ │ ├── Appliance.js # Appliance schema
│ │ ├── DailyUsage.js # Usage schema
│ │ └── Settings.js # Settings schema
│ ├── routes/
│ │ ├── appliances.js # Appliance routes
│ │ ├── usage.js # Usage routes
│ │ └── settings.js # Settings routes
│ ├── .env # Environment variables
│ ├── server.js # Main server file
│ ├── seed.js # Seed data (optional)
│ └── package.json
│
├── frontend/
│ ├── public/
│ ├── src/
│ │ ├── components/
│ │ │ ├── Navbar.jsx
│ │ │ ├── ApplianceForm.jsx
│ │ │ ├── ApplianceList.jsx
│ │ │ ├── FuzzyAnalysis.jsx
│ │ │ ├── Dashboard.jsx
│ │ │ ├── UsageChart.jsx
│ │ │ ├── UsageHistory.jsx
│ │ │ └── Settings.jsx
│ │ ├── services/
│ │ │ └── api.js # Axios API service
│ │ ├── App.jsx # Main component
│ │ ├── main.jsx # Entry point
│ │ └── index.css # Global styles
│ ├── index.html
│ ├── vite.config.js
│ └── package.json
│
├── ss/ # Screenshots folder
│ ├── dashboard.png
│ ├── hitung.png
│ ├── riwayat.png
│ ├── login.png
│ ├── register.png
│ └── pengaturan.png
│
└── README.md
Solution:
# Cek MongoDB service running
# Windows:
net start MongoDB
# Linux:
sudo systemctl status mongod
# Atau cek .env connection string sudah benarSolution:
// Pastikan di backend/server.js ada:
app.use(cors({
origin: 'http://localhost:5173',
credentials: true
}));Solution:
// Tambahkan optional chaining (?)
summary?.estimatedMonthlyCost || 0Solution:
# Kill process di port 5000 atau 5173
# Windows:
netstat -ano | findstr :5000
taskkill /PID <PID> /F
# Linux/Mac:
lsof -ti:5000 | xargs kill -9- Express.js Documentation
- React Documentation
- MongoDB Documentation
- Mongoose Guide
- Fuzzy Logic Tutorial
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Edit functionality untuk alat elektronik
- Export data ke PDF/Excel
- Multi-user authentication
- Mobile responsive optimization
- PWA (Progressive Web App)
- Email notification untuk penggunaan boros
- Comparison dengan rumah tangga lain (anonymized)
- Machine Learning prediction
This project is licensed under the MIT License - see the LICENSE file for details.
Your Name
- GitHub: @eufroshine
- Email: abidzarsabil05@gmail.com
- PLN (Perusahaan Listrik Negara) untuk referensi tarif listrik
- MongoDB Team untuk database yang powerful
- React & Express community untuk framework yang luar biasa
- Dosen pembimbing Decision Support System
Jika Anda mengalami masalah atau punya pertanyaan:
- Buka Issues
- Search terlebih dahulu apakah ada issue serupa
- Jika belum ada, buat issue baru dengan detail:
- Deskripsi masalah
- Langkah untuk reproduce
- Screenshot (jika perlu)
- Environment (OS, Node version, dll)
Made with ❤️ for saving energy and money
⭐ Star this repo if you find it helpful!