Homey acts, but remembers nothing
A Homey installation is surprisingly capable: flows that react to price signals, a charge point that follows the sun, a home battery that fills up overnight during the cheapest quarter-hour. What a Homey doesn't do is remember. There's no place where "what happened yesterday" meets "what it cost" and "whether it even made sense". Every flow is an isolated little reflex; nobody — human or system — sees the whole picture.
Homey_Log is the layer that fills that gap: a Node.js server with its own SQLite database running alongside the Homey, recording everything that happens, layering a 3D twin of the house on top, and then turning an AI analyst loose on it to work through the numbers daily — and weekly, in greater depth. Not to operate the thermostat itself, but to say: "this pattern is off, you're losing money here, want me to adjust this script?" — and, under strict conditions, to run a small, reversible trial of its own.
Architecture at a glance
Homey_Log is an Express server (Node.js) with better-sqlite3 for storage, running under PM2 on its
own host. Homey remains the source of truth for devices, flows and logic variables — Homey_Log talks to it through
two deliberately separate channels:
- Push, from HomeyScript. Scripts that already run on the Homey send a log line to the server after every run. No polling, no delay, and the text is exactly what the script itself decided.
- Poll, from the server. For everything Homey_Log has to fetch itself or needs to be able to operate, the server talks through the local Homey Web API — or, where possible, directly to the device itself, such as the smart meter, the charge point and the home batteries.
The admin environment is a single page with a two-row navigation: five groups at the top — Energy, House, Agent, Sources and System — and below them the pages of the group you're in. The layout follows the question you're asking: what is my energy doing, what is my house doing, what does the system make of it, what happened in raw form, and how is the app itself doing. Every analysis page opens with one line that tells you what you're looking at — for instance that a break in a line is a period without measurements, not a value of zero. That line sits above the chart, because below it you only read it after you've already misread the lines; it can be adjusted per page in Settings.
That admin environment is one of three entry points, each with its own audience. The desktop site is the full toolkit: 35 pages, every detail, every button. The wall tablet in the dining room runs the family dashboard — big tiles, no administration. And on the phone sits the "Thuis" app ("Home"), which boils the house down to what you want to know when you're out. The rule between them is strict: the phone never shows anything the main app doesn't have. Parity or less, never more — otherwise you end up with two truths about the same house.
The app has personal accounts. Each family member signs in once per device and the app remembers it; what you then see and may do depends on your role. Those roles form a single ladder of four rungs, each including everything below it: read is look only; housemate may additionally control comfort around the house — lights, moods, curtains and the robot vacuum; operate may control everything, from the car and the dishwasher to the boiler and the operating modes; and admin is the full toolkit: settings, rules, accounts and the technical sources. The navigation only shows what belongs to your role. The conversation with the analyst is separate, switched on or off per person — a chat window with the whole house as context is something you grant deliberately, not automatically.
Who may do what is decided by the server, in one place. The browser doesn't even know the role names: on sign-in it only receives the rungs this account reaches, and uses them to hide what doesn't belong. A hidden button is a convenience, not security — the server refuses regardless, and tests guard that every write route is protected and that the rung below really gets a refusal.
Everything under /api sits behind that same gate, reading included. The open list is short
and argued line by line: the wall tablet has no sign-in screen — a wall display you first have to type a password
into has lost its purpose — and the entrance through which Homey delivers its log lines stays open, so the data
source doesn't go silent at a moment when nobody is watching.
Even inside the house, phone and wall tablet talk over an encrypted connection, with a valid certificate handled by a small proxy (Caddy). That's no luxury: a phone only hands over its location and its notifications to a web app on a secure address.
Record everything — the house's logbook
The foundation is a logbook: timestamp, source, level, message and a bundle of data per line. Next to it sits a whole series of tables that aren't there by accident but are the traces of months of "turns out this isn't right": energy per quarter-hour (the finest grain), per day and per month for older years, individual device signals, changes to logic variables, and a history of the flows and scripts themselves — so the AI layer can later say "this behavior changed on the same day you edited that flow".
A recurring pattern: a derived table looks current but has stalled. When in doubt, the rule is therefore not the tidy derived table but the raw log line the script itself wrote. That is written down, literally, as a method item in the AI's internal schema guide.
Every line gets an importance: debug (routine), info (an outcome), warning or error. Devices speak their own language — the charge point says "WARNING" or "COM" — and whoever quietly files that as "routine" hides real warnings: that is how 74 charge-point warnings once stayed invisible for months. So one place decides, in three steps: if the device itself uses one of the four words, that counts; otherwise a list of translation rules that Marc manages in Settings is consulted; and if nothing matches, the line gets the fifth level, unknown — a to-do list, not an error. The original term is always kept, so a wrong judgement can later be corrected over the stored lines.
A translation rule that can never take effect, because a rule above it already catches everything it would, is refused on save, naming the rule that catches it — so the list you read is also the list that runs. Better to say "I don't know" out loud than to let a silent assumption start living as fact.
When a broken smart plug is replaced, Homey gives the new unit a brand-new device ID — as if it were a different device. For the household it's simply "the TV plug". So every physical device hangs off a logical device, and settings such as "count towards consumption" belong to that logical level. 👤 When a device is replaced, Marc marks the old one in Settings as "replaced by…" (deliberately by hand, never guessed automatically), 🤖 after which history and settings carry on seamlessly — right down to the 3D house, where an outdated reference is quietly routed to the replacement. The raw measurement data stays untouched; the logical layer is a pair of reading glasses on top.
Each source delivers its own part of a quarter-hour, and an unreadable source only leaves an empty field for itself. The last known meter reading is not overwritten on such an error, so missed energy arrives as a catch-up sum once the source recovers instead of evaporating. The car's charging consumption comes straight from the charge point's own meter. And what is physically impossible — more solar than the roof can deliver, more than a home battery can handle in a quarter-hour — doesn't get in: such a value is rejected and reported once per quarter-hour, rather than skewing a daily total years later.
All that recording means the database grows every day. The clean-up system therefore looks not per table but per role: irreplaceable measurement base, high-frequency diagnostic noise, rare meaningful event, or something that must never go. Each role has its own retention period and a hard floor, tied to what the data is used for; if a period is accidentally set shorter, that table is skipped rather than cleaned up. The trigger was an older, blunt rule that threw away everything older than two years — including the solar history back to 2018. That history has been retrieved again from the inverter API, and the solar series has a floor of 4,000 days.
👤 Marc chooses per role: off, dry run (calculate and log what would be removed, without touching anything) or active. 🤖 Every night the system applies whatever is set. The measurement base and the events are off; only the diagnostic noise runs as a dry run, so there's a number to decide on before anything really disappears.
The digital twin: the house in 3D, live
On top of the log data sits a complete 3D model of the house — both floors, rooms, furniture, windows, dormers, right down to the toilet windows and the alcove under the stairs — captured in a model file thousands of lines long and rendered by a client script of its own. This isn't decoration: it's a live layer on top of the Homey Web API. Devices take on the color of their actual state (a lamp that's on glows, a room that's too warm gets a different temperature color), and you can operate them directly — clicking switches a device on or off, right-clicking opens a panel for dimming, color, white tone or a camera frame.
Besides switching layers on and off, the view has an Exploded mode: one button takes the house apart, with roof, attic, first floor and ground floor laid out side by side as separate panels. That way you can see at a glance which lamp is still on somewhere in the house, without peeling it floor by floor.
Reading and writing use two separate keys: a read-only key for the constant status poll, and a write key that is only used on an explicit click, with a hard allowlist of what the twin may control (on/off, dimming, color, color temperature).
The house's time chart shows not only energy flows but also an event overlay: control actions from the twin appear as markers on the same timeline as consumption. That makes "why did consumption jump at 21:40" traceable to a concrete action in two clicks.
From data to euros — what it costs you and what it earns
Raw quarter-hour data is worthless without a consistent calculation model on top. That model — which kWh counts as "import", when solar counts, how a negative PV signal is ignored — lives in one module reused by every screen, guarded by a check that holds the server-wide totals against that module. The rule of thumb behind it — "consistent beats exact" — means a month is always exactly the sum of its days and a year exactly the sum of its months, even if that's a few kWh off from a separate, older source document.
On that foundation sit tiles and pop-ups that reckon in concrete euros rather than bare kWh:
| View | What it shows |
|---|---|
| Self-sufficiency / direct solar | which share of consumption didn't come from the grid, measured on the import of the main meter itself. The car and the boiler stay out of the headline percentage — they deliberately charge on price, not on sun, and would otherwise flatten a figure about the house every charging night |
| Effect tile (solar + battery + gas-free) | the euro effect per full month of three measures combined — it can come out negative if the telemetry has a gap, and is then shown as such rather than guessed as zero |
| Standby consumption | the baseload (median of the lowest hour per day) plus a top 10 of likely culprits with payback period, with a hard exclusion for fridge, freezer, server and alarm |
| Charging price per car | the average charging cost per kWh over the chosen period, per car, with how far it differs from the average grid price; the popup of each car tile also shows its charging sessions and the solar/grid split |
| Gas-free effect | the kWh of the heat pump (outdoor unit, controller and backup heater together) and of the hot water, converted into a hypothetical gas scenario at current gas prices |
If in the same quarter-hour the car is charging and the house is running, and the meter reports import — whose electricity is that? The answer comes from the meter itself, not from a reconstruction. Per quarter-hour, the measured import is divided: first the house gets its own residual load, then the deliberately excluded devices (car, boiler) get at most their own measured energy. That way a charging session can't pollute the house figures, and the house can't pollute the charging figures either.
Import above the total house load can't logically exist, yet it occurs: the smart meter's clock runs slightly ahead of the devices'. That surplus therefore follows the neighbouring quarter-hours — if there was charging activity just before or after, it belongs to whoever caused it, otherwise to the house. The boundary is hard: house import plus device import is always exactly the measured import, and neither goes negative.
The Power tab is one continuous timeline that picks its own grain — quarter-hour, day, month, year — rather than a separate "history" section. Its solar series runs at quarter-hour resolution back to the installation in January 2018, from the inverter manufacturer's API: both inverters sit behind a single site, and the series is split per month between the two according to their own production counters. The yield matches the manufacturer's portal to within a few percent, which makes that portal the independent ground truth for solar.
Boiler and water
What the boiler costs, down to the session. The boiler tile in the Usage tab splits consumption into solar (free), battery and grid (at the quarter-hour price), with a stacked bar chart: yellow is solar, dark green the battery, grey the grid. The split is made per quarter-hour in a fixed order — grid first, then the battery, whatever remains is solar — so power from a discharging battery is never "solar". The tile also says what the boiler is heating on right now ("on solar", "on battery", "on solar and grid"), and below it are the individual sessions with import and what they cost; sessions that ran entirely on solar are combined into one line ("free").
Alongside all the period figures there are two tiles that simply show now: the charge level of the home batteries, and the boiler's current water temperature (with a shower icon when someone is showering). They come from exactly the same source as the wall tablet, and deliberately don't follow the period picker.
The water temperature, actually measured. A Shelly on the boiler measures the water. That measurement feeds the tiles and the Boiler analysis tab, with three series in one chart — water temperature, litres per shower and the boiler's electricity use — each with its own axis and a checkbox to switch it on or off. That way you see the story of a day: the boiler cools down, someone showers, the temperature drops, and a little later the element heats up again. Where nothing was measured, the line shows a gap rather than a dead-straight stroke. A watchdog reports it when the measurement goes silent, but only after three failed readings in a row — Homey occasionally returns a single empty reading, and a watchdog that reacts to it mostly sends alarm-and-all-clear for nothing. A measurement that stops altogether is reported immediately.
Litres per shower. The same Shelly counts the water pulses on the shower's hot-water pipe. When Homey notices someone is showering, the server opens a session and closes it itself as soon as the counter has stood still for a few minutes. The session starts at the counter reading from two minutes before the notification, because that notification structurally arrives a minute and a half after the tap is turned on — without that correction, most of a short shower fell outside the picture. The raw measurement is kept alongside the corrected one. Pulses become litres via a calibration card in Settings ("now draw off a known amount"), and each shower also shows its temperature drop: how many degrees the boiler fell.
The whole-house water meter. In the meter cupboard hangs a water meter with its own network connection, which the server reads directly — deliberately not via Homey, because there a stalled meter can't be told apart from a house where no water is running. Household water has its own Water tab rather than being an extra line on the boiler chart: two series that are both called "litres" but measure something different read as a comparison they aren't. The house meter counts all water, cold included; during a shower it always shows more than the shower counter, and that difference is mostly the cold water the mixer tap adds.
Water running uninterrupted for a long time is the pattern of a running toilet float or a leak; a shower, the washing machine and the dishes all stop by themselves. If more than half a litre per minute runs uninterrupted for longer than forty-five minutes, 👤 Marc gets a notification — at most once every six hours. A short dip to zero (the meter sometimes skips a beat) doesn't reset the count. Nothing is shut off; the house only warns. The thresholds are in Settings.
The house looks ahead: what will the sun do?
To be able to plan — when does the car charge, when does the boiler heat, when does the battery charge — the house has to be able to guess something about tomorrow. So Homey_Log fetches a solar forecast every hour, and keeps it. Keeping it is the whole trick: what the house thought yesterday the sun would do today can't be fetched anywhere tomorrow — unless you write it down. And it's exactly the difference between expectation and reality that makes you smarter later.
The Forecast.Solar device in Homey seemed to work, but it described 3.6 kilowatt-peak on a single roof face, while there are 11.6 kilowatt-peak on four roof faces. Homey_Log therefore requests the forecast itself, per roof face, and takes into account that the inverters clip the peak on a bright afternoon — there's one and a half times as much panel capacity on the roof as they can pass through. The installation lives in Settings; a roof face that 👤 Marc hasn't filled in himself visibly carries the word estimate.
Two sources sit side by side. The paid service is told every round how much has already been harvested today and rescales the rest of the day — per inverter, because an inverter can't say which roof did what. The house plans on a free weather service, Open-Meteo: on its own it is the least far off from reality, measured as absolute deviation — a source that's thirty percent too high one day and thirty percent too low the next averages out beautifully and is still useless. The paid service carries on as a comparison.
A weather model knows how much light falls, but not whether at a given hour of the day a chimney or a tree stands between the sun and a roof section. So the house adds a shade map: per hour of the day two factors, one for direct sunlight and one for diffuse light, learned from its own measurements. The input is the average of two weather models, converted to the irradiance on each sloping roof section. The map only learns from days around the same time of year (a month wide), never from yesterday or today, and pulls every factor towards 1 as long as there's little to learn from; below twenty usable hours it stays at 1. Every forecast comes with a band, from the twenty days that most resemble this one.
The map is the official forecast as long as its latest round is at most six hours old; otherwise the house falls back to the raw forecast with a learned daily factor. A manual factor in Settings works on both as an emergency brake. And every night a check looks at whether the measured sun over the last thirty days comes out between 0.8 and 1.2 times the map; if not, a notification follows.
In the Power tab two extra lines can be switched on: what the house expected the evening before — that's what you know when you have to decide whether the car charges tonight — and what it made of it as the day went on. The period picker here also has Tomorrow, with the note that this is an expectation, not a verdict. For days without a stored forecast the lines stay empty, not zero: back then the house didn't expect zero sun, it expected nothing.
That brings a rule that holds in every chart in the app: solid is measured, dashed is forecast. A measured line stops at the last full hour, and that's exactly where the dashed line picks it up. Every line that's drawn is in the legend, including the forecast ones: a line without a name is a riddle you get to solve yourself.
Next to the chart sits a verdict in two numbers. The bias says whether the house systematically forecasts too low or too high — then the roof data or the damping isn't right yet, and that you can fix. The typical deviation is the unpredictability of the weather itself, and the upper limit of what planning ahead can ever win. Hours with barely any sun don't count, and as long as there are too few usable hours, the screen shows no percentage but says there isn't enough data yet.
The AI that combs through it every day
The heart of the system is an agent pipeline that works through the data daily and — in greater depth — weekly. The analyst doesn't get a loose little prompt, but a built-up context:
- a house profile: geometry derived automatically from the 3D model, supplemented with manual facts — the AI may propose a new fact itself, which then waits for approval;
- a schema guide: a living document that describes exactly which table is the truth for which question, pitfalls included — the accumulated knowledge of months of debugging, so the AI doesn't have to rediscover it every time;
- active rules and troubleshooting recipes that Marc has recorded;
- a growing memory of learned lessons — things that did or didn't turn out to work in this house.
The analyst may not change anything about the house itself, but it may leave three kinds of notes, each in its own place: a house fact (waits for confirmation in Settings), a rule for its own interpretation, and a proposal for a concrete change that appears in the Proposals tab and goes through the same self-check as a proposal from the daily report. For its reasoning it has a read-only SQL tool over its own database, so a hypothesis ("does this pattern hold last month too?") can be tested on the spot. The language model is interchangeable — Anthropic, OpenAI, OpenRouter or a local model, configurable per task — and every call is logged with its token cost, all the way to its own "AI costs" tab.
After each run the analyst may record at most three generalisable lessons — method lessons ("I should check this blind spot from now on") or outcome lessons ("this measure did/didn't work in this house") — and withdraw a lesson when new data contradicts it. Marc can always restore any lesson: the system may steer itself, but not out of sight.
The lessons enter the daily prompt within a fixed character budget, with two rules: at most two lessons per topic, and Marc's own corrections first. Without those rules the pile wins, and the analyst mostly reads itself back. For the same reason, a proposal closed by the self-check doesn't become a lesson: a system that stores its own verdicts as human judgement grows ever more certain of its own assumptions.
The most dangerous thing a self-learning system can do is quote itself. One finding reported the "fifth occurrence in three weeks" of a fault that had long been fixed, and the only evidence was earlier reports making the same claim — with, as advice, a warranty claim for a defect that wasn't there. If a finding claims repetition, at least one log line from its own analysis window must therefore back it up. If not, the "again" claim disappears and only the observation remains.
The daily analysis runs at half past six in the morning, the deeper weekly review on Saturday morning; per run the model is configurable, as is how much thinking it may do. The analyst also reads what Homey_Log reports about its own control: control settings that expire on the Homey because the server didn't refresh them are an incident to it, not noise.
The conversation
Next to the reports there's the chat: the same model, but on your question. A conversation starts lean — a small fixed core, the state of the house at the moment of the question, and a short first answer — and fetches the rest in a targeted way with functional tools: the current state, energy, charging, the boiler, the conductor, solar, prices, climate, water, the heat pump, faults. Those tools call the same functions as the screens, so the chat quotes the same numbers as the app, and they follow the role ladder: what your account isn't allowed to see isn't offered to the chat either. Windows such as "last night" or "yesterday" are worked out by the server, daylight saving included. Ask whether anything is going on and you get at most eight lines from the existing watchdogs, with the same damping as the notifications.
The answer visibly grows as it's written, with a line saying what the analyst is looking at right then; if that stream fails, the app polls as always. The full chat, with the whole context of the daily report, is one switch away in Settings.
Proposals instead of a black box
A finding by the analyst is never carried out silently. Every finding is an observation (something stood out — only to be ticked off as "read") or an action (a concrete proposal with buttons: approve, reject with a note, or review later). The badge in the navigation counts only the real action proposals.
Besides manual review by Marc, the same pipeline has three forms of controlled self-steering:
| Tier | Does |
|---|---|
| Tier 1 — auto-verification | closes proposals that demonstrably don't hold up: a problem that already fixed itself, a title that no longer matches the date, a claim about a script that the system checks against the script code itself, or evidence that can't be found in any log line. The daily notification only counts after this self-check, so a proposal that closes seconds later doesn't show up as "new" |
| Tier 2 — experiment routing | translates a testable hypothesis into a draft experiment, validated against the Homey variables that actually exist — only carried out after approval in the Experiments tab |
| Tier 3 — script proposals | generates a complete script proposal with a diff against the current script; diffs that only change comments or text are rejected |
A deliberate choice: there is no "doubtful, review this yourself" category. If something demonstrably doesn't hold up, the system closes it — an in-between category would only add review work without value.
The house experiments on itself
The most advanced form of self-steering is the Experiments phase: if a hypothesis meets strict conditions, the analyst may propose a targeted, time-limited trial instead of merely reporting on it. The hypothesis must be measurable on a fixed list of KPIs (cost, import, export, solar yield, battery behavior …), the change must be on a short allowlist — setting a logic variable to a value, or switching a specific flow on/off — and the system reads the starting value itself beforehand, so rolling back is guaranteed.
Around that core sit safety nets, each of which came from an explicit requirement of Marc's:
- a master switch, off by default — proposing and approving sit behind it, but aborting and rolling back always work, even with the switch off;
- an A/B schedule that alternates day by day between the new and the old setting, so an effect can't be confused with chance;
- an automatic emergency stop on guarded limit metrics: if cost or import goes outside a margin set in advance, the experiment is rolled back immediately, with a loud notification and a forced "this didn't work" lesson.
The first experiment was about the home battery during the car's overnight charging: not parking it, but balancing to "zero plus the car's charging power" — the mechanism described further down under XOM. Along the way, exactly the kind of fault this system is meant to find turned up: a charging session didn't start despite a correct charging plan, because the flows that were supposed to switch on the charge point had been off for weeks, awaiting a takeover by a script that had never been finished. Found, fixed and proven on the real charge point within a day.
What Homey already handles on its own — and how the AI layer watches along
Lights, scenes, curtains and the dozens of small automations in a house run, as befits an extensive Homey installation, in a network of flows and HomeyScripts; Homey_Log watches along, records and proposes. For the four large consumers that can be shifted — the home battery, the boiler, the dishwasher and the car on the charge point — the division of roles is different: there the server decides, and for three of the four it also carries out the decision itself, talking directly to the device. Only the boiler goes through the Homey, because it can only be reached by radio. How the server decides is in the next two chapters; this chapter is about what's on the controls.
Charging on day-ahead prices
The charging plan for the night is made by the conductor: it divides the night into quarter-hours and decides per quarter-hour whether the car charges, with a separate regime for quarter-hours with a negative price and a hard departure time. When a car is plugged in, the charge point first gives a five-minute charging pulse at the lowest current — a car asleep at the charge point otherwise doesn't report its battery percentage — and only then does the normal setting follow. From that pulse the car screen can already tell that a car is plugged into our charge point, before the car's own telemetry reports it.
The charge point: Modbus, solar charging and the fuse
The charge point is in EMS mode and is controlled via Modbus TCP. That deliberately bypasses the charge point's own web server, which has a memory leak that a login every half minute drives up. The server is the only party talking to the charge point: the charge-point hand reads and writes every ten seconds over a single connection, keeps the charge point awake on a fixed rhythm, and reads back every command. No second writer runs alongside it, not on the Homey either.
That hand contains the solar charging: a controller that charges the car during the day purely on exported solar. Every ten seconds it works out the surplus, translates it into a current between 6 A and the charge point's configured maximum, and sends that to the charge point — a closed control loop, so the meter stays around zero. The solar window runs until that day's actual sunset. The controller measures per charging session whether the car charges on 1 or 3 phases and bases its thresholds on that; if there's too little sun for three phases, it can temporarily switch a car to one phase — always via a pause. The control is deliberately asymmetric: when a cloud passes, power goes down immediately, but before starting or stepping up it first waits for a few minutes of sustained surplus. All thresholds are adjustable in Settings ("Zon-laden — regelparameters", solar charging — control parameters).
One layer up: the conductor. The hand doesn't get its command through a variable on the Homey, but as a wish inside the server: charge at a given power, solar, pause or free, with how long that wish holds and what comes after it. If a car is plugged in that the conductor doesn't control, the charge point is set to free and charges unhindered. The human hand always comes first: the Auto laden nu (charge car now) button is a wish too, and the rest of the house plans around it.
The fuse, per grid phase. Charge point and house hang off the same three 25-amp main fuses. The server keeps a margin below that: 18 amps per phase during the day, 22 at night — by default from eleven to six, adjustable — because less switches on unexpectedly then. Never above 25; the server already refuses that when saving. To do this it has to know which wire of the charge point sits on which grid phase — and here two phases of the charge point are swapped relative to the grid, so a car on one phase loads exactly the phase the boiler is on as well. The mapping is in Settings, per wire or set to "unknown" (then the guard reckons with the worst conceivable mapping). Every night the night watch lays the measured current jumps next to the configured mapping; if it doesn't match, the guard falls back to the worst case. How the fuse counts in the planning is in the chapter on the brain.
The charge point up close. With a car on the cable the server reads the charge point every ten seconds, without one every half minute. The charging consumption per quarter-hour comes from the charge point's own meter, and the car tiles read the charge point through one fixed place in the mapping layer. There is no fallback to the Homey: if no fresh reading comes in, the charge point is called unreadable rather than an old value staying on screen. Twice a day a collector fetches the charge point's log, so restarts and load-balancing behavior can be investigated from within Homey_Log.
Two home batteries, one setting per quarter-hour
The batteries have four settings: xom — balancing near real-time to zero on the meter, with the consumption of car and boiler not counting —, charge at full power, negative charge at a negative price, and hold. Which setting a quarter-hour gets is worked out by the solver described in the chapter on the brain. If it can't deliver a usable plan in a round, a fixed day rule takes over; that rule only uses hold on a flat day, whose prices are known and differ by less than twenty percent: shifting back and forth then earns nothing and only costs efficiency.
The server controls both batteries directly through their local API: the control mode, the grid target on the batteries' meter dongle and the power, and it reads back every command. A command that doesn't arrive immediately says which battery got stuck on which setting. On the Homey there is only a watchdog: if it hears no heartbeat from the server for five minutes while the server is in control, it sets the grid target to zero and both batteries to their own zero-on-the-meter control. The batteries keep no fault history of their own; Homey_Log records every transition in their state, readable in the Sessy log tab and in the regular log.
The inverters and the network. The inverters don't offer a ready-made fault log either; Homey_Log derives it from their telemetry — fault modes, gaps during the day, insulation resistance, overheating and failed optimizers — and shows it in the SolarEdge log tab. And a network tool of Marc's own delivers, once a day, the list of all devices on the network, with IP and MAC address and whether they're online, as a reference for troubleshooting (Network tab).
The charge point and the battery: who wins? (XOM)
As soon as the car charges, the batteries mustn't simply balance along, because then part of the car's charging power would quietly come out of the battery. Parking them is safe but wasteful. So they balance to "zero plus the power that isn't theirs": the server sets an import target on the batteries' meter dongle, so they only cover the house — at most thirty changes an hour, each one read back. What the battery does and doesn't cover is defined in one place in the code; the planner and the hand use the same rule, and a test turns a second definition red.
That rule follows an exclusion list in Settings: devices the batteries don't compensate for, each with a threshold and a window — nights only, always, "fixed power" (only when the device charges on a plan or by hand, not during solar charging), or for the boiler "grid block only". During solar charging the surplus goes first to the batteries and the boiler and only then to the car, which has the cheap overnight plan as an alternative. A safety clamp ensures the system never leaves more uncovered than what the house is actually drawing at that moment — with a solar surplus, nothing happens.
The Usage chart makes this visible on every time scale: a yellow solar layer with a green battery layer on top behind the bars, and the excluded consumers stacked at the top of the bar with a ⚡ marker in the legend. That shows at a glance that precisely that consumption isn't covered by the battery. The charging of the batteries themselves is also a block in the bar: you expect it inside the yellow solar layer, except on nights when the battery tops up from the grid during the cheapest hours.
Dishwasher planning
The server starts the dishwasher itself, at the moment the conductor chooses; if the conductor stays silent, the machine starts at the latest possible start time, so it is finished on time in any case. On the screens the machine is only called planned once a run is really queued.
Starting happens directly with the machine over the home network: wake it from standby, start the planner's program — not whatever happens to be selected on the panel — and check that it really starts running; if not, it goes via the manufacturer's official cloud after all, with one notification a day that the local route is broken. The Homey is not part of this chain. The "start now" button and the automatic run go through the same hand, which remembers every start command. So for every run the server knows who started it: the planner, someone with the button, or someone at the machine itself. What gets planned is the cheapest hour, because the short 45-minute program does fine for this household — and, measured at the plug, even uses less than the long "eco" program.
Car telemetry
A separate integration supplies the actually measured battery level of both cars plus charging and location status, rather than an estimate — so the tiles show what the car itself reports.
Local first: talking to the device directly
A device in the house can almost always be addressed without a middleman. The route via a cloud service or via the home automation is a detour: slower, poorer in data, and dependent on two parties that can both fall over. Where possible, Homey_Log therefore talks directly to the device on the home network — the charge point and the batteries above are examples of that.
The robot vacuum is entirely under Homey_Log, with no Homey in between. The server plans the runs — not when someone is home —, starts it, and checks after five minutes that it's really driving; a start that didn't arrive is retried for half an hour. After a cliff error the server restarts it itself, up to three quick failures in a row — then a notification follows. If it stands still outside its dock for half an hour, one notification arrives with the battery percentage. The detail screen shows the runs of the last thirty days with their outcome according to the robot itself. The curtains have a local mode in which the app is the only path to the motor — Homey keeps deciding, but calls the app to do it. The dishwasher speaks an encrypted local protocol with a key per device, and the same link also follows the washing machine and the oven. The weather-station gateway supplies, in the same call as the soil-moisture sensors, the temperature, humidity and air pressure of the meter cupboard it hangs in.
Local first has one particular pitfall: the inverters allow only one Modbus connection at a time. Whoever connects second kicks the first one off. So the server holds that one connection per inverter and puts its own pass-through in front of it: read-only (a write command gets a refusal back), only for senders on a list, and at most a few at a time. The Homey is on that list, so its inverter app reads along through the server and exactly one connection runs to each inverter.
The conductor: who gets the sun, and when
Let each device from the previous chapter plan for itself, and the charging plan divides the night as if the car were the only consumer, the dishwasher looks for its cheapest hour as if the battery didn't exist, and the battery fills up on the cheapest quarter-hours as if the boiler never needed power. Four calculating parties, each convinced they're alone in the world — and four times the same kilowatt-hour promised to three devices at once. Against that stands one place that answers the question in one go: who gets the solar surplus, who gets the cheap quarter-hours, and who waits?
Every minute the conductor fetches the solar budget, asks each participant what it needs, divides it up, and records per participant what came out — over a forty-hour horizon, in quarter-hours. The first distribution is a waterfall down a ladder: a participant only sees as free what the rungs above it left over. That order is a setting, not code: first the boiler's basic need, then the dishwasher, the home battery, the car, and only after that the bonus parts of boiler and car. Then a small, fixed set of safety nets runs over it: negative prices, comfort floors, the grid budget per phase. Whoever has a hard end time — the dishwasher has to be done, the car has to drive — always makes its deadline, on grid power if need be.
The waterfall is the starting point, not the final word. Boiler, dishwasher and car then choose their plan again against a single price per quarter-hour for the whole house, and the home battery gets its settings from a mathematical optimisation. How that calculates and why it is set up this way is in the next chapter. The waterfall keeps calculating every round: as a fallback when the brain can't complete a round, and as a comparison in the log.
Which devices take part, the conductor doesn't know by itself. Every controllable device registers with a small contract: how many kilowatt-hours do I need, by when, between which minimum and maximum power, may I be interrupted, where is my comfort limit, and what is finishing earlier worth. The register itself knows no device at all, and an error in a registration trips the start-up rather than only surfacing when the conductor needs that participant.
What comes out of it can be seen as a planning strip: three rows of eight hours, four staves per row — one per participant, always in the same order — and thirty-two quarter-hour cells per stave. Left of the current quarter-hour is what actually happened, right of it what's planned, and the current quarter-hour is a playhead across all staves. Color carries the meaning, and there's nothing to tap in the cells: it's a score, not a control panel. Two day arrows page a day back or forward, and a 23- or 25-hour day around the clock change shows no quarter-hour as a gap. The same strip is on the phone, the wall tablet and the desktop; labels, legend and order come from the server.
All four really steer. Each participant has its own setting — off, shadow or on — and all four are on. The home battery gets xom, charge, negative charge or hold per quarter-hour. The boiler gets its setting via the minute script Boiler_Tick on the Homey. The dishwasher gets its start moment, and the server starts it on that. The car on the charge point gets its wish directly in the charge-point hand. A guardrail only lets through the words that have been explicitly released, and the decision log only gets a line on a real change.
Off is off. The conductor's master switch is a real emergency stop: each device first gets its own safe setting — the boiler on solar, the battery on xom, the charge point plays out the rest of its command and then goes to solar — and only then does the flag flip. That also holds after a server restart. And if a device deviates from the wish the conductor gave, the brain repeats it once and then reports it.
The boiler: a battery with water in it
Hot shower water is the most rewarding device to plan this way: the tank is a battery, just with water in it. The boiler controller decides afresh every minute whether the element should be on solar, on the grid or at rest, following four rules in a fixed order of precedence. Solar is the default: the element modulates with what's being exported, minus what the home battery is discharging — a discharging battery isn't solar. The floor comes before everything: if the tank drops below 50 °C, it's heated regardless of price. The plan converts the showers up to the next free or cheap window into kilowatt-hours and places that grid power at the moments when a kilowatt-hour costs the whole house the least, up to the last known electricity price, in blocks of at least half a kilowatt-hour. The boiler finishes a block it has started, rather than switching on and off every minute; the shower supply is ready before the shower hour; and at a negative price the tank heats on in whole blocks up to 80 °C. The hygiene rule makes sure the tank reaches 60 °C at least once a week, in the cheapest quarter-hour of that day. If, according to the location system, nobody has been home for longer than a day, the floor and the plan lapse while solar and hygiene stay.
Solar priority: the boiler before the battery. Sun that goes into the home battery comes out later with losses; sun that goes into the tank is shower water straight away. With sun, the brain therefore weighs per quarter-hour whether the tank goes before the battery. The surplus reaches the element via a feed script on the Homey, Nymo_Voeden, which every few seconds passes on how much is being exported — under solar priority including what the batteries are absorbing at that moment. A discharging battery is subtracted instead: the boiler never heats on battery power.
What makes this possible is a thermal model of the tank. The sensor sits at the bottom and lags hours behind after a shower: the immediate drop measures about 3 degrees where in reality 10 to 12 left the tank. So the model keeps an energy balance at minute resolution — standing loss, content per degree, element efficiency, and what each measured litre of tap water takes out. Two guardrails: if the thermometer reads much lower than the calculation, the boiler believes the thermometer — a model that invents a hot tank leaves someone with a cold shower — and the calculation never goes above the thermostat's limit. How much electricity a litre of hot water costs, the app re-measures itself every Sunday night; if that differs from the setting by more than a tenth, a notification follows.
On the phone there's one button: Heat now — heating on the grid, up to a limit, for at most an hour, always cancellable.
The boiler is controlled over radio and reports nothing back. The only proof that a command arrived is the smart plug in front of it. The requirement is therefore I want to see the transition: after "grid", consumption should be above 2,000 watts within three minutes, after "rest" below 50. If that proof doesn't come, the brain repeats the command once and then reports it. And a frozen reading proves nothing: if the same value has been unchanged for minutes, the system reports "the reading has stalled" and not "the boiler isn't responding" — two faults, two fixes.
The dishwasher, at shadow price
The cheapest electricity isn't always the cheapest electricity. Running on an afternoon with a solar surplus that would otherwise go onto the grid for a pittance costs less than a night with a low price that still has to be paid for. The shadow price puts that on one footing: your own solar surplus counts as zero, the rest at the quarter-hour price of that moment. Applied naively, that sum picks the earliest free moment, while the forecast surplus then only just covers the run. So the rule takes all start times within five cents of the cheapest, and among those picks the earliest at which the expected surplus covers the run at least three times over. The screens show the moment the starter is actually holding — if there's nothing to start, the screen says "if you load it". The yardstick counts the home battery on both sides and therefore gives a band, from "the battery doesn't count" to "the battery counts fully".
The car, per charging session
The car is the biggest and trickiest participant: it isn't always there, it has to leave at a set time, and there are two of them on one charge point. Both cars are on the conductor's list; another car on the charge point charges freely, and if nothing is plugged in, the conductor keeps the charge point on solar.
What a car has to reach is in a weekly schedule per car: per day a departure time and how full it must be by then. On the phone each car has a Weekly schedule… button, with Just once different next to it for a day that deviates; such an exception disappears by itself at its time. On the desktop the same card sits in Settings, and it only sets the days you changed there, so it never undoes a change made on the phone.
A charging session starts at the plug: at the moment the charge point registers the plug-in, not only when the car telemetry reports minutes later that it's plugged in. Re-inserting the plug within a minute continues the same session, and a car that according to its own telemetry is on a charger elsewhere doesn't win our charge point from the car that really is here. Within a session the conductor places the kilowatt-hours up to the departure time in the cheapest quarter-hours, with solar as free; once the target is reached, only the bonus part up to 100 percent may still take the afternoon sun. If the car stops by itself within 5 percentage points of its target, it counts as full, and a battery-care limit set in the car (charging to 80 percent) counts as reached.
On the screens the car tile shows the conductor's departure time — "Full on Monday 07:00 to 80%" — and says "Charging under conductor control" for as long as that's the case; when charging from the grid it adds how many kWh to which target and when it'll be done. Manual operation has two buttons: Auto laden nu (charge car now), and Laden op zon (charge on solar) — the car then only gets what the house has no other use for —, followed by Terug naar het laadplan (back to the charging plan). For each car it is also fixed what happens after plugging in: follow the charging plan, or solar only.
Under the hood: how the brain calculates
The previous chapter told what the conductor decides. This chapter is about how that is set up technically: which calculation method runs, why that one, where it runs, what it knows and deliberately doesn't know — and how the house checks every day whether it all added up. In short: the brain decides, the devices carry out, and every night a judge recalculates what could have been.
Three roles: brain, hand and guard
In this setup every controllable device is a hand. A hand plans nothing and decides nothing: it gets a wish ("charge at 3.7 kW until quarter past four, then solar"), carries it out, and keeps reporting what it is doing — charging, not charging, plug out, element on. The brain lays those reports next to its wish and so recognises by itself whether a device does what it asked; per device it knows how long "not visible yet" is normal. Manual operation is a wish too: whoever presses Auto laden nu (charge car now) gives the brain a command, and the brain plans the rest of the house around it.
The third role is the guard: a separate loop that measures the current per grid phase every ten seconds and throttles a device before a fuse does. It is always on — also during manual operation, also when the brain gets stuck — and beats every wish.
| Device | The hand | When the commands stop |
|---|---|---|
| Charge point | the server itself, over Modbus TCP, every ten seconds | the hand plays out the rest of the command and then goes to solar; if the server drops out entirely, the charge point falls back to its own safe current after the Modbus timeout |
| Home batteries | the server itself, via the batteries' local API | a watchdog on the Homey puts them on their own zero-on-the-meter control after five minutes without a heartbeat |
| Dishwasher | the server itself, locally encrypted, with the manufacturer's cloud as fallback | if the brain stays silent, the hand starts at the latest possible start time |
| Boiler | the Homey, which switches the element over 433 MHz | the tank keeps its own thermostat |
Why Homey is only the fingers where there's no API. The Homey runs as a virtual machine on the same home server as Homey_Log and talks to the same devices. A fallback "to the Homey" sounds like safety, but it covers hardly any failure that doesn't hit the server too, and it does add a second writer that can fight the first. So every device has its own safe state when the commands stop, and the server talks directly to everything with a network connection. The boiler is the exception: its switch only listens to a radio signal, and the Homey has that transmitter. Two small scripts do the work there — one passes on the setting every minute, one feeds the measured solar surplus to the element — plus the batteries' watchdog. All the calculating happens on the server.
One round, from measurement to hand
home battery: the solver (HiGHS, own child process)
Every minute the same round runs. The mapping layer supplies the measurements and the knowledge per device (the brain itself knows no device name at all); the waterfall from the previous chapter makes a first distribution; then boiler, dishwasher and car choose their plan again against a single number per quarter-hour: what one extra kilowatt-hour costs the whole house at that moment. That number comes from a simulation of the house: one kilowatt-hour extra in quarter-hour k, and see what the bill does — with the battery reacting to it, the export that falls away, the sun that would otherwise be lost. Each device bids on that price with its own planner; the dishwasher only shifts if it saves at least a cent, so its start moment doesn't jump every minute. The home battery gets its settings from the solver.
That structure is a deliberate intermediate form. Three designs are conceivable: (A) one price per quarter-hour that every existing planner bids on; (B) the same, but with a few bidding rounds in which the price rises where it gets busy; (C) one joint optimisation over all devices. A is what boiler, dishwasher and car do now: small, and every planner stays testable on its own. C needs a real solver, because a home-written dynamic program over battery charge × tank temperature × car charge at the same time explodes in the number of states. B drops out: the solver calculates exactly in milliseconds what bidding rounds only approximate. The solver steers the home battery, and calculates along in shadow for the tank, until a comparison shows that it does better there.
The solver
Planning a battery is a classic optimisation problem: thirty-six hours of quarter-hour prices, a forecast of sun and consumption, a battery with a round-trip loss, and the question in which quarter-hours to charge, discharge or do nothing. That can be written down exactly as a linear program: variables per quarter-hour, linear constraints, one cost function to minimise. Where a rule picks "charge when it's cheap", an LP solver searches all quarter-hours at once for the demonstrably cheapest plan within the rules.
Which one. The solver is HiGHS, the open-source solver (MIT licence) that is also
widely used in the energy sector, as the WebAssembly package highs from npm, pinned to one
version, so that a snapshot can be recalculated bit-identically. That means: no external service, no network, no compile step of its own, and the same outcome on every
machine. Exactly one module may load the package, routes/lib/lp-oplosser.js, and a contract test turns
every other require('highs') red.
How it is set up. The solving module knows no energy concept at all. It gets a model as text in the standard LP format, and returns a status, the objective value, the value of every variable and the shadow prices. The knowledge lives in the model builders: one builder that translates the house into variables and constraints, with a translator per device next to it (battery, tank, car, dishwasher). The same builder feeds the planner with forecasts and the judge with measurements — a planner with different physics from its judge is exactly the error you want to rule out. The builder puts variables and rows in a fixed order, so the same input gives byte-identical text. HiGHS runs with fixed settings: simplex, presolve on, one thread, a fixed random seed, no slack in the optimality gap. Results are rounded to four decimals. Together with the package version this goes into the snapshot of the round, so every plan can later be recalculated bit-identically.
This is what the smallest meaningful sum looks like, literally as the model builder writes it: two quarter-hours, first electricity at 10 cents and then at 40 cents, a 1 kWh battery with a round-trip efficiency of 81 percent, and 1 kWh of consumption in the second quarter-hour.
Minimize obj: 0.1 g_0 + 0 x_0 + 0.4 g_1 + 0 x_1 Subject To rsoc_0: 1 soc_0 - 0.9 c_0 + 1.1111111111111112 d_0 = 0 ryc_0: 1 c_0 - 1 y_0 <= 0 ryd_0: 1 d_0 + 1 y_0 <= 1 rsoc_1: 1 soc_1 - 1 soc_0 - 0.9 c_1 + 1.1111111111111112 d_1 = 0 ryc_1: 1 c_1 - 1 y_1 <= 0 ryd_1: 1 d_1 + 1 y_1 <= 1 rbal_0: 1 g_0 - 1 x_0 - 1 c_0 + 1 d_0 = 0 rbal_1: 1 g_1 - 1 x_1 - 1 c_1 + 1 d_1 = 1 Bounds g_0 >= 0 x_0 = 0 g_1 >= 0 x_1 = 0 0 <= c_0 <= 1 0 <= d_0 <= 1 0 <= soc_0 <= 1.0001 0 <= c_1 <= 1 0 <= d_1 <= 1 0 <= soc_1 <= 1.0001 Binary y_0 y_1 End
g is import, x export, c and d charging and discharging,
soc what's in the battery. The efficiency is split over charging and discharging (0.9 × 0.9 = 0.81).
The rbal rows are the energy balance per quarter-hour, the rsoc rows keep track of the
battery, and the binary y forbids charging and discharging in the same quarter-hour — without that
rule a linear sum uses the round-trip loss to "burn" electricity whenever that earns money somewhere. The limit of
1.0001 kWh is a measured capacity, and the builder always rounds those outwards. HiGHS answers: in the first
quarter-hour import and charge 1 kWh (0.9 ends up in the battery), in the second discharge 0.81 kWh and import the
rest, 0.19 kWh. Cost € 0.176 instead of € 0.40.
What's in the real sum. The same shape, but over 144 quarter-hours — thirty-six hours from the current quarter-hour. Beyond the last known day-ahead price the sum works with a price forecast.
| Part | Per quarter-hour |
|---|---|
| Variables | import and export; battery charging, discharging and state of charge; per car the charging power, the delivered energy and any shortfall at departure; for the tank the element (from the grid and from solar) and the energy content; for the dishwasher one start quarter-hour |
| Constraints | the energy balance; the battery charge between empty and full with the efficiency in it; the battery never exports to the grid; no charging and discharging at the same time, and no importing and exporting at the same time where that would pay; the exclusion list (the battery doesn't discharge for the devices on that list, such as the charge point); the fuse per quarter-hour, and per phase in the sum with more free devices; for the tank the thermal model with its loss and the expected showers; for the car the minimum charging current, the departure, the charging reserve and the chance of an earlier departure |
| Objective | import × quarter-hour price, minus export × feed-in price, plus wear, plus the comfort prices, plus a small penalty for deviating from the previous plan, minus the value of what's left in the battery at the end |
Three details make the difference between a sum that is right and a sum that works. The end value: without a value for what's in the battery after thirty-six hours, the sum always empties it at the end. That value is what the charge can be put to against the most expensive quarter-hours of the following day, minus the loss, with a ceiling so the sum doesn't sell to itself. The flapping penalty: two plans that cost the same can win alternately every round. A penalty of two tenths of a cent per kilowatt-hour of difference from the previous plan keeps the existing plan unless the new one is genuinely better. The fuse penalty: every kilowatt-hour above the fuse limit costs at least a thousand euros and always more than ten times the highest price in the sum, so no comfort price can ever outbid the fuse.
Fast enough. Binary variables make a sum slow. So the sum is solved first without them: if that solution picks none of the three forbidden combinations in any quarter-hour, it is optimal for the full sum too. If it does pick one, the binary variables are added only on those quarter-hours and their neighbours, in at most four rounds, and only after that the full sum.
A process of its own. The solver doesn't run in the server itself but in a persistent child process that stays warm between sums. A heavy sum therefore can't make the server loop stutter, and a crash in the WebAssembly doesn't hit the server. The child also builds the LP text and translates the answer; it solves one sum at a time and is replaced after five thousand sums or when it uses too much memory. Every sum gets a time limit — five seconds for the battery — which HiGHS enforces itself. If there's still no answer two seconds later, the child is killed and restarted with increasing waits; after a crash the old WebAssembly instance is discarded, because it can stay unusable afterwards.
A new sum every quarter-hour. The first round of every quarter-hour requests a new sum, after the round, so that round itself doesn't wait. The rounds after that use the latest plan, provided it came back as optimal, stems from this or the previous quarter-hour, and covers the current quarter-hour. If there's no such plan — a time-out, a crash, an infeasible sum — the fixed day rule steers that round, with the reason noted in the plan; if that persists for six rounds in a row, a warning goes into the log. The server translates the plan itself per quarter-hour into a word the battery hand knows: charge, negative charge, hold or xom. A quarter-hour without a known market price never buys: a buy word becomes hold there.
Sum A and sum B: shadow versus live
Two sums run side by side. Sum A has only the battery free: boiler, dishwasher and car are fixed on what the brain chose for them, and the sum looks for the best battery around that. That one steers live. Sum B has the battery and more devices free in one sum, calculates the fuse per phase and knows comfort as a price. Which device takes part in sum B is set by its own mode: off, shadow or live, and never higher than the battery. The tank is in shadow: sum B calculates every quarter-hour with battery and tank together, and that plan goes into the snapshot — for comparison, it steers nothing. Car and dishwasher are off in sum B; they take part in the comparisons outside the house.
| Device | Who plans live | In the solver |
|---|---|---|
| Home battery | the solver (sum A), with the day rule as fallback | live |
| Boiler | the brain, bid against the house price | shadow calculates along, doesn't steer |
| Car | the brain, bid against the house price | off |
| Dishwasher | the brain, one start moment | off |
A device only gets the wheel after a comparison you can recalculate. First the current planner and the candidate run side by side in a simulation of the house over dozens of measured days, paired per day, plus a set of hard days, such as a day with house guests and extra showers. Then the candidate runs in shadow in the real house. Only then is the switch flipped, and that is a decision by a person, not a threshold in the code.
Comfort as a price
An optimisation that only looks at euros lets someone take a cold shower if it saves three cents. So the sum doesn't treat comfort as a hard requirement — that makes a sum infeasible on an unexpected day — but as a price: what avoiding a shortfall is worth to the household. Those prices are Marc's decisions, recorded in one place and the same for sum and judge:
| What | Price |
|---|---|
| one kilowatt-hour short in the tank at a shower (≈ 10 °C) | € 2.00 |
| one kilowatt-hour short in the car at departure | € 0.50 |
| charging in the last half hour before departure (the charging reserve) | 0.9 × the comfort price |
| the chance that a shower starts below the requirement | at most 3 % |
| the dishes finished one quarter-hour late | € 0.50 |
That chance requirement is the finest part. From its own shower history the house knows in which hours people shower and how much. In every quarter-hour of such an hour the tank has to reach the comfort temperature plus a risk reserve: enough extra energy that the hot-water demand in that hour is covered in 97 out of 100 cases. An hour in which long showers are rare thus gets a small reserve; a busy morning a large one. The live battery sum has no comfort item: in it, tank and car are already fixed on the brain's plan. The comfort prices work in sum B and in the judge's verdict.
Grid budget and fuse per phase
A plan that puts three devices on the same cheap phase at once isn't a plan but a blown fuse. So per phase the conductor keeps a grid budget: the limit of that moment (18 amps during the day, 22 at night) minus the expected house load on that phase, which is the ninetieth percentile of the same quarter-hour of the day over the past fourteen days. In the current and the next quarter-hour the measured load counts if it is higher, and the heat pump counts separately. If it doesn't fit, the conductor squeezes in reverse ladder order: the bonus first, comfort and deadlines never. In advance it works out per phase how much grid power still fits, so a plan doesn't only clash when it is carried out. The batteries get priority: their charging is only squeezed above the real 25-amp main fuse, except when someone has the car charging by hand.
Beneath that planning lie the fast reflexes, separate from the round: the charge-point hand monitors the phase current every ten seconds and throttles the charge point; the batteries switch back to their own control if a phase sits above 25 amps for more than twenty seconds while a battery on that phase charges from the grid or stands idle, and stay there for five minutes; and the guard puts the boiler at rest for five minutes if its phase is too full for a minute. The norm: at most one ten-second measuring round above the main fuse.
The scoreboard: the judge
A planner that judges itself always finds itself good. So every morning at five past six a judge recalculates the previous day, with the same model builder and the same solver but now with the measured sun, the measured consumption and the real prices. It puts a row of sums side by side:
| Sum | What it calculates |
|---|---|
| actual | the day as measured: the bill as the meter saw it |
| naive | no battery, every car charges at full power straight away on arrival, boiler and dishwasher as measured |
| optimum within the rules | everything free, with the exclusion list and "the battery never exports to the grid" — this is 100 percent |
| optimum without rules | the same without those two rules: what the rules themselves cost |
| only one device free | per device: what could have been gained if only that device could have done otherwise |
All amounts are settled per quarter-hour: net import at that quarter-hour's import price, net export at the feed-in price. A free sum also pays the comfort price for every kilowatt-hour it left undelivered; otherwise the optimal sum "wins" by letting nobody take a warm shower. From this follows the utilisation: what share of the distance between naive and optimum the house actually covered. If that distance is smaller than five cents, there is no percentage — dividing by almost zero says nothing. On the screens there's no percentage per day but an amount, "this much left on the table", with the room there was per device. A percentage per day would also measure the battery stock that shifts to the next day; so it only appears over the last seven days.
A quarter-hour that is physically impossible — more than the battery can do, a counter jump, grid above the main fuse — is never silently counted or set to zero: it is listed with the day as a peculiarity, and the sum in which that device is free lapses, with the reason. If the judge's method of calculation changes, the new result is stored next to the old one, so a recalculation stays comparable.
One yardstick for a shower. What counts as a cold shower is fixed in one place and applies to sum, judge and scoreboard. A shower is any draw of at least ten litres. The measure is the temperature of the tank model at the moment the draw starts — not the sensor at the bottom, which lags hours behind — against the requirement that applied at that moment, with no margin. A missed shower gets a severity in degrees, in kilowatt-hours and in euros. For the car the measure is the charge at the moment of departure or the deadline, whichever comes first; a shortfall of more than half a kilowatt-hour is a miss. Over 28 and 90 days the house counts how often a shower started too cold, and puts that next to the permitted 3 percent — but only from twenty showers, because below that a percentage says nothing.
Plan versus execution
Every night the server lays the plan next to what really happened, per quarter-hour and per device: the word the plan gave, the planned and the delivered kilowatt-hours, who was steering, and a verdict — equal, too much, too little, not from solar, outside the plan. The battery counts net, charging plus and discharging minus, without clamping anything away. Xom isn't a command there but a claim on the surplus, and only gets a state check: was the battery in its own control mode, yes or no.
On top of that the execution gap is calculated: per device which kinds of deviation occurred and what each one cost directly in its own quarter-hour — the battery charged less than planned, didn't hold, the car charged at plug-in, the boiler didn't get from the sun what the plan expected, the dishwasher didn't start. Per week the three most expensive causes come to the top, only if they exceed ten cents. A quarter-hour without a price or a measurement has no amount rather than zero. The amounts deliberately don't add up to the judge's difference: the judge calculates the whole house in one sum, the gap looks per quarter-hour per device.
The replay and the breakdown
At every quarter-hour change and at every changed decision the conductor records a snapshot: the complete input of the round, with the code version, the settings and a fingerprint of the outcome. At half past two at night a child process recalculates all of yesterday's snapshots made with the same code — with exactly the code the server is running at that moment, unpacked from git into a throwaway folder. Every fingerprint has to match. If one differs, the planner is reading something that isn't in the snapshot, and an invariant raises the alarm. The same snapshots make the question "what would the conductor have done with a different setting" answerable.
At ten to four comes the breakdown. It lines up four numbers: the optimum within the rules; the brain with the measured values in place of its forecasts; the brain with the forecasts of the time, from the snapshots; and the measured day. The differences say where the money went: in the calculation method, in the forecast, or in the execution. The forecast part is split further over sun, consumption, price and devices, with a fair division over all combinations (a Shapley value over fourteen coalitions). A cause is only called a cause if it stays above ten cents under every valuation of what's left in the battery at the end. Every row states on which scale and with which execution profile it was calculated, and also that the simulator and the sum don't have the same physics everywhere: as a result the brain with measured values doesn't come out cheaper than the brain with forecasts on every day, as it should in theory.
The verdict is on the desktop in the Strategies tab and on the phone in the Energieregie (energy control) panel: a sentence with the amount, the biggest cause, and a sentence about comfort.
The three-layer model as a rule of the game
All of the above follows the architecture rule of the whole project (see "How this gets built"): data, mapping, display. The brain knows no device name: which metric is "solar", which plug measures the tank and how long a charge point may stay silent after a command is in a knowledge register in the mapping layer. The solver knows no energy, the model builder knows no devices, and the screens show sentences and numbers the server makes. A different battery or a second car is therefore one line in the mapping, not an intervention in the sum.
The brain in pictures: the Thuisbrein
What the server is doing at any given moment can be seen on a page of its own, the Thuisbrein (home brain), which also runs on the wall tablet as the page "Brein". It is a star system. In the centre is the core, with around it a ring of the processes running at that moment: the conductor, the hands of charge point and battery, the guard, the dishwasher starter. A conductor round sends a golden wave through the core. On the inner orbit are the sources the server reads locally — meter, water, charge point, batteries, heat pump, boiler, the household appliances, lights, curtains. The Homey is a planet of its own, with its scripts as moons. On the outer orbit are the cloud services — prices, cars, weather, climate, security, the language model — and what the house sends out: the clock, the phones, the app, the wall tablet.
Every pulse is a real event: a measurement coming in, a command going out. There's no simulator and no speed-up. A source that stays silent for longer than twice its own rhythm fades to grey; the next real pulse brings its colour back. An error gives a red flash. At the top are the number of events per minute, how long until the next conductor round and how long a slow round takes (the 95th percentile).
Under the hood it is deliberately bare. At the places that see the traffic anyway — the pollers, the Homey link, the local readers — sits one call that only passes on three fixed names: kind, from, to. No measured value, no log text, no device id, no location; a contract test enforces that. As long as nobody is watching, that call does nothing. When someone watches, it writes three values into a fixed ring of 1024 slots, without allocating memory. A pump reads that ring four times a second, translates the names into nodes, thins out per pair and per kind to at most four a second, and sends one batch to all open browsers. A slow browser misses a batch rather than the server starting to buffer. That way the display can never reach into the conductor: the Thuisbrein is pure display, and the conductor gets no extra work from it.
Burden of proof: is it actually right?
A system that judges itself needs an independent yardstick — otherwise it only checks itself. So, separate from the AI layer, there's a deterministic validation stack:
- Hindsight benchmark: for every day, the best possible battery use is calculated exactly afterwards, given the actual sun and actual consumption. The difference with the actual outcome is the hard yardstick for "how much is still to be gained here"; on the phone it appears as the Battery utilisation tile: how much of the achievable the battery really delivered over the last seven days.
- Golden days: a frozen set of checks against the real API endpoints — a regression test for the numbers themselves.
- External reconciliation: daily and monthly figures are laid next to the energy supplier's bill, only over days that are complete. That comparison exposed a structural undercount of import in certain hours that would never have been noticed without the external check.
- Consistency watchdog: a daily check that re-derives random days from the quarter-hour source and compares them with the stored daily value — so two tabs never quietly drift apart.
- Invariants: more than forty statements that should always be true — the daily sum is the sum of its quarter-hours, solar is never negative, the water meter never runs backwards, the schema in the database is the same as in git. Some guard the conductor (did the battery discharge into the car yesterday, did the car reach its target, is the boiler on the word the conductor gave, does the replay of the snapshots recalculate bit-identically), some the notification channels (can each channel still deliver), and one watches for what disappears, so history can't quietly shrink. Every statement says why its margin exists, and an invariant without data reports "skipped", not "fine".
- Night watch: at a quarter past five the server runs its own full test suite plus a smoke test through the screens, on the code that is actually deployed. If it stays wrong for three nights, a phone notification follows.
- Sign of life: the server reports at a fixed address whether the database, the conductor and Homey are working, and a waker outside Homey_Log sends a Pushover message when that answer stops coming, and one when it returns. A server that has hung can't sound its own alarm.
- Disaster drills: monitoring that has never been tried out is an assumption. A fault can be simulated on purpose — the weather stations unreachable, the electricity price gone, the conductor silent — after which a scorecard shows what the system noticed by itself. Every drill also ends without intervention, and the scorecard only counts notifications a human actually gets to see.
- VM usage monitor: a nightly check of disk usage, database size and row counts, with a growth chart and a notification before the disk fills up.
- Solar-charging telemetry: a separate sampler that records the reality of solar charging alongside the solar control — applied current per phase, the phase currents of house and charge point, the batteries' power — every five seconds while a car is plugged in. The Solar charging tab shows it as a raw source; the interpretation happens in the reviews.
When a device stops reporting, Homey keeps repeating the last known value as if nothing were wrong. A device that has gone silent therefore doesn't look like a fault, but like a device that happens to consume nothing. The costliest case: the garage inverter stood still for five days while the reading dutifully kept reporting 0.00 kWh — 109 kWh of solar yield vanished from the books.
Every quarter-hour measurement therefore also records when the device last really refreshed its value, visible in the Measurement gaps card in Settings. That card measures, but blocks nothing: the stamp says when a value last changed, not when a device last made a sound, and a device that's switched off stays at zero without a new stamp. "Frozen" and "off" can't be told apart that way; an automatic rejection rule would, on the house's own figures, mostly reject valid readings, and so there isn't one. A measurement gap is reported once; only a new or grown gap is reported again.
What can work without a human: the sources the house reads itself. For every inverter, battery and meter that Homey_Log queries directly, it's known which network address it sits behind. If such a host drops out, the reading yields a gap rather than a frozen zero, and on its return there's a ready-made proposal to backfill those quarter-hours from the manufacturer's data — all or nothing, with a rollback file alongside. A restored solar value can then no longer be wiped by a zero from Homey.
Deliberately quiet: the pause calendar. A device that's off on purpose shouldn't keep complaining. Every measurement point can be paused, with or without an end date and with a reason; one switch silences a whole set at once (holiday mode) and reverts it by itself. A hard distinction: pausing suppresses the notifications, not the measurements — otherwise nobody would ever see that the device works again.
The lesson that has stuck from this whole stack: internal consistency checks don't see the kind of error that kept turning up here — only testing against an external, independent source (the energy supplier, the source table, the actual Homey flow) exposes it.
How this gets built
The whole project is under git version control. The way of working is itself a small sample of this article's subject: one AI model writes a plan and reviews afterwards, a second model carries out the implementation, and every non-trivial change is verified live against the real Homey before it counts as "done" — including, in the experiments phase, a deliberate test with a really triggered emergency stop.
Three layers, and one test. At the bottom the data: tables of measurements, as they came in. Above it the mapping: adapters, registers and roles — there, and only there, is it written which device is the charge point, which measurement series is called "solar" and which sensor measures the boiler water. And on top the screens, which only know functional concepts: no device name as a selection mechanism, no formula in the browser. The test fits in one sentence: swapping a source must not break anything above the mapping. A third home battery or a replaced sensor should be one line in the mapping, not a search through the screens.
How much proof a change has to deliver depends on what it can break. Nothing may touch storage without tests first, a backup and a written-out way back; an error there is irreparable. Nor the calculation model, because an error there contaminates years of history. Processes that send something back to Homey carry the requirement of an emergency brake and a verification on real behavior. Only for pure display is checking that it looks right in the running app enough — and as soon as a screen calculates a new number, that calculation belongs on the server, with tests.
One building block per concern — and a test that works out by itself who bypasses it. Writing a log line, calculating in Amsterdam time, reading a config file, requesting a secret by name, polling periodically, starting a process, building a watchdog, sending a notification: each has exactly one building block. The matching test derives from the code itself who ought to use that building block, rather than ticking off a hand-written list. A detour therefore surfaces by itself; every exception carries a reason; and an exception nobody needs any more turns the test red. On top of that, a module that gets loaded does nothing — no database, no file, no network — and start-up is a register of declarations, so a process that didn't start never looks like a process that rightly had nothing to report.
At the bottom lies a safety net of over fifteen hundred test files. On every commit a fixed set runs plus the tests that belong to the changed files — ten to thirty seconds; if the commit touches the core, the whole suite runs. After merging branches the whole suite runs anyway, and the night watch on the code that's actually running remains the conclusive proof. Once a month, moreover, the full suite runs under five shifted clocks — forty days ahead, the two nights of the clock change, half past midnight and the last day of the month — because a test that secretly depends on the clock is green 364 days a year.
Who guards the guards? A test that stays green when the code beneath it is broken proves nothing. A new guard is therefore proven with a mutant: the code is broken on purpose, and the test should turn red. The AI that helps build works behind a guardrail that blocks risky commands — a loose script on the real database, throwing work away, reading secrets, a restart without asking — and changing a Homey flow always goes via a rollback point, a dry run, writing and reading back.
Deploying is one command. It walks the checklist and stops hard on any deviation: a dirty working directory, an analysis running at that moment, a screen that throws an error in a fresh browser (before and after the restart), a process that didn't come up, a source that's no longer fresh after the restart. If the database structure changes, the command first sets aside a verified copy of the live database; a non-additive change is only possible as a registered migration with a rollback path tested in advance. It's only done once there's a log line telling the analyst what changed — without that line it later reads a change in behavior as a fault. A rollback never happens automatically: the command prints the recipe, a human decides.
Outside this repo sits a central lessons layer: short, hard rules drawn from mistakes made, cross-project, with no way to delete one. At the start of substantial work they're fetched, with a reading client that always puts the newest on top — a lesson you don't read is the same as a lesson that doesn't exist. The same place hosts a mailbox between projects, with a budget per topic so a mailbox doesn't become a chat window.
The family dashboard: a third entrance, for the whole household
Next to the desktop admin environment there's the family dashboard, meant as a fixed wall tablet for the whole family — including de tweede auto, een gezinslid and een gezinslid, not just Marc. It's a kiosk: dark by default (evening use on the wall), big tiles and numbers readable from two metres away, no navigation to administration, logs or experiments, and back to the overview after a minute without a touch. The same dashboard has a phone view — tiles full-width one below the other, popups as a bottom sheet — chosen through the address rather than the screen width, which is unreliable on a real phone. Deliberately one component: a tile that changes on the wall tablet changes along with it. It's purely a presentation layer: no data source of its own, only the existing endpoints and the existing allowlist for control.
The tiles: energy now (the last complete quarter-hour, labelled "updated X min ago", since there's no true live wattage), the home batteries, both cars, lights and moods, the boiler, the dishwasher, the robot vacuum and four energy figures for today — from the same calculation functions as the Usage tab. The set is deliberately narrow and shows no misleading tiles: this house has no window or door sensors, so that tile doesn't exist. The only global quick action is "all lights off" (with confirmation); beyond that, each tile button triggers an existing, allowed action — start the dishwasher, start the vacuum or send it to the dock, start manual charging, set a mood.
Behind the Energy tile sits an energy-flows diagram: grid, solar, battery and both cars around the house, with a "now"/"today" switch and kWh or euros. The house is the breathing heart at the center, and energy flows as light through curved conduits — inward on import, solar or discharging, outward on charging. The split comes from the same calculation model as the Usage tab and always balances: what goes in comes out. A second tab "Verloop" (progression) shows an hourly chart of today: one consumption bar per hour with solar (yellow) and battery (light green) behind it; whatever sticks out above came from the grid.
Every node in the diagram is clickable and opens a bar chart of today, stacked on top of the open popup without closing it — with import and export, or charging and discharging, as two directions. There's one charge-point measurement for two cars, so per quarter-hour the system checks which car was really charging at that moment.
The cars. The car tile shows not just the state of charge but also whether, how fast and how a car is charging: under conductor control (with the conductor's departure time), per the charging plan, on solar or by hand. The popup has a day profile from midnight to now, and a button to charge by hand or go back to the charging plan. Whether a car is plugged in isn't just the car integration's word, because that can keep reporting "plugged in" for days while the charge point is empty. The rule is: the charge point may only contradict. If it reports nothing is plugged in, no car is plugged in; if it reports something is, the car integration decides which. Current through the cable always counts as proof.
The rest of the house. The boiler tile shows the water temperature in large type, the current power and a 🚿 when someone is showering; the popup puts today's temperature and the litres per shower in one view (see chapter 03). The home-batteries popup shows the level and the charge/discharge efficiency per battery. The lights are grouped per room, with a second tab for Homey's moods. The dishwasher shows its start time or remaining time with a "Start now" button. The robot vacuum says whether it's vacuuming, on its way to the dock or standing still outside the dock, and how its runs of the last thirty days went. The 3D house can be called up full-screen as an alternative way to operate things.
When the doorbell rings, a full-screen popup appears automatically with live video from the doorbell, which the server fetches directly from Ring and passes on; if live video doesn't work, a photo, and otherwise large text from the server ("Er staat iemand aan de deur", someone is at the door). The same popup opens with the Voordeur live (front door live) button on the Beveiliging (security) tile, and the video stops as soon as the popup closes. The presence row at the top shows each family member with a photo, and a tap gives home/away, "last seen" and today's arrivals and departures; network devices that report to Homey as "present" are filtered out. On the right, the family calendar is permanently in view, refreshing every half hour.
A wall tablet never switches off, and that asks for three things. The dashboard refreshes itself every five minutes, with an "Updated X ago" label that keeps ticking even if refreshing stalls — a label that visibly ages betrays a hiccup. When a new version of the app is ready, a bar appears with Update and Later. And the server reads the tablet's battery every five minutes: top right sits a small battery with the percentage (green, orange below 50 %, red below 20 %, with a lightning bolt on the charger), and below 50 % a notification follows for every step of ten percent. Every day window starts at Amsterdam midnight, summer and winter time included — the server itself runs on UTC.
The phone app: the house in your pocket
The wall tablet hangs on the wall and the admin environment sits on a big screen. What was missing in between is the question you ask when you're out: is the house still doing its thing? For that there's a dedicated app on the phone, simply called Thuis ("Home"). It's a web app that behaves like a real app: you put it on your home screen, it starts in its own window without an address bar, and it opens even when you have no connection.
Here too you sign in once with your own account, and your role decides what you see. The app has four screens. Nu (now) is the state of the house in tiles — energy and the energy control, the home batteries and their utilisation, both cars, today's sun, self-sufficiency, the climate, the garden, the boiler, the heat pump, the dishwasher, the lights, the curtains, the robot vacuum, the waste calendar, Op de klok (appointments with a date), the daily report, the notifications, where the family members are and which room you yourself are in. Inbox holds the analyst's proposals and observations. Grafiek (chart) is the energy profile with a period picker. Chat is the conversation with the same analyst — for whoever has that conversation switched on. The admin also sees Beheer (admin): the same settings as on the desktop, but in your hand. You swipe horizontally between the screens.
Behind every tile is a full screen of detail, and those screens lie like a stack of cards one behind the other: you swipe from one to the next without having to go back to the overview. You can operate things too — charge the car now or send it back to its charging plan, set the weekly schedule, start the dishwasher or the vacuum, lights off, let the boiler heat for an hour — always via the same secured route and the same allowlist as on the wall tablet, with a confirmation question first.
One house rule applies on the phone without exception: a chart under a tile is about today. If there's another time dimension after all — the last 24 hours, a week — it says so literally, and under every chart one line names what happens on the horizontal axis.
It opens offline. A small background layer keeps the app's shell plus a handful of data the Nu screen needs to show something. Only those few read routes are on an allowlist; everything that writes bypasses it entirely, because a stored answer to "turn the lights off" is a disaster in the making. Whatever comes from storage is marked as such: better a visibly old figure than a fresh-looking figure from yesterday. When a new version is ready, a bar appears with Update and Later.
It can reach you. Notifications arrive directly on the phone, even when the app is closed, and the number of pending items shows as a badge on the app icon. Tapping one takes you to the explanation of exactly that notification (see the next chapter).
It doesn't eat your data plan. The biggest item in data usage was the family members' photos: unprocessed, almost eight megabytes every time the app opened. They've been shrunk fifteen-fold and are refreshed at most once a day — the kind of thing you only see if you explicitly measure it.
The Nu screen is yours, not the app's. Which tiles are on it and in which order, each family member chooses in My settings, and that choice belongs to the account, not the device. Which tiles there are to choose, and the words on those tiles — heating, planned, docking, open — come from the server: phone, wall tablet and desktop say exactly the same thing, because the word is derived in only one place. When a tile is added, it appears in everyone's list by itself.
The boundary with the wall tablet is deliberate: everything the phone shows also exists in the main app. What the phone does differently is the size — readable in your hand rather than from two metres away — and the order, because when you're out you first want to know whether anything's wrong, and only then how much the sun did today.
Notifications and the voice of the house
Everything the house has to report goes through one door. Behind it sit two registers: one of kinds — faults, a planned charging moment, the dishwasher, the daily report, the garden, the robot vacuum, a comfort question — each with its own explanation and a minimum role, and one of channels.
There are three channels. The app notification is personal: each family member chooses per kind in My settings whether they want it, while the hard alarms keep reaching everyone. Pushover and the clock are channels of the house, which the admin switches on or off per kind; anything addressed to one person, such as a chat answer, doesn't go there. Pushover is extra and never a replacement: an app notification is never suppressed because a Pushover message goes out too, and an error in one channel doesn't hold up the other. Every night the system checks that each channel that's switched on can actually deliver — a clock without an address or key stands out that way. And every channel really sends, rather than only logging what it would have sent: a channel that stays silent because of an error leaves nothing in the log, and nothing looks exactly like a quiet house.
The clock. In the living room stands a LaMetric clock that shows notifications with text, icon and sound, and speaks them aloud if wanted. Per kind the admin chooses "clock" and "speak". Within an adjustable daytime window the clock makes sound; outside it, the notification appears silently on the display. If the house is demonstrably empty, it stays quiet — except for a critical notification. The spoken sentence is made and stored on the server, and only the clock itself may fetch it.
A tap on a notification — in the app, on the push notification or on the link under a Pushover message — opens Why this notification?: why you got it, what it probably means, what the source was doing around that moment, and a button to the screen it's about. The explanation only says what the data supports; for a comfort question or the daily report it's one line at most, and a chat answer speaks for itself.
And it doesn't repeat itself. A notification that keeps coming back isn't ten notifications but one problem. If the same notification returns within the hour, a counter grows on the row that's already there — "94× since last night, latest three minutes ago" — instead of a new row and a new delivery. A watchdog that polls a device every minute only counts a fault after three failed rounds in a row. And every kind has a normal maximum per day, which the admin can adjust under Settings › Notifications; a nightly check flags which kind went over it. That limit blocks nothing: it makes visible that a watchdog has grown too noisy, before everyone learns to ignore its notifications.
Talking to the house
The conversation with the analyst can also be spoken. The phone records, the server listens, the analyst answers and the phone reads the answer aloud. Listening and reading aloud go via ElevenLabs first, with the house voice Lumen — the same voice the clock speaks with — and fall back to a local engine next to the app. The order per direction can be chosen in Settings: ElevenLabs with local as fallback, ElevenLabs only, local first, or local only. The speech panel on the phone says honestly where the recording goes. If ElevenLabs rejects the key or the credit has run out, the house skips that service for an hour; and reading aloud in the chat has a daily ceiling, so the clock, which shares the same credit, is never left without a voice. Every spoken turn records which engine handled it and whether that was a fallback.
The answer starts to sound while the voice is still speaking, and Stop cancels the request immediately. The spoken answer is deliberately short — a few sentences, numbers written out, the full text collapsed under "Details". Recognition is given the names of this house, with a post-correction on exactly those proper names. And the most important guardrail is about silence: a speech model that hears nothing invents a sentence. Too little real speech, or one of the known hallucinated phrases, therefore counts as an empty recording — "I didn't catch anything", never an invented question wandering into the conversation.
The waste collection calendar — straight from the municipality, on the wall tablet
The wall tablet shows the next collection day for household waste, big and clear. The collection dates come straight from the municipality's waste calendar, as an iCalendar feed that Homey_Log fetches at start-up and at four fixed moments a day; if the municipality changes the route, that's visible at the next round. There are four kinds — GFT (organic waste, weekly), PMD (plastic, metal and drink cartons, fortnightly), paper and residual waste (monthly). A tap on the tile shows the next two weeks, and a button unfolds the rest of the year.
On collection day a notification goes off at six in the morning — for example "GFT vandaag" (organic waste today) — which only disappears when you press "Ik heb hem aan de weg gezet" ("I've put it out at the curb"). Not by clicking beside it, not by itself. That confirmation applies to the whole house at once: press it on the wall tablet and the notification is gone from your phone too. The Homey app that shows the collection day on the LaMetric clock keeps running alongside, as a parallel system.
Indoor and outdoor climate: the measurement layer beneath the heat pump
Five Netatmo modules hang around the house: Woonkamer (living room), Slaapkamer M&M (bedroom), Bijkeuken (utility room — the base station), Achtertuin (back garden, outdoors) and a rain gauge. Together they measure temperature, humidity, CO₂, air pressure, noise, rain and battery level — which exactly depends on the module.
Homey_Log fetches those readings directly from Netatmo, not as a loose snapshot but as a slice of the measurement series: every hour, per module, the last four hours, with the timestamp Netatmo itself attaches to each reading. Fetching the same reading twice therefore never yields a duplicate row, a stuck module stands out because no new timestamp comes in, and a failed request isn't a lost reading: the next rounds make up for it. That's no theory — when Netatmo refused a quarter of the requests for a while, a snapshot approach would have missed 21 of the 96 quarter-hours. For rain it counts double, because a short shower falling between two fetched readings would otherwise vanish entirely. On top of that, every night at half past four Homey_Log goes over the day that's 24 to 48 hours old and fetches missing pieces after all; if that fails, it's reported as an error.
The Netatmo card in Settings shows how fresh the latest reading is, what the nightly check found and which modules are unreachable. Each module can be paused separately — pausing only silences the notifications, the measuring carries on. And if the connection with Netatmo fails, the notification says which of two faults it is: a worn-out access token (paste a fresh token) or rejected client credentials (then a fresh token is precisely what won't help).
Everything can be viewed in the Climate tab in the House group, with a timeline per room: the temperature by default, with switches for humidity, CO₂, air pressure, noise and rain. Next to the five Netatmo rooms there's a sixth: the meter cupboard, measured by the weather-station gateway. That series comes from an entirely different source, but the climate layer is a list of adapters — so a room keeps one continuous history, even if the meter beneath it changes. Homey_Log also keeps a summary per quarter-hour, to set next to energy consumption. History has been retrieved back to 1 January 2024; Netatmo holds older material too, going back to 2015, and Marc decides whether and when that gets fetched.
Without indoor and outdoor temperature, "the heat pump used 12 kWh" is a number without meaning. With those two it becomes "12 kWh to keep the house at 20 °C with 2 °C outside" — and that is a number you can do something with. This measurement layer is the foundation under the heat-pump analysis in the next chapter.
The heat pump from the inside
The heat pump is by far the biggest consumer in the house, and in the energy accounts also the quietest: a kilowatt-hour figure comes in and nothing else. A NIBE SMO 40 knows much more internally — supply and return temperature, how hard the compressor runs, whether the electric backup heater is enabled, how it lets its heating curve move with the electricity price. All of that is on the unit's own bus, and that bus is read by a small box next to the pump that forwards the messages to Homey_Log.
Every five minutes the collector walks through all registers — one question per register, because the pump only answers one at a time — and writes one row per round: all values together, plus how many registers didn't answer and how long the round took. Those last two numbers are the monitoring itself: a pump that stops answering looks different from a pump that's idle. The register list is the only place where each register's scaling and destination are defined, so adding a register is one line; if a register is marked as a setting, every change gets a log line.
On the Warmtepomp (heat pump) tab those series sit side by side, with a status card above: is the compressor running, how many degrees between supply and return, is there an alarm. Alarms also report by themselves — when the alarm number changes, when an alarm is over, and when the pump stays silent longer than agreed; an information code such as defrosting isn't a fault. On the phone the COP and SCOP sit large side by side at the top, with a strip showing how much heat comes out of the electricity, and below that the current state with one word for what it's doing — idle, heating, cooling, defrosting, hot water — derived on the server. If the latest reading is older than three rounds, the tile turns grey and shows the age of that reading instead of a state.
The heating curve — how warm the water should get at which outdoor temperature — is a setting with two knobs: a curve number and an offset. The shape of that curve lives in the firmware and in no register. What the pump does reveal is the point on the curve right now. Every outdoor temperature that passes yields one point, and over a cold period the pump draws its own line — per combination of curve, offset and whole outdoor degree the median, so a single outlier doesn't lift the line.
Homey_Log reads the heat pump and comments on it, but turns no knob at all. Comfort weighs more in this house than the last percentages of efficiency. That's no temporary caution: winter is there to measure, and the question of whether the house may adjust only comes up once there's a season of figures.
Efficiency instead of consumption. With supply, return and compressor behavior next to the electricity use, the question is no longer "how many kilowatt-hours" but "how much heat per kilowatt-hour" — the COP over the day and over the season, always over whole quarter-hours. The heat pump's electricity use is always the same thing: the sum of three plugs, for the outdoor unit, the controller and the backup heater, defined in one place and used everywhere — in the Power tab, the yearly totals and the gas-free effect.
A day record per winter day. Every night Homey_Log writes one line per day: degree days, kilowatt-hours per degree day, COP, the number of starts, the price blocks, the minutes it was comfortable inside, and per source how complete the data was. That record has been backfilled to early 2024, so the two previous winters stand next to this one as a reference; a night without a calculation stands out the next morning.
How it felt counts just as much. A winter in which only kilowatt-hours were written down yields, come spring, an efficiency chart nobody can do anything with: was the house actually pleasant then? So there's a winter log next to it. The phone app has six buttons — too cold, good, too warm, for the living room and for the bathroom — and one tap records how it felt at that moment, and for whom. You look back at it on the Climate tab, under the chart. Because a button nobody thinks of yields no data, the app occasionally asks for it itself, but only on an evening when the answer is worth something — if it was cold outside, if someone adjusted the pump, or if the electricity price stayed high for a long time — and at most once a day.
The garden: soil moisture instead of a clock
An irrigation system on a timer waters because it's Tuesday. In the ground there are eight wireless moisture sensors, spread over the spots that matter independently of each other — borders, pots, lawn — measuring what's really happening at the roots. They report to their own gateway in the house, and Homey_Log fetches the readings from it every quarter-hour.
On the Garden tab each spot has a tile with the current moisture level and advice in plain language: no need, soon, or now. Below it is the day view, which draws not only the measured course but also what's still to come — the expected rain per hour, evaporation, and the expected moisture course as a dashed projection. That projection is learned, not calculated: the house's own series shows how many percent this soil drops per millimetre of evaporation and rises per millimetre of rain. The rain and evaporation forecast comes from the same weather model that supplies the solar forecast: one source, one fetch path, and a forecast that can be checked just as well.
The garden has one watchdog that speaks up by itself: a sensor that stays silent too long or a moisture level that drops through the floor. All other garden information is there to look up, not to come by unasked — a house that reports every morning that the border is still moist teaches you to ignore its notifications within a week.
What deliberately isn't there yet is the tap. The irrigation controller is ready, but here too: first a season of measuring, only then hang anything on a tap. And there's a known pitfall to solve beforehand — to the water meter's leak detection, automatic watering looks exactly like the thing it warns about.
Where everyone — and every car — is
A house that wants to know whether the solar surplus may go to the car has to know whether that car will still be there in a while. And an analyst explaining consumption gets more out of "nobody was home" than out of any chart. Loose clues are plentiful — Homey knows whether someone's phone is on the wifi, the car integration knows the cars' coordinates, and indoors a net of small bluetooth receivers hears which phone is where — but a clue isn't yet an answer. So there is one answer per subject: four family members, two cars and the house itself, together with which source says so and how old that observation is.
That answer is deliberately layered rather than averaged. The best a system can say is a named place: home, at work, at the sports club. If it can't, then a coordinate with its accuracy. If it can't do that either, then a clue ("probably not home"). And otherwise, honestly: unknown. There's deliberately no certainty score from 0 to 100 in which doubt can disappear: the outcome must be explainable in one sentence. With "home" there may be a room as well — an addition to that one named place, which only the bluetooth net may fill in.
Some sources measure where something was at that moment, others report a change and then fall silent. A phone position is a snapshot and ages. Homey's presence is a state: it reports once that you're home and says nothing for days, and that silence means "nothing changed", not "nothing known". Every source therefore has its own shelf life, adjustable per source. The phone's is six hours, because a phone lying still sometimes reports nothing for hours — and that can be done safely, because a named place always beats a coordinate: an old position can never start claiming "home". A state source has a twelve-hour safety net, so a Homey that falls over at night isn't still calling "home" the next afternoon.
"Home" is too coarse for half the questions. So ten small bluetooth boxes with open firmware hang around the house, listening for the family's phones and watch. They talk to a message broker that runs inside the app itself, with no Homey in between, and which room a box is in is defined in the mapping layer.
Signal strength isn't distance, and the boxes differ considerably in sensitivity; each box is therefore calibrated with a device at one metre. The nearest box within four metres wins, a switch only counts after a minute's stay, and if no reading comes in within range, the system lets go of the room after three minutes: better "no room" than the room from half an hour ago. What remains is a stay: per person a continuous period in one room.
Taking part is a personal choice: under My settings → Share location you enrol your own phone. Whoever does gets the Waar ben ik ("Where am I") tile, on which one tap says which room you're really in — the ground truth against which the system measures its own accuracy.
The sources are Homey's presence, the phones — via OwnTracks and via the app itself — the car telemetry and the bluetooth net. Which source gets priority for which question is configurable. Every transition from one valid place to another is recorded as an event, so "nobody was home" is a statement with a timestamp. On the Location page each subject shows its answer with its layer, source and age, and whether the sources disagreed — a conflict is shown, not polished away. You draw places yourself on a map, and on the phone each car has a "navigate here" button.
The phone positions via OwnTracks run through a small recorder on the home server, which occasionally hangs. Homey_Log therefore keeps watch: if no location comes in for a quarter of an hour and the recorder doesn't answer for three rounds, it restarts that one container, at most once an hour, and reports per outcome what happened. A location never ends up in any notification or log line, and without signing in the app delivers nothing here — not even to its own wall tablet, where the block is simply not drawn.
Where this is headed
The biggest subject is a winter of measuring. The heat pump provides its figures, the house provides its judgements on how it felt, and the weather sits alongside — and only once there's a whole heating season of that is there something to build on. After that comes the reversal this project has had in mind from the start: the house gets policy instead of loose rules. Not "set the charge point to six amps", but "comfort comes before efficiency, and within that comfort it may be as cheap as possible". The comfort prices and the judge are the first form of that; the next step is that such a policy can be put into plain words, and that the brain and the judge both read it.
Closer by is the sum for the whole house. The tank follows the battery: after its shadow period the boiler goes live in the same sum, with the chance requirement and the risk reserve. Then the car, with its departure times and the chance that someone has to leave earlier, and the dishwasher — each time first next to the current planner in the simulation, then in shadow, and only then at the wheel. The execution gap then also comes onto the scoreboard, so each week shows which device left the plan most expensively behind.
Measuring becomes more local too. The pass-through to the inverters is already there; the server will also read the inverters itself along that route, and then record the quarter-hour figures of grid, batteries and plugs directly instead of via the Homey — until, for energy, the Homey is only the radio to the boiler.
Further out, the digital twin grows outward — garden and garage added, with the charge point, the outdoor cameras and the moisture sensors in their real place in the model. And the garden tap waits for a season of figures, in the same order that characterises this whole project: measure first, only then hang anything on a tap.
The overarching goal: full insight into what the house does, and a house that periodically audits itself, with proposals a human reviews — not a house that sits at the controls unsupervised.