DEV Community

Cover image for Agentic engineering a smart home energy system with Antigravity and Gemini 4

Agentic engineering a smart home energy system with Antigravity and Gemini 4

Remigiusz Samborski on November 20, 2026

Running rooftop solar, a home battery, two electric vehicles (EVs), and dynamic hourly electricity tariffs requires tight coordination. Without aut...
Collapse
 
nark3d profile image
Adam Lewis •

Planner robustness across a full season concerns me more than a weekend run. Sticky schedules make sense against a stateless rewrite, but forecast error plus a tariff API that changes its publishing shape means a lock on the day-ahead horizon needs re-deriving on fresh data. If the guard unlocks cleanly on a new horizon and a regime flip, the rest probably rides. Keep the dry-run to live switch on every update.

Collapse
 
rsamborski profile image
Remigiusz Samborski Google AI •

Good suggestion. I am doing this right now. This weekend uncovered another edge case, but thanks to Gemini implementing adjustments is super fast.

Btw. I also started using Antigravity's remote control, so now I can directly chat with the agent from my mobile phone to spin new feature development from my couch while enjoying GTA 6 😉

Collapse
 
programmer_arnab_96fb057e profile image
Programmer Arnab •

One caveat worth designing for: battery-vs-EV ordering can oscillate when solar, load, and hourly prices change within the same slot. A small hysteresis/deadband plus a priority queue—EV load before grid-charg

Collapse
 
rsamborski profile image
Remigiusz Samborski Google AI •

Thanks. Worth considering.

Collapse
 
alexshev profile image
Alex Shev •

Energy automation needs a safe degraded mode. I would make the system state explicit when prices, sensor readings, or forecasts are stale, then fall back to a conservative schedule rather than optimizing on uncertain inputs. That is where agentic planning meets the real cost of a wrong action.

Collapse
 
rsamborski profile image
Remigiusz Samborski Google AI •

Thanks. I'll definitely give it a though.

Collapse
 
useaifix profile image
AIFix •

The part about blocking the EV's hours before scheduling the cheapest battery windows is a smart detail, since a car quietly draining grid-bought power from the home battery is easy to miss. Did the --dry-run flag catch any bad schedules before they reached the inverter, or did the offline tests cover most of that?

Collapse
 
rsamborski profile image
Remigiusz Samborski Google AI •

This particular detail was based on my personal experience when manually managing the battery. The --dru-run flag is safety measurement, because so far I haven't seen any drastic problems with the scheduler. There are minor edge cases which I still keep uncovering - for example just yesterday the system suggested charging while the EV was not at home. I have quickly implemented a geo fencing feature and a way to manually postpone charging.

Collapse
 
sara_builds profile image
Sara •

I like that the planner keeps a charging window stable instead of recalculating it from the battery’s changing state of charge. I’ve seen schedulers churn when inputs update faster than the action window; tying the plan to the active tariff horizon seems like a clean guard. How do you handle a stale inverter reading during that window?

Collapse
 
rsamborski profile image
Remigiusz Samborski Google AI •

Sorry, but I don't fully understand what you mean by 'stalve inverter reading'. Can you clarify?

Collapse
 
robertpaschal profile image
Odinaka Robert Nnamani •

a stateless planner recalculating every 30 minutes and shrinking its own window. that is a bug that only shows up live.

Collapse
 
emilywoodsnyc profile image
Emily Woods •

The 48 scheduled runs against a 50 request daily quota leave very little room for probes or retries. I’d want those paths to share one request budget, plus a clear fallback when vehicle data is stale. This rate limiter design question is a useful follow-up to the cron plan, what happens when a retry consumes the final allowance before the next scheduled run?

Collapse
 
mudassirworks profile image
Mudassir Khan •

the ADR plus execution plan before a single py file is the part that makes the coding pass work, imo. what bit us was agents quietly editing the plan file to match what they built, so the spec drifted toward the code instead of the other way around. we now treat the planning docs as read only for the coding model. do you let it touch docs/planning during implementation, or only the task list?

Collapse
 
vijay_javadev profile image
Vijay Rathi •

Really nice article. Have you also added support for MQTT (telemetry etc reporting) Would love to do such IOT integration with my account at basepit.com they have webhook support too for n8n like flow .
Again, cool post. keep doing