Work Accomplished
Integrated the devices (Big LED, PWM Fans) to the dashboard.
-
Implemented real-time device control through the dashboard with “Turn On/Off” capability.
- Optimized the calls for device state and history queries to stay under 500ms latency.
-
Added schedule-based control logic using persistent JSON storage and periodic polling, enabling automated device operation aligned with user preferences.
Tested the optimization algorithm. Measured the latency, with the full scheduling computation consistently completing within 500ms to 1.5s. This ensures that users receive near-instant recommendations
- Evaluated how well the algorithm responds to price shifts by injecting synthetic price spikes in the mid-afternoon. The optimizer avoided those periods unless solar generation was high, confirming that the algorithm appropriately weights cost considerations. In solar alignment tests, we simulated peak solar output at 11 AM–2 PM and observed the optimizer shifting device usage accordingly, validating the integration of renewable energy forecasts into the objective function.
- Verified solver stability and objective sensitivity to weights which include grid price and solar output.
Progress
- The Software – Embedded Layer actuation is done.
- I faced issues with ML model integration—currently, the models for forecasting grid prices and solar output are being called during route execution, which causes high latency and even site crashes (too long to respond) in some cases. I still need to figure out how to load the trained models separately and keep them persistently available to the app (running inference in a background job queue) rather than reloading them with each request. I am slightly behind schedule on that integration.
Next Steps
-
Add More Devices to Dashboard:
-
Extend the devices list to include the other speaker and motors. On the dashboard will create a filter to view power sensor mapping for each new device for usage tracking and optimization.
-
Refactor current ML routes to load models once during app startup instead of per-request.Use a tool to preload models and serve fast predictions.
Knowledge and Tools
-
FastAPI & Jinja2 Templating: I had to learn FastAPI for building a responsive backend, and how to integrate it with Jinja2 for rendering dynamic HTML dashboards.
-
Home Assistant API Integration: I learned how to query real-time sensor states, parse device schedules, and handle authentication with Home Assistant’s REST API.
-
Linear Programming with PuLP: I explored energy cost minimization and scheduling using linear programming, learning how to define decision variables, objective functions, and constraints.
-
Data Visualization (Chart.js, ECharts): I gained familiarity with frontend charting libraries to visually present sensor data, solar forecasts, and results in user friendly way.
-
Model Deployment (joblib, XGBoost, Scikit-learn): I had to train and serialize ML models for solar and pricing forecasts, then load them into the backend