Inspiration
Electricity bills tell us how much we pay, but not always where the energy goes or which habits are wasting it. I wanted to build something that makes household energy usage easier to understand and gives people practical ways to reduce waste. That led to HomePilot, a self-hosted energy monitoring platform with an AI assistant.
What it does
HomePilot provides an energy dashboard with power usage, daily consumption, estimated electricity costs, device-level breakdowns, and solar generation estimates. Users can ask questions in natural language to understand their usage, identify unusual patterns, and explore potential savings.
It also exposes its capabilities through an MCP server, allowing compatible AI clients to access its tools. Authentication uses OAuth 2.1 with PKCE.
The current demo uses generated readings rather than data from physical hardware.
How we built it
We built HomePilot with a Python FastAPI backend, a web dashboard, a local database, and a locally running language model through Ollama. The backend handles energy data, analytics, and AI tool routing.
We implemented an MCP server with a custom JSON-RPC dispatcher and tool registry, supporting Streamable HTTP. We also added OAuth discovery, token refresh and revocation, and household-scoped read-only tools.
For the prototype, we seeded the database with simulated devices and readings so we could test the dashboard, analytics, and AI interactions without requiring physical equipment.
Challenges we ran into
One major challenge was making the AI responses useful rather than generic. Energy questions need to be answered using actual readings, and the system must recognize when there isn't enough data to make a reliable conclusion.
We addressed this by separating anomaly detection from the language model and adding explicit outcomes for insufficient data and errors.
Another challenge was getting the MCP server, authentication flow, and local AI model to work together. Model compatibility with tool calling also required extra handling and testing.
Accomplishments that we're proud of
We brought the dashboard, energy analysis, AI chat, and MCP interface together in one working prototype.
We're particularly proud of building the MCP server ourselves rather than relying on an MCP SDK. We also implemented OAuth-based access, tool discovery, and anomaly detection designed to avoid unsupported conclusions when data is limited.
The project has a test suite covering key backend and analytics behavior, giving us a stronger foundation for further development.
What we learned
We learned that connecting an AI model to data is only part of the problem. The harder part is ensuring that its answers are grounded in the data, that missing information is handled honestly, and that tools are exposed securely.
We also gained practical experience with MCP, OAuth, local language models, and the challenges of building reliable tool-calling workflows.
What's next for HomePilot
The next step is integrating real energy-monitoring devices, compatible electricity meters, and solar inverters. We also want to improve historical analysis, validate savings estimates against real consumption, and make anomaly detection more useful over longer periods.
Our goal is to move from a prototype using simulated readings to a system that can help households understand and manage their actual energy usage.
Built With
- fastapi
- javascript
- json-rpc
- mcp
- oauth
- ollama
- python
- typescript