A comprehensive IoT control system for camper vans built with .NET 10 and Blazor WebAssembly. Monitor and control your van's systems including water tanks, LPG, lighting, heating, and more - all from your phone, tablet, or computer.
- Real-time Monitoring: Track water tanks, waste water, LPG, fuel, and battery levels in real-time
- Interactive Controls: Control lights, water pump, heater, and other systems with a touch-friendly interface
- Configurable Alerts: Get notified when tanks are running low or waste tanks are full
- Multiple Van Types: Support for different van models with customizable diagrams (default: Mercedes Sprinter LWB)
- Modular Plugin System: Easy integration with various hardware systems (Modbus, I2C, Victron Cerbo, etc.)
- Web-Based Interface: Access from any device with a web browser
- Containerized Deployment: Easy deployment with Docker on Raspberry Pi or other Linux systems
- Offline-First: Works without internet connectivity
- .NET 10.0 SDK (for development)
- Docker (for containerized deployment)
- Raspberry Pi 4 (2GB+ RAM recommended) or similar Linux system
- Clone the repository:
git clone https://github.com/yourusername/vandaemon.git
cd vandaemon- Start the services:
docker compose up -dFor detailed Docker usage, configuration, and troubleshooting, see DOCKER.md.
- Access the web interface:
- Web UI: http://localhost:8080
- API: http://localhost:5000
- API Documentation: http://localhost:5000/swagger
- Build the solution:
./build.sh # Linux/Mac
build.bat # Windows- Run the API:
cd src/Backend/VanDaemon.Api
dotnet run- Run the Web UI (in a separate terminal):
cd src/Frontend/VanDaemon.Web
dotnet runVanDaemon/
├── src/
│ ├── Backend/
│ │ ├── VanDaemon.Api/ # REST API and SignalR hubs
│ │ ├── VanDaemon.Core/ # Domain models and interfaces
│ │ ├── VanDaemon.Application/ # Business logic services
│ │ ├── VanDaemon.Infrastructure/ # Data access and external services
│ │ └── VanDaemon.Plugins/ # Hardware integration plugins
│ │ ├── Abstractions/ # Plugin interfaces
│ │ ├── Simulated/ # Simulated hardware (for testing)
│ │ ├── Modbus/ # Modbus integration
│ │ ├── I2C/ # I2C sensor integration
│ │ └── Victron/ # Victron Cerbo integration
│ └── Frontend/
│ └── VanDaemon.Web/ # Blazor WebAssembly application
├── tests/ # Unit and integration tests
├── docs/ # Documentation
├── docker/ # Docker configuration
└── .github/workflows/ # CI/CD pipelines
VanDaemon follows a clean architecture pattern with clear separation of concerns:
- Frontend: Blazor WebAssembly with MudBlazor UI components
- Backend API: ASP.NET Core Web API with SignalR for real-time updates
- Plugin System: Modular hardware integration layer supporting multiple protocols
- Data Storage: JSON file storage for configuration, in-memory cache for real-time data
See PROJECT_PLAN.md for detailed architecture documentation.
VanDaemon supports multiple hardware integration methods through its plugin system:
- Simulated Plugin (Default) - For testing and development
- Modbus Plugin - For Modbus TCP/RTU devices
- I2C Plugin - For direct I2C sensor integration
- Victron Plugin - For Victron Cerbo GX integration via MQTT
See docs/deployment/plugin-development.md for instructions on creating custom hardware plugins.
Configure the system through the web interface Settings page or by editing the configuration files:
appsettings.json- API configuration- Environment variables - Runtime configuration
Customize the van diagram to match your vehicle:
- Create an SVG diagram of your van (facing left)
- Add the diagram to
src/Frontend/VanDaemon.Web/wwwroot/diagrams/ - Configure overlay positions in the Settings page
VanDaemon supports multiple deployment options:
Deploy VanDaemon to the cloud for remote access as a single combined container:
# Install Fly.io CLI
curl -L https://fly.io/install.sh | sh
# Login and deploy
flyctl auth login
flyctl apps create vandaemon
flyctl deployAccess your application at:
- Single URL: https://vandaemon.fly.dev
- Web Frontend:
/ - API Backend:
/api - SignalR WebSocket:
/hubs - Health Check:
/health
- Web Frontend:
The Fly.io deployment uses a single container with:
- Nginx (Port 8080) - Serves Blazor WASM static files and proxies API/WebSocket requests
- .NET API (Port 5000 internal) - Handles REST API and SignalR connections
- Supervisor - Manages both nginx and API processes
- Single Endpoint: All services accessible from one URL
- WebSocket Support: Nginx configured for long-lived SignalR connections
- Health Checks: Automatic monitoring via
/healthendpoint - Auto-Scaling: Machines stop when idle to save costs
- GitHub Actions: Automatic deployment on push to main branch
For detailed instructions including GitHub Actions auto-deployment, see DEPLOYMENT.md
# Update system
sudo apt update && sudo apt upgrade -y
# Install Docker (includes Docker Compose V2)
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# Add user to docker group
sudo usermod -aG docker $USERgit clone https://github.com/yourusername/vandaemon.git
cd vandaemon
docker compose up -dFor GPIO/I2C access, you may need to:
# Enable I2C
sudo raspi-config
# Select: Interface Options -> I2C -> Enable
# Add user to i2c group
sudo usermod -aG i2c $USER# Create systemd service
sudo nano /etc/systemd/system/vandaemon.serviceAdd the following content:
[Unit]
Description=VanDaemon Control System
Requires=docker.service
After=docker.service
[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/home/pi/vandaemon
ExecStart=/usr/bin/docker compose up -d
ExecStop=/usr/bin/docker compose down
[Install]
WantedBy=multi-user.targetEnable and start:
sudo systemctl enable vandaemon
sudo systemctl start vandaemonThe API is documented with OpenAPI/Swagger. Access the interactive documentation at:
- http://localhost:5000/swagger (when running locally)
- https://vandaemon.fly.dev/swagger (when deployed)
GET /api/tanks- Get all tanksGET /api/tanks/{id}/level- Get current tank levelPOST /api/tanks/refresh- Refresh all tank levelsPUT /api/tanks/{id}- Update tank configurationGET /health- Health check endpoint (returns status and timestamp)
SignalR hub for real-time telemetry updates:
- Local: ws://localhost:5000/hubs/telemetry
- Cloud: wss://vandaemon.fly.dev/hubs/telemetry
The hub broadcasts tank levels, control states, and alerts to all connected clients.
# Build solution
dotnet build VanDaemon.sln
# Run tests
dotnet test VanDaemon.sln
# Run specific project
cd src/Backend/VanDaemon.Api
dotnet run# Run all tests
dotnet test
# Run with coverage
dotnet test --collect:"XPlat Code Coverage"See PROJECT_PLAN.md for the detailed development roadmap.
Issue: Cannot connect to API from web interface
- Check that API is running on http://localhost:5000
- Verify CORS settings in
appsettings.json - Check browser console for errors
- The frontend automatically uses the current host URL (no configuration needed)
Issue: Docker containers won't start
- Run
docker compose logsto check logs - Ensure ports 5000 and 8080 are not in use
- Verify Docker daemon is running
Issue: Sensors not reading values
- Check plugin configuration in Settings
- Verify hardware connections
- Check API logs for errors
Issue: SignalR WebSocket connections failing
- Verify health endpoint is accessible:
curl https://your-app.fly.dev/health - Check nginx logs for WebSocket upgrade errors
- Ensure nginx is configured with proper WebSocket headers
- Check for firewall blocking WebSocket connections (port 443 for wss://)
Issue: Fly.io deployment health checks failing
- Verify the
/healthendpoint returns 200 OK - Check logs:
flyctl logs --app vandaemon - Ensure nginx and API are both running:
flyctl ssh console -C "supervisorctl status"
Issue: Frontend making requests to localhost in production
- This is now fixed automatically - the frontend uses
builder.HostEnvironment.BaseAddress - In production, it will use the deployed URL (e.g., https://vandaemon.fly.dev)
- In development, it will use http://localhost:8080
This project is licensed under the MIT License - see the LICENSE file for details.
- MudBlazor - Material Design components for Blazor
- NModbus - Modbus communication library
- Victron Energy - For their excellent products and documentation
Built with ❤️ for the camper van community