Hestia — Solar Hydrogen for Buildings
A building on its own sun, through heat and cuts: it plans for the outage and keeps one cool room going
- Context
- PFA team project, carried on as a product · INSAT
- Role
- Led the PFA software, then built Hestia from it
- Team
- 3 on the PFA bench; Hestia solo
- Period
- 2026
The problem
In the summer of 2026, Ariana and the rest of Grand Tunis lost power again and again in the hottest hours. People needed one cool room, a fridge that held and a charged phone, while the sun beat on every roof. A building with solar, a battery and hydrogen can carry them through, if something plans for the cut rather than the bill, and if the people living next to it can tell whether the gas detector still works.
What I built
- A model of the building's place: the hours the grid strains, the price of each hour, and the cuts, 3 to 6 hours at any hour of a hot spell, plus the worst day lived in 2026 (16 hours off, 2 back, 5 off) as a test.
- What the building is for (a home, a clinic or pharmacy, an office, a school, an equipment room), each with its own loads, schedule, temperature limits and what must stay on in a cut.
- A year plan for what stored hydrogen is worth each day, then a 48-hour plan every hour (a linear program, solved in milliseconds): what to store, what to use, what to hold back for a cut.
- An ESP32 safety controller and a Python gateway that run the same rules, checked against one set of test vectors; two-stage hydrogen detection, a trust layer that stops production when the detector can't be believed, and a signed safety journal.
- A private simulator for every visitor on a real year of weather, in Tunis or in France, and a planner that sizes the system on the same physics.
Inside the decisions
Planning for the cut, not the bill
Most energy tools optimise what the building pays. In a Tunis summer the question is different: when the grid goes down at 8 pm and it's still 36 °C outside, is there a cool room left? So the plan keeps the battery's reserve through the hot afternoon instead of selling it, pre-cools the building on the last sun, and draws the reserve only when the cut comes.
The test is the worst day people actually lived in 2026: 46 °C, the grid down from 9 am. On the demo home, the sun, then the battery, then the fuel cell keep the house at 26-27 °C through it.

From a bench to a building
The PFA bench kept its control simple on purpose: threshold rules on an ESP32, pumps on and off, an e-mail on any fault. For a prototype on a lab table, with its team beside it, that was the right scale. A building is another matter: someone lives next to it, and an inspector will ask what happened last March.
So the rules came out of the firmware into a written spec, with test vectors that the C++ controller and the Python twin both have to pass. Writing it settled cases a supervised bench never had to: interlocks hold in manual mode too, and an over-temperature stops production while the cooling keeps running.

Can the detector still be believed?
A poisoned hydrogen sensor keeps reading perfectly normal air. Nothing on the screen looks wrong.
Each sensor is watched for drift, freezing and silence; bump tests and calibrations are scheduled, and pass or fail is computed from the readings, never ticked by hand. No trusted detector, no production. Every alarm, reset and check goes into a journal where changing one past line breaks the chain.

Where should the sun go?
In Tunis, a kWh sold to the grid avoids 0.47 kg of CO₂. The same kWh through the stack, the tank and the fuel cell comes back in winter worth 0.15 kg. So every site gets a merit order: CO₂ at 300 € a tonne, plus the money. Battery, grid, then hydrogen in Tunis; in Paris, with a clean grid and dear power, hydrogen comes before the grid.
Hydrogen ends up doing what only it can: carry summer into winter, and take the sun nobody else will.

An honest answer
On the demo home in Tunis, solar and a 10 kWh battery already get it through every cut of the year: from 87 hours without cooling or heat today to none, and the worst day held. Hydrogen adds the rest: self-sufficiency from 95 to 100 %, and a reserve of days instead of hours (about 8.5 hours of essentials on the battery, about 6.6 days on a full tank).
On money alone, that costs about 29,400 € more than solar and a battery over twenty years. The planner says so first, then shows what the extra buys.

The outcome
A building that plans for its own place and its worst day, supervises itself and can prove its safety record; a simulator where anyone can live a heatwave cut, a Paris peak or a leak; and a planner that tells the truth about cost.
What would come next
- A certified hydrogen detector and pressure vessel in place of the bench parts.
- The certification path: ISO 22734 for the generator, ISO 26142 and IEC 60079-29-2 for detection and its upkeep.




