Building EnerSight AI: Exploring Serverless Energy Monitoring with AWS
Introduction
Energy consumption is an important concern for buildings, campuses, and organizations. When energy data is difficult to understand, unusual consumption patterns and opportunities to reduce waste can go unnoticed.
To explore this problem, our team developed EnerSight AI, an energy monitoring and anomaly detection platform designed to make energy data easier to understand and support better energy-efficiency decisions.
Our project combines a web-based dashboard with an exploration of AWS serverless technologies.
What is EnerSight AI?
EnerSight AI allows users to explore energy readings from multiple buildings through a centralized dashboard. The platform includes building monitoring, anomaly analysis, data ingestion, and impact and savings sections.
Key features include:
- Energy monitoring across multiple buildings
- Historical energy data exploration
- Anomaly analysis to identify unusual consumption patterns
- Dashboard visualizations for understanding energy usage
- An impact and savings section to support energy-efficiency planning
We used historical building energy data and a synthetic benchmark dataset to demonstrate the platform's functionality.
How we used AWS
One of the important parts of this project was exploring how AWS serverless technologies could support the backend.
1. AWS Serverless Application Model (AWS SAM)
We used the AWS SAM CLI to validate, build, and locally test our serverless application. We created a SAM template to define the backend resources and API routes.
This helped us organize the backend configuration and understand how serverless applications can be developed and tested.
2. AWS Lambda
We created a TypeScript-based Lambda function to handle energy analysis requests. The function was designed to process incoming data and return an analysis response.
We built and tested the function locally using AWS SAM CLI.
3. Amazon API Gateway
We configured API Gateway routes for POST and OPTIONS requests at /api/v1/analyze . These routes were defined in our SAM template to provide an API interface for the analysis function.
4. esbuild
We used esbuild to bundle the TypeScript Lambda code as part of the build configuration.
Together, these tools helped us explore the structure of a serverless backend and understand how its components can work together.
Technology stack
Our project uses the following technologies:
- Frontend: React and TypeScript
- Backend runtime: Node.js and TypeScript
- Serverless development: AWS SAM CLI
- API configuration: Amazon API Gateway
- Data inputs: Historical building energy data, synthetic benchmark data, and CSV files
Challenges and learnings
During development, we learned that configuring a serverless application involves more than writing a function. The template, API routes, build process, and local testing workflow must all work together.
We also learned the value of testing backend functionality before considering deployment. Using AWS SAM CLI helped us validate the configuration, build the function, and test a sample event locally.
This experience gave our team practical exposure to AWS serverless development and helped us understand the steps involved in preparing a backend for deployment.
Current status
The EnerSight AI frontend is deployed on Vercel. The AWS SAM configuration, Lambda function, and API Gateway routes were built and tested locally. The AWS backend has not yet been deployed to AWS or connected to the live frontend.
Our current implementation is a prototype demonstrating the energy-monitoring experience and the initial serverless backend design.
What's next?
Our next steps include deploying the backend to AWS, connecting the frontend to the API, and testing the complete application flow. We also plan to improve the analysis capabilities and explore how the platform could support more detailed energy-efficiency insights.
Conclusion
EnerSight AI gave our team an opportunity to explore energy monitoring while learning practical serverless development with AWS.
Using AWS SAM CLI, AWS Lambda, and Amazon API Gateway helped us understand how to structure, build, and test a serverless backend. We look forward to continuing development and exploring how the platform can help users make more informed decisions about energy consumption.
EnerSight AI was developed collaboratively, with both team members contributing to the project and its presentation.
Loading article