The Bill Looked Normal. The Pump Wasn’t: Spotting a Hidden Fault in an Apartment’s Electricity Bill with AWS
How I built Watt & Where, a serverless AWS app that explains a Bengaluru apartment’s common-area electricity bill, flags the one month that’s off, and uses Amazon Bedrock to write a committee summary that can’t invent a single number.
Picture a Bengaluru apartment committee looking at its common-area electricity bill: roughly ₹1 lakh every month, month after month. In March the bill goes up about 7% over the previous March. Nobody blinks. Summer, right?
But in my demo apartment, that bump is a water pump running 8 hours a day instead of 4, because its pressure switch is stuck. It quietly wastes about 660 kWh, around ₹6,500 that month. Multiply that across a year, or across a building where nobody's checking, and you get exactly the complaint residents keep raising: why is maintenance going up? (Apartment federations told the Times of India in 2025 that electricity can take a large share of maintenance funds.)
Watt & Where is my attempt to answer that question in plain language.
What it does
- Estimates where the electricity should go (pumps, lifts, the sewage treatment plant, lighting) from the equipment list.
- Flags a month only if it looks wrong after allowing for normal summer and winter patterns.
- Ranks likely causes from pump run logs.
- Writes a short committee summary in plain English.
No machine learning, on purpose
The detection is transparent statistics. Seasonal multipliers set the expectation. Then a month raises an alert only if two checks agree: the gap between estimate and bill jumps compared with the previous six months, and the bill is at least 5% above the same month last year. A normal hot summer fails the second check because last summer was hot too. The pump fault passes both.
With only 12 to 24 months of bills, a trained model would be guesswork. Rules can be audited: a committee treasurer can read why a month was flagged. On my synthetic data, only March 2026 raised an alert across 20 random seeds (a few seeds also produced a softer "watch" on another month). That is a test on synthetic data with a planted fault, not proof it works on real bills.
The AWS architecture
Everything is defined with AWS SAM and deployed to ap-south-1: six Lambda functions, API Gateway, DynamoDB, a private S3 bucket, CloudWatch logs with 7-day retention, and least-privilege IAM roles.
The trick I'm proudest of: an AI that can't invent numbers
I use Amazon Bedrock (Amazon Nova Micro, through an APAC inference profile and the Converse API) only to word the summary. The model never sees raw data. It writes text with placeholders like
{{pump_excess_kwh}} , and my code fills in the real values. If the model writes a literal digit or an unknown placeholder, the validator rejects it, retries once, and then falls back to a deterministic template. A wrong figure is impossible by construction.What broke (the honest part)
- Mocked tests passed, real AWS didn't. All 25 mocked tests were green, but the first live report link failed with an S3 signing-region error. The fix was pinning the regional endpoint and virtual-host addressing.
- The model kept ignoring "no digits". Nova Micro inserted literal numbers and malformed placeholders. The validator caught every one, which is exactly why I built it. The fix was changing the task from "write a summary" to "edit this draft and keep the placeholders". After that, three live trials passed on the first attempt.
- Wrong AWS identity. My terminal was using a different IAM user than I intended. Now I run
sts get-caller-identitybefore every deploy.
- A test quietly got loosened. An AI assistant relaxed a failing check and still reported a pass. I caught it and set a rule: failures are reported as failures.
What it can't do (yet)
All data is synthetic, and the figures are estimates, not measurements. Naming a pump as the cause needs run logs, which most apartments don't keep, so real use needs hour meters or sub-meters. There's no authentication yet. A committee view for editing equipment exists only as a clearly labeled preview, and the public website runs on a saved snapshot, not the live API.
Try it
The repo has a README to run the analysis locally in a few commands and to deploy the AWS stack: https://github.com/manya302/Watt\_and\_Where .
I built this with AI coding assistants, and most of my time went into the unglamorous part: checking, testing, and fixing what broke on real AWS.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article