Tesla Powerwall backup reserve automation for Docker
2.3K
Automated off-peak grid charging for your Tesla Powerwall.
PowerNight is a lightweight Docker-based application with a web interface that automates Tesla Powerwall backup reserve management. Schedule reserve percentage changes to optimize energy costs by charging from the grid during cheaper off-peak hours and discharging during expensive peak hours.
My Personal Use Case: Charge from grid overnight at low rates (in my case 0,16 EUR/kWh) and use the battery during peak hours (0,26 EUR/kWh).
Access the web interface at http://ip-address:8020 or http://localhost:8020.
Powerwall status with battery level, power flow, and system information

Task management UI for scheduling backup reserve changes

Execution logs with timestamps and task results

Tesla Account configuration, site selection, and timezone settings

PowerNight CLI commands
# Get Powerwall status
powernight status
Install & Run PowerNight Docker Container
docker run -d \
--name PowerNight \
-p 8020:8020 \
-v ./PowerNight-Data:/data \
zaaicom/powernight:latest
Open web interface Navigate to http://localhost:8020 in your browser
Set your Timezone under Settings Navigate to Settings → Configure your local timezone
Authenticate with your Tesla account on the Settings page Click "Authorize with Tesla" and complete OAuth flow
Check Powerwall data on the Dashboard and compare with the Tesla Mobile App Verify battery level, power flow, and operating mode match
Create your tasks under Planner Navigate to Planner → Add tasks with time and reserve percentage
Start a manual task execution Test a task immediately to verify connectivity
Verify successful execution on the History page Check execution logs for success/error status
Docker Hub is recommended for most users, especially Synology NAS deployments.
# Run with volume mount (IMPORTANT for data persistence)
docker run -d \
--name PowerNight \
-p 8020:8020 \
-v ./PowerNight-Data:/data \
zaaicom/powernight:latest
⚠️ IMPORTANT: Always use volume mounts (-v ./PowerNight-Data:/data) to persist OAuth tokens, database, and configuration. Without volumes, data is lost after container restart.
Alternative registry hosted on GitHub Packages.
# Pull from GHCR
docker pull ghcr.io/zaai-com/powernight:latest
# Run with volume mount
docker run -d \
--name PowerNight \
-p 8020:8020 \
-v ./PowerNight-Data:/data \
ghcr.io/zaai-com/powernight:latest
Recommended for production deployments - ensures persistent volumes are always configured.
Download docker-compose.yml file
Start the application:
docker-compose up -d
Optimized for Synology DSM Docker integration:
Install Synology Container Manager from Package Center
Create Folder /docker/PowerNight-Data via File Station and add Read&Write permission to 'SYSTEM' user
Pull image from Docker Hub via Synology DSM UI: Go to Registry tab → Search for zaaicom/powernight → Download latest tag
Create container with:
/docker/PowerNight-Data → /dataAccess via http://synology-ip:8020
Additional Synology Notes
For contributors and developers:
# Clone repository
git clone https://github.com/ZAAI-com/PowerNight.git
cd PowerNight
# Install Python dependencies
pip install -e ".[dev]"
# Install Node.js dependencies
npm install
# Build frontend (with version metadata)
./build.sh --no-docker
# Run application
python -m powernight.main
Access at http://localhost:8020
PowerNight is designed for trusted local networks only
Warning: Exposing PowerNight to the internet without additional security could allow unauthorized control of your Tesla Powerwall.
For detailed security guidance, see SECURITY.md.
⚠️ CRITICAL: Always use volume mounts for production deployment!
Why Volumes Are Critical:
docker run WITHOUT -v → Data lost on container restart/data → Re-authentication required/data → All schedules lostData Backup:
# Backup entire data directory
tar -czf powernight-backup-$(date +%Y%m%d).tar.gz PowerNight-Data/
# Restore from backup
tar -xzf powernight-backup-20251022.tar.gz
⚠️ IMPORTANT: Always use the build script for production builds!
# Complete build with Docker image
./build.sh
# Build without Docker (faster for development)
./build.sh --no-docker
# Frontend only (version info won't update - NOT RECOMMENDED)
npm run build
Build Script Features:
version-info.json with build metadatadist/ for web accessFor troubleshooting common issues, debugging, and log analysis, see FAQ.md.
Made with ⚡ by Manuel
GitHub: ZAAI-com/PowerNight | Docker Hub: zaaicom/powernight | GHCR: ghcr.io/zaai-com/powernight
Content type
Image
Digest
sha256:be04cbfe0…
Size
78.2 MB
Last updated
11 months ago
docker pull zaaicom/powernight