--:--
--
← chronicles

Building a rooftop solar planner where AI explains and code calculates

homesol turns one tap on a satellite map into a complete rooftop solar plan: a real panel layout, a year of shadows traced to their causes, and the cost after subsidy

cover.jpeg
Comment

Ask three solar installers how many panels fit on your roof and you will get three different answers, three different prices, and no explanation of the tree next door. For a household weighing a purchase worth one or two lakh rupees, even after the PM Surya Ghar subsidy, that is how the decision usually gets made.

I built homesol so a household can find the answers themselves. Tap your roof on a map and, in about a minute, you see where each panel would go, what shades the roof and when, how much the system would generate, and what it would cost and save after subsidy. Then you can ask questions about your own plan in English or Hindi, by typing or by speaking.

One tap on a flat roof: a 3.3 kW plan. The roof is colored by its year’s sunlight, each panel is drawn to size, and the trees that shade it are outlined in red.

The rule: models perceive and explain, code calculates

Ask a large language model “how much will I save with solar?” and it will give you a confident, plausible number. For a family about to spend a year’s savings, plausible isn’t good enough. So we split the work in two:

  1. Deterministic code produces every number on screen: the roof’s area, each obstruction’s height, the shadows, the panel count, the generation, the subsidy and the payback.

  2. Claude on Amazon Bedrock does three things code can’t. It reads a photo of the electricity bill. It says what each measured obstruction is, such as “stair room” or “large tree cluster to the south-west”. And it explains the plan in the household’s own language.

Claude is handed numbers and is never asked to work them out. Every design decision below follows from that.

Architecture

The website is a static Next.js export on AWS Amplify Hosting. One AWS Lambda function runs the whole API, and it reaches Bedrock, Transcribe and DynamoDB through its IAM role, so no AWS key is stored anywhere
  • AWS Amplify Hosting serves the website, a static export of a Next.js app. The heavy simulation runs in the browser, so changing the month, the time of day or the household’s figures is instant and calls no paid service.

  • AWS Lambda runs the API: a FastAPI app wrapped with Mangum behind a function URL, on Python 3.13 and arm64. Reserved concurrency of 10 caps how much it can spend at once. A function URL is bounded only by the function’s own timeout. That matters, because Google’s 3D survey occasionally takes 30 seconds to arrive.

  • Amazon Bedrock serves Claude Opus 4.6, which reads bills, names obstructions and runs the advisor, and Claude Sonnet 4.6, which runs the advisor’s two specialists.

  • Strands Agents, AWS’s open-source agent SDK, wires the advisor and its specialists together.

  • Amazon Transcribe turns spoken questions in Indian English or Hindi into text.

  • Amazon DynamoDB stores three things: saved plans, which open from a link or QR code and expire after 90 days; feedback; and rate-limit counters.

An invite-only space for considered discussion. Sign up, and you can comment once you are approved.

Comments

Loading comments…