{"id":289,"date":"2025-04-19T23:21:40","date_gmt":"2025-04-19T23:21:40","guid":{"rendered":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/?p=289"},"modified":"2025-04-19T23:24:23","modified_gmt":"2025-04-19T23:24:23","slug":"anyas-status-report-for-04-19","status":"publish","type":"post","link":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/2025\/04\/19\/anyas-status-report-for-04-19\/","title":{"rendered":"Anya&#8217;s Status Report for 04\/19"},"content":{"rendered":"<p><strong>Work Accomplished<\/strong><\/p>\n<p>Integrated the devices (Big LED, PWM Fans) to the dashboard.<\/p>\n<ul>\n<li class=\"\">\n<p class=\"\">Implemented real-time device control through the dashboard with \u201cTurn On\/Off\u201d capability.<\/p>\n<\/li>\n<li><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-292\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-content\/uploads\/sites\/364\/2025\/04\/Screenshot-2025-04-19-at-7.17.19\u202fPM-300x84.png\" alt=\"\" width=\"379\" height=\"106\" srcset=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-content\/uploads\/sites\/364\/2025\/04\/Screenshot-2025-04-19-at-7.17.19\u202fPM-300x84.png 300w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-content\/uploads\/sites\/364\/2025\/04\/Screenshot-2025-04-19-at-7.17.19\u202fPM-768x215.png 768w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-content\/uploads\/sites\/364\/2025\/04\/Screenshot-2025-04-19-at-7.17.19\u202fPM.png 978w\" sizes=\"(max-width: 379px) 100vw, 379px\" \/><\/li>\n<li>Optimized the calls for device state and history queries to stay under 500ms latency.<\/li>\n<li class=\"\">\n<p class=\"\">Added schedule-based control logic using persistent JSON storage and periodic polling, enabling automated device operation aligned with user preferences.<\/p>\n<\/li>\n<li><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-290 aligncenter\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-content\/uploads\/sites\/364\/2025\/04\/Screenshot-2025-04-19-at-6.27.02\u202fPM-300x32.png\" alt=\"\" width=\"730\" height=\"78\" srcset=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-content\/uploads\/sites\/364\/2025\/04\/Screenshot-2025-04-19-at-6.27.02\u202fPM-300x32.png 300w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-content\/uploads\/sites\/364\/2025\/04\/Screenshot-2025-04-19-at-6.27.02\u202fPM-768x82.png 768w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-content\/uploads\/sites\/364\/2025\/04\/Screenshot-2025-04-19-at-6.27.02\u202fPM-1024x109.png 1024w\" sizes=\"(max-width: 730px) 100vw, 730px\" \/>Tested the optimization algorithm. Measured the latency<span style=\"font-size: 1rem\">, with the full scheduling computation consistently completing within 500ms to 1.5s. This ensures that users receive near-instant recommendations<\/span><\/li>\n<li>Evaluated how well the algorithm responds to price shifts\u00a0by 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\u20132 PM and observed the optimizer shifting device usage accordingly, validating the integration of renewable energy forecasts into the objective function.<\/li>\n<li>Verified solver stability and objective sensitivity to weights which include grid price and solar output.<\/li>\n<li><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-291\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-content\/uploads\/sites\/364\/2025\/04\/Screenshot-2025-04-19-at-6.58.05\u202fPM-300x84.png\" alt=\"\" width=\"436\" height=\"122\" srcset=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-content\/uploads\/sites\/364\/2025\/04\/Screenshot-2025-04-19-at-6.58.05\u202fPM-300x84.png 300w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-content\/uploads\/sites\/364\/2025\/04\/Screenshot-2025-04-19-at-6.58.05\u202fPM-768x215.png 768w, http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-content\/uploads\/sites\/364\/2025\/04\/Screenshot-2025-04-19-at-6.58.05\u202fPM.png 978w\" sizes=\"(max-width: 436px) 100vw, 436px\" \/><\/li>\n<\/ul>\n<p><strong>Progress<\/strong><\/p>\n<ul>\n<li>The Software &#8211; Embedded Layer actuation is done.<\/li>\n<li>I faced issues with\u00a0ML model integration\u2014currently, 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)\u00a0in 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.<\/li>\n<\/ul>\n<p><strong>Next Steps<\/strong><\/p>\n<ul>\n<li>\n<p class=\"\">Add More Devices to Dashboard:<\/p>\n<ul>\n<li class=\"\">\n<p class=\"\">Extend the devices list to include the other speaker and motors. On the dashboard will create a filter to view\u00a0\u00a0power sensor mapping for each new device\u00a0for usage tracking and optimization.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p class=\"\"><span style=\"font-size: 1rem\">Refactor current ML routes to load models <\/span><strong style=\"font-size: 1rem\">once during app startup<\/strong><span style=\"font-size: 1rem\"> instead of per-request.<\/span><span style=\"font-size: 1rem\">Use a tool<\/span><span style=\"font-size: 1rem\">\u00a0to preload models and serve fast predictions.<\/span><\/p>\n<p><strong>Knowledge and Tools<\/strong><\/p>\n<ul>\n<li class=\"\">\n<p class=\"\">FastAPI &amp; Jinja2 Templating: I had to learn FastAPI for building a responsive backend, and how to integrate it with Jinja2 for rendering dynamic HTML dashboards.<\/p>\n<\/li>\n<li class=\"\">\n<p class=\"\">Home Assistant API Integration: I learned how to query real-time sensor states, parse device schedules, and handle authentication with Home Assistant&#8217;s REST API.<\/p>\n<\/li>\n<li class=\"\">\n<p class=\"\">Linear Programming with PuLP: I explored energy cost minimization and scheduling using linear programming, learning how to define decision variables, objective functions, and constraints.<\/p>\n<\/li>\n<li class=\"\">\n<p class=\"\">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.<\/p>\n<\/li>\n<li class=\"\">\n<p class=\"\">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<\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Work Accomplished Integrated the devices (Big LED, PWM Fans) to the dashboard. Implemented real-time device control through the dashboard with \u201cTurn On\/Off\u201d 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 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/2025\/04\/19\/anyas-status-report-for-04-19\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Anya&#8217;s Status Report for 04\/19&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1050,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-json\/wp\/v2\/posts\/289"}],"collection":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-json\/wp\/v2\/users\/1050"}],"replies":[{"embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-json\/wp\/v2\/comments?post=289"}],"version-history":[{"count":4,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-json\/wp\/v2\/posts\/289\/revisions"}],"predecessor-version":[{"id":297,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-json\/wp\/v2\/posts\/289\/revisions\/297"}],"wp:attachment":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-json\/wp\/v2\/media?parent=289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-json\/wp\/v2\/categories?post=289"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s25-teamd5\/wp-json\/wp\/v2\/tags?post=289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}