Quick Start - xante8088/kasa-monitor GitHub Wiki
Quick Start Guide
Get Kasa Monitor up and running in 5 minutes!
🚀 Fastest Setup (Docker)
Step 1: Run the Container
docker run -d \
--name kasa-monitor \
--network host \
-v kasa_data:/app/data \
xante8088/kasa-monitor:latest
Note: Use --network host for automatic device discovery (Linux only).
Step 2: Access the Application
Open your browser and navigate to:
Frontend: http://localhost:3000
Backend API: http://localhost:5272
Note: The frontend (React app) runs on port 3000, while the backend API runs on port 5272. For most users, you'll primarily use the frontend interface.
Step 3: Create Admin Account
- You'll be redirected to
/setup - Enter your admin credentials:
- Username
- Password
- Click "Create Admin Account"
Step 4: Configure Electricity Rates
- Click Settings (⚙️) → "Electricity Rates"
- Enter your rate information:
- Simple Rate: Single $/kWh rate
- Time-of-Use: Different rates by time
- Tiered: Different rates by usage level
- Save your configuration
Step 5: Add Your Devices
Automatic Discovery (Host/Macvlan network)
- Click "Discover Devices" (🔍)
- Wait for scan to complete
- Your devices appear automatically
Manual Entry (Any network mode)
- Click Settings (⚙️) → "Device Management"
- Click "Add Device Manually"
- Enter device IP address (e.g.,
192.168.1.100) - Click "Add"
📱 Using the Dashboard
Main View
- Device Grid: See all your devices at a glance
- Power Status: Green = On, Gray = Off
- Current Usage: Real-time power consumption
- Daily Cost: Today's electricity cost
Device Details
Click any device to see:
- 24-hour power graph
- Current consumption
- Daily/monthly statistics
- Cost breakdown
- On/off control
Cost Summary
Top of dashboard shows:
- Total daily cost
- Monthly projection
- Peak usage times
- Device rankings by cost
🎯 Common Tasks
Finding Device IP Addresses
Option 1: Router Admin Panel
- Log into your router (usually
192.168.1.1) - Look for "Connected Devices" or "DHCP Clients"
- Find devices starting with "HS" or "KL"
Option 2: Kasa Mobile App
- Open the Kasa app
- Tap on a device
- Go to Settings → Device Info
- Note the IP address
Option 3: Network Scan
# Linux/Mac
nmap -sn 192.168.1.0/24 | grep -B2 "TP-LINK"
# Or use arp
arp -a | grep -i "tp-link"
Controlling Devices
- From Dashboard: Click power button on device card
- From Detail View: Use large power toggle
- Bulk Actions: Select multiple devices → Apply action
Viewing Historical Data
- Click on any device
- Use time range selector:
- Last 24 hours
- Last 7 days
- Last 30 days
- Custom range
- Export data as CSV for analysis
🐳 Docker Compose Setup
For more control, use Docker Compose:
- Create
docker-compose.yml:
version: '3.8'
services:
kasa-monitor:
image: xante8088/kasa-monitor:latest
container_name: kasa-monitor
network_mode: host # For discovery
volumes:
- kasa_data:/app/data
environment:
- TZ=America/New_York # Your timezone
- JWT_SECRET_KEY=${JWT_SECRET_KEY} # Generate with: openssl rand -base64 32
- CORS_ALLOWED_ORIGINS=http://localhost:3000 # Add your domain for production
restart: unless-stopped
volumes:
kasa_data:
- Create
.envfile for production:
# Generate secure keys
echo "JWT_SECRET_KEY=$(openssl rand -base64 32)" > .env
echo "CORS_ALLOWED_ORIGINS=https://yourdomain.com" >> .env
- Start the stack:
docker-compose up -d
- View logs:
docker-compose logs -f
🔧 Environment Options
Basic Configuration
environment:
- TZ=America/New_York # Your timezone
- DISCOVERY_ENABLED=true # Auto-discovery
- MANUAL_DEVICES_ENABLED=true # Manual IP entry
With TP-Link Cloud
environment:
- [email protected]
- TPLINK_PASSWORD=yourpassword
With InfluxDB (Advanced)
environment:
- INFLUXDB_URL=http://localhost:8086
- INFLUXDB_TOKEN=your-token
- INFLUXDB_ORG=kasa-monitor
- INFLUXDB_BUCKET=device-data
❓ Quick Troubleshooting
Can't Find Devices?
-
Check network mode:
- Bridge mode = No discovery (use manual entry)
- Host mode = Full discovery
- See Network Configuration
-
Verify device connectivity:
ping 192.168.1.100 # Your device IP
- Add manually:
- Settings → Device Management → Add Device Manually
Can't Access Web Interface?
- Check container is running:
docker ps
- Check logs:
docker logs kasa-monitor
- Verify ports:
curl http://localhost:3000
curl http://localhost:5272/api/devices
Forgot Admin Password?
- Stop the container:
docker stop kasa-monitor
- Reset database:
docker run --rm -v kasa_data:/data alpine \
rm /data/kasa_monitor.db
- Restart and setup again:
docker start kasa-monitor
📚 Next Steps
Now that you're up and running:
-
Explore Features:
- Energy Monitoring - Track consumption patterns
- Cost Analysis - Understand your bills
- User Management - Add family members
-
Optimize Setup:
- Security Guide - Secure your installation
- Backup & Recovery - Protect your data
- Performance Tuning - Optimize for your hardware
-
Get Help:
- FAQ - Common questions
- Common Issues - Troubleshooting
- GitHub Issues - Report bugs
🎉 Success Checklist
- [ ] Container running
- [ ] Web interface accessible
- [ ] Admin account created
- [ ] Electricity rates configured
- [ ] At least one device added
- [ ] Real-time data visible
- [ ] Cost calculations working
🔧 Quick Troubleshooting
Can't Access the Application?
- Check ports: Frontend (3000) and Backend (5272) should be accessible
- Firewall: Make sure Docker ports aren't blocked
- Container status: Run
docker psto verify the container is running
Devices Not Found?
- Network: Ensure devices are on the same subnet as the Docker host
- Discovery: Try manual device addition using IP addresses
- Permissions: On Linux, ensure Docker has network access
Performance Issues?
- Resources: Check Docker container has sufficient memory (512MB+ recommended)
- Database: Large amounts of historical data may slow queries
- Network: Reduce polling frequency in settings if needed
Need more help? Check the Common Issues guide.
Congratulations! You're now monitoring your smart home energy usage! 🏠⚡
Document Version: 1.1.0
Last Updated: 2025-08-20
Review Status: Current
Change Summary: Added security configuration for JWT and CORS in Docker Compose setup