I've been building an AI agent system called FlatNine Ensemble, a team of 20 specialized AI agents that run my business and personal life 24/7. Recently, I connected them to the physical devices in my home. Here's what happened.

The Setup

My home in Puglia (the heel of Italy!) has a 16.5 kW solar panel system with a 20 kWh battery, 8 security cameras, smart thermostats, a Google Nest Hub, and various other connected devices. All accessible via APIs and local network protocols.

I gave my AI agents access to all of it.

Horace (the home automation agent) manages climate control, cameras, and smart devices. It also helps my parents interact with it all via Telegram, in Italian, naturally. And Wayne (the CEO agent) ties it all together with monitoring, analysis, and proactive insights.

Predicting Solar Production with a Regression Model

The most interesting piece has been building a predictive model for the solar system. We have a GoodWe inverter setup that feeds real-time data: production, consumption, battery state of charge, and grid import/export.

I started by collecting historical data: every 15 minutes of solar readings alongside weather conditions (irradiance, temperature, humidity) and time of day. Then I fitted a multiple regression model.

The Model

The model predicts instantaneous solar production (kW) as a function of weather conditions and time of day:

The Fitted Equation

$$\boxed{\begin{aligned} p_{system} = &-6.45 \\ &+ (-0.0185 + 0.0002 \cdot temperature + 0.0001 \cdot humidity + 0.0010 \cdot hour) \cdot irradiance \\ &+ 0.00001 \cdot irradiance^2 \\ &- 0.0473 \cdot humidity \\ &+ 2.1574 \cdot hour - 0.0878 \cdot hour^2 \end{aligned}}$$

The model explains 74.8% of the variance in solar production (R² = 0.748). The quadratic irradiance term (irradiance²) captures the non-linear relationship between sunlight intensity and output, while the quadratic hour term (hour²) models the bell curve of production across the day.

The Key Insight: Interaction Effects

The most revealing finding is that irradiance doesn't have a fixed effect on production. Its impact depends on three conditions through interaction terms:

  • irradiance x temperature (+0.0002): Hotter days produce more power per unit of irradiance. This might seem counterintuitive (heat usually reduces panel efficiency), but the effect likely captures that hot, clear days coincide with optimal sun angles and sustained high irradiance periods.

  • irradiance x humidity (+0.0001): A small positive interaction, likely capturing that moderate humidity days with high irradiance still produce well.

  • irradiance x hour (+0.0010): Later hours produce more per unit of irradiance. This reflects our panel orientation, as the panels face south-west, so afternoon sun hits them more directly.

These interactions mean the model captures the context of solar production, not just raw inputs. A cloudy morning and a clear afternoon with the same average irradiance will produce very different totals, and the model knows this.

The Scatterplot

Here's the actual vs. predicted production scatter: the diagonal clustering shows the model tracks reality well, with the expected spread at higher production levels:

Solar Scatter Matrix

What the Agents Do With This

Morning Forecast

Every morning at 7:30, my parents receive a Telegram digest that includes the day's solar forecast.

The forecast uses Open-Meteo's hourly weather data, runs each hour through the regression equation, and simulates battery charge/discharge to predict when the battery will be full and how much surplus goes to the grid.

On-Demand Queries

My father can ask:

  • "How much energy will we produce tomorrow?": gets an hourly breakdown
  • "Forecast for the week": 7-day forecast with daily totals
  • "How's the solar situation now?": live production, battery SOC, grid status

Real-Time Monitoring

The agents pull live data from the GoodWe SEMS API: current production, battery state of charge, grid import/export, and inverter health. If something goes wrong, they know.

Beyond Solar: The Full Smart Home Stack

The solar model is just one piece. Here's what else the AI agents control:

Security cameras: 8 channels, 1080p via RTSP. The agents can grab live snapshots, historical frames at any time, or extract video clips. They send a pool photo every morning with the digest.

Climate control: Smart thermostats throughout the house. Horace monitors temperatures and can adjust settings remotely.

Announcements: Text-to-speech and voice message casting to the kitchen Nest Hub. I can record a voice note on Telegram and it plays through the speaker at home, 1000 km away.

Device monitoring: The agents ping all 13+ network devices and report status. If the DVR goes offline or a thermostat disconnects, it shows up in the morning report.

The Family Digest

Every morning at 7:30, my parents get a complete briefing:

  1. Weather for their town, from Open-Meteo
  2. Local news: 3 articles from local RSS feeds with context and links
  3. Villa status: devices health across the home
  4. Solar forecast: predicted production, battery, and grid export
  5. Pool photo: live camera snapshot

All in Italian, all automated, all from AI agents that never sleep.

What I Learned

Building this taught me a few things:

APIs are the universal language. Every device speaks a different protocol (RTSP, HTTP digest auth, Cast v2, REST), but wrapping them in a unified tool layer means the AI doesn't care about the plumbing. It just calls the right tool and gets results.

Regression models are underrated. Everyone reaches for neural networks, but a well-specified model with interaction and quadratic terms explained 75% of variance in solar production. It's interpretable, fast, and runs in a PHP function. No GPU required.

The family test is the real test. My parents aren't tech people. If they can ask an AI agent about their solar panels in Italian via Telegram and get a useful answer, the system works. If they can't, it doesn't matter how elegant the architecture is.

AI agents are most useful when they're proactive. The morning digest is more valuable than any on-demand query. My parents don't have to remember to check things: the information comes to them.