The logic map
The whole system on one page. On the left, what the house measures. In the middle, what it makes of it. On the right, what it does.
0 of 77 explained
Coming in episode 1: 3 building blocks
- 16inputs
- 52functions
- 9outputs
- 12chains from sensor to action
How to read the map
Left to right
Every chain runs from an input on the left, through functions in the middle, to an output on the right. Arrows show which block uses which value.
One lane per area
Solar, battery, grid, heating and costs each have their own lane and colour. The safety nets run along the bottom, across everything.
Grey means: video follows
Everything is visible from day one. Blocks that haven't been explained yet are grey. With every video, a few of them get their colour and become clickable.
Click for the why
Each block tells you what it does, why it exists, which values it uses and which video explains it.
Interactive map
Legend
Areas
- Solar (PV)
- Grid & consumption
- Battery
- Costs & planning
- Heating & cooling
- System & safety
Types
- Input
- Function
- Output
Status
- Not explained yet – video follows
- Explained in a video
- Shadow mode: calculates and logs, but doesn't switch anything yet
- Still being checked against the real system
The map is wider than this window: scroll sideways (Shift + mouse wheel) to reach the outputs on the right, or zoom out with “−”.
Click or tap a building block – or press Enter on it – to see what it does.
All building blocks as a list
Solar (PV) 7
Measures how much power each solar inverter delivers right now – the basis for every energy balance and every learner.
Fetches cloud cover, solar irradiance and outdoor temperature hour by hour from a weather service – the only outside data source for the solar forecast.
PV yield from physicsFunction
Calculates hour by hour from the position of the sun, cloud cover and irradiance how much each group of panels facing the same way will produce.
Total PV powerFunction
Adds all solar sources up into one number and flags it clearly when a source is missing.
PV learner (correction table)Function
Learns in a table by month, cloud level and hour how far the physics calculation is systematically off, for example because of shade or dirt.
Correction for each forecast hourFunction
Applies the learned correction to every future hour using that hour's own cloud cover, instead of stretching one factor across the whole day.
Forecast duelFunction
Compares the raw physics and the corrected forecast every day and only switches the correction on once it has clearly proven to be better.
Grid & consumption 7
House load, grid import, voltage/frequencyInput
Measures the total household consumption, the power drawn from the public grid, and the voltage and frequency in the house.
Wallbox power (read only)Input
Measures how much power the electric car is charging with; the system only watches this and does not control it.
Load protection (load jumps, shedding)Function
Only allows large consumers to switch on when there is enough reserve, and sheds loads when the house supply reaches its limit.
Base load (house without controllable loads)Function
Subtracts the heat pump and the miners from the total consumption, so the system does not mistake its own actions for household demand.
Consumption profile (learner)Function
Learns the typical daily curve of the base load, separately for weekdays and weekends, with a memory of about ten days.
Consumption forecast from nowFunction
Turns the learned daily curve into a forecast for the next 24 hours starting now and switches the day type at midnight.
Same-day consumption adjustmentFunction
Compares plan and reality of the last few hours and scales up the rest of the day when the house uses more than expected, for example on laundry day.
Battery 16
Battery management (BMS) of the packsInput
Each battery pack reports voltage, current, cell temperatures and whether charging or discharging is allowed – only it knows the limits of its cells.
Miner telemetryInput
Each crypto miner – a computer used here as a flexible power consumer – reports its power draw, computing speed, temperatures and restarts.
Charge level from the battery monitor (shunt)Input
Counts every amp-hour flowing into and out of the battery and so provides the charge level the system really trusts.
Thermal step control per minerFunction
Steps down only the miner that is too hot, one step at a time, and switches it off only as a last resort.
Battery current limits per packFunction
Works out for each battery pack how much current it may take or give right now – never less than a small minimum – and a veto only blocks the affected pack.
Charge level source with 30-minute grace periodFunction
Controls only with the battery monitor's charge level; if it goes silent, the last value may still apply the brakes for 30 minutes before the average of the battery packs takes over.
Charge level emergency brake with restart hysteresisFunction
Stops the miners immediately when the battery gets too low and only lets them restart once the charge level is clearly higher again and some time has passed.
Battery price (weighted average)Function
Keeps a ledger of what the energy in the battery cost: solar charging is free, grid charging costs its price, and the average per kWh is what counts.
Dead-man policy for battery limitsFunction
If the sender of the battery limits fails, the last value is held and then slowly ramped to a generous floor – never to zero.
Daytime surplus miningFunction
Lets the miners run during the day when the sun delivers more than the battery needs to become full, so no solar power is wasted.
Mining schedule (6-hour blocks)Function
Turns the energy to be drained into an even power level for the miners, holds it for six-hour blocks and only corrects it at the end of a block.
Discharge planner (drain)Function
Searches for the lowest morning charge level from which the sun can still fill the battery to 100 % in the afternoon, so there is room for the coming solar day.
Grid charging on demandFunction
Looks several days ahead, works out how much energy the sun will not deliver and buys just that amount from the grid in the cheapest known hours.
Battery limits to the control unitOutput
Would send the current limits of every pack to the central control unit of the inverters – so far only in shadow mode.
Miners: power levelOutput
Sets each miner to one of its fixed power levels – this is how the planned room in the battery is actually created.
Grid charging: minimum charge level / charge commandOutput
Raises the minimum charge level or switches the charger on, so that the grid charging plan physically happens.
Costs & planning 6
Gas price, instalments, meter readingInput
Knows the gas price per kWh, the standing charge, the account balance and the latest meter reading.
Wholesale electricity priceInput
Provides the electricity price for every quarter of an hour of today, and from about midday also for tomorrow.
Heat price decision (heat pump or gas)Function
Compares what one kWh of heat costs from the heat pump (battery price divided by COP) and from gas, and lets the cheaper heat source win.
Cost optimiser (linear program)Function
Once a day, calculates the cheapest 24-hour plan for battery, grid and generation with a mathematical optimisation.
Simple day planner (greedy)Function
Picks the hours simply by their price rank – easy to explain and fast, but deliberately not perfect.
Energy gate (operating mode)Function
Chooses one of four operating modes from charge level, price and solar outlook – solar direct, arbitrage, avoid grid or emergency – with a buffer so it does not flip back and forth.
Heating & cooling 30
Heat pump readings (data bus and power meter)Input
Reads flow and return temperature, operating mode, error codes and power draw of the heat pump – what the machine really does, not what it was told.
Four outdoor temperature sensorsInput
Four sensors in different places measure the outdoor temperature, because a single one can be fooled by sunshine or waste heat.
Room sensors and desired temperaturesInput
Measures the temperature in every room and knows which temperature the operator would like to have there.
A three-phase meter measures the combined power of the split air conditioners – the only reliable sign that they are really running.
Hot water tank sensors (top/bottom)Input
Measures the temperature at the top and bottom of the hot water tank; cold water flowing in at the bottom reveals that someone is using hot water.
Gas condensing boiler readingsInput
Reports the boiler's flow temperature, whether the burner is on and which way the diverter valve points (hot water or heating).
Compressor start counterFunction
Counts how often the heat pump's compressor really starts each day, because too many starts shorten its life.
Room solar gain learnerFunction
Learns for each room how much warmer the sun makes it while the heating is off, and lowers that room's setpoint accordingly.
Open window detectionFunction
Notices a sudden drop in room temperature and briefly lowers the flow temperature, so the heat pump does not heat against an open window.
Bus protection (rate limiter and emergency stop)Function
Makes sure the heat pump is not flooded with requests and, after an error, waits longer and longer before trying again.
House setpoint (weighted average)Function
Forms one target temperature for the whole house from the rooms that count – a lead room has priority, technical rooms never count.
Hot water usage profile and heating timeFunction
Learns when hot water is usually used and schedules the tank heating so that it is finished shortly before.
One outdoor temperature for allFunction
Combines the outdoor sensors into a single value, leaves out outliers and outdated readings – and every other part of the system reads only this value.
Hot water priority and legionella protectionFunction
Pauses space heating while the hot water tank is being heated and keeps an eye on whether the water regularly reaches 60 °C for hygiene.
Heat demand learnerFunction
Learns how many kWh of heating, cooling and hot water the house needs per day at each outdoor temperature.
Building model (heat loss and inertia)Function
Is meant to learn how much heat the house loses per degree and how quickly it cools down, so that heating could be planned ahead.
Solar flow temperature reduction (K_solar)Function
Lowers the flow temperature by up to 5 degrees during the day, depending on how strongly the sun is shining.
COP map (coefficient of performance)Function
Learns how much heat one kWh of electricity delivers for each combination of outdoor and flow temperature, separately for heating, cooling and hot water.
Flow temperature from a weighted average of all roomsFunction
Works out the flow temperature each room would need and averages them by heat demand, so one problem room cannot overheat the whole house.
Heating/cooling switch (hysteresis)Function
Decides from a smoothed outdoor temperature whether to heat, cool or rest, with a buffer zone so the mode does not flicker.
Learned heating curveFunction
Learns for each outdoor temperature range which flow temperature keeps the rooms stable, anchored by one experience value for very cold days.
Flow temperature reduction learnerFunction
Learns how much lower than calculated the flow temperature can be without the house cooling down – it may only lower, never raise.
Restoring the target stateFunction
Compares what the heat pump should be doing with what it is doing and, after a restart or error, restores the right settings step by step.
Flow setpoint: whole degrees, every 20 minutesFunction
Combines heating curve, reductions and corrections into one setpoint, rounds it to whole degrees and sends it at most every 20 minutes.
Air conditioning decision (split unit or heat pump)Function
Brings three formerly separate air conditioning rules together into one decision about when the split units should run.
Gas valve rule (one owner per actuator)Function
Exactly one controller sets the boiler's diverter valve – it switches immediately when needed and otherwise only checks back at growing intervals.
Heat pump: flow setpoint and modeOutput
Sends the flow temperature setpoint and the operating mode to the heat pump via the protected data bus.
Hot water: heating and setpointOutput
Starts hot water heating and sets the target temperature of the tank, at most 65 °C.
Air conditioners: mode and setpointOutput
Would switch the split air conditioners on and off as a third source of heating or cooling – so far mostly in shadow mode.
Gas boiler: mode and valveOutput
Switches the gas boiler to off, standby or heating and sets its valve – the backup heating for when the heat pump is off or more expensive.
System & safety 11
Operator settings and rulesInput
The setpoints, limits (such as the minimum charge level or quiet hours) and enable switches chosen by the person who runs the house – the goals the code tries to meet.
Freshness rule: every value has an ageFunction
Keeps track of how old every reading is; once it is too old it counts as “unknown” – never as zero and never as the last value.
Read-only safety switch (fail-closed)Function
As long as switching has not been explicitly allowed, the system may only read and not control anything – and tests can never reach the real house.
Flight recorder (who switched what, when)Function
Records every decision, command and message together with its sender, so that afterwards it is always clear who switched what.
Value store with one writer per valueFunction
A central store in which every value has exactly one owner who may write it, while everyone else may only read it.
Learning quality (a grade for every learner)Function
Checks every day how close each learner's predictions came to reality and gives it a grade with a 14-day trend.
Emergency watchdog outside the energy management (EP3)Function
A planned independent guard that notices when the energy management is gone, silent or wrong and then sends safe default limits and an alert.
Forecast combiner (24-hour grid)Function
Puts the price, solar and consumption forecasts onto one shared hourly timeline and shows a gap instead of an invented zero when a source is missing.
Plausibility watchdog (decision vs. result)Function
Checks every two minutes, without changing anything, whether the system is really doing what it was told to do.
Display: dashboard, “My day”, learning centre, diagramOutput
Shows energy flows, the day plan, forecasts and learning progress, so the operator understands what the system does and why.
Alerts: ticker, display, messageOutput
Reports only what the operator can act on and what is genuinely new – no message means everything is fine.
12 chains from sensor to action
Chain 1
Heating by outdoor temperature
Four sensors, one outdoor temperature, a learned heating curve, and a flow temperature in whole degrees.
Steps in order (10)
Four outdoor temperature sensors → One outdoor temperature for all → Learned heating curve → Flow temperature from a weighted average of all rooms → Open window detection → Room solar gain learner → Flow temperature reduction learner → Flow setpoint: whole degrees, every 20 minutes → Bus protection (rate limiter and emergency stop) → Heat pump: flow setpoint and mode
Chain 2
Tomorrow's sun, all the way to the battery plan
Weather forecast, physics, a learned correction, and a duel that decides whether the correction may count.
Steps in order (7)
Weather forecast (48 h) → PV yield from physics → PV learner (correction table) → Correction for each forecast hour → Forecast duel → Forecast combiner (24-hour grid) → Discharge planner (drain)
Chain 3
Making room in the battery overnight
How low can the battery go by morning and still reach 100 % in the afternoon?
Steps in order (9)
Forecast combiner (24-hour grid) → Same-day consumption adjustment → Charge level source with 30-minute grace period → Discharge planner (drain) → Mining schedule (6-hour blocks) → Thermal step control per miner → Charge level emergency brake with restart hysteresis → Miners: power level → Daytime surplus mining
Chain 4
Heat pump or gas?
Battery price divided by COP, against the price of gas heat.
Steps in order (9)
House load, grid import, voltage/frequency → Wholesale electricity price → Battery price (weighted average) → COP map (coefficient of performance) → Gas price, instalments, meter reading → Heat price decision (heat pump or gas) → Gas valve rule (one owner per actuator) → Gas boiler: mode and valve → Heat pump: flow setpoint and mode
Chain 5
Grid charging in winter
Only the shortfall, only in the cheapest known hours. At a price of zero or below, always.
Steps in order (5)
Wholesale electricity price → Forecast combiner (24-hour grid) → Charge level source with 30-minute grace period → Grid charging on demand → Grid charging: minimum charge level / charge command
Chain 6
Battery charge and discharge limits
What the battery can take, pack by pack, and what happens when the sender goes quiet.
Steps in order (5)
Battery management (BMS) of the packs → Freshness rule: every value has an age → Battery current limits per pack → Dead-man policy for battery limits → Battery limits to the control unit
Chain 7
Hot water
Learn when hot water is used, and finish heating before that, not after.
Steps in order (4)
Hot water tank sensors (top/bottom) → Hot water usage profile and heating time → Hot water priority and legionella protection → Hot water: heating and setpoint
Chain 8
From learner to grade
Every learner is graded against reality. The loop closes through a human.
Steps in order (7)
Learned heating curve → PV learner (correction table) → COP map (coefficient of performance) → Hot water usage profile and heating time → Consumption profile (learner) → Learning quality (a grade for every learner) → Alerts: ticker, display, message
Chain 9
Trust in measured values
Every value has an age. Too old means unknown, never zero.
Steps in order (4)
PV output per inverter → Heat pump readings (data bus and power meter) → Charge level from the battery monitor (shunt) → Freshness rule: every value has an age
Chain 10
When the heat pump “crashes”
Stop asking, wait a little longer each time, then restore the desired state step by step.
Steps in order (5)
Heat pump readings (data bus and power meter) → Bus protection (rate limiter and emergency stop) → Restoring the target state → Heat pump: flow setpoint and mode → Hot water: heating and setpoint
Chain 11
Consumption profile and daily correction
What the house uses without the big controllable loads, learned over days and adjusted during the day.
Steps in order (8)
House load, grid import, voltage/frequency → Heat pump readings (data bus and power meter) → Miner telemetry → Base load (house without controllable loads) → Consumption profile (learner) → Consumption forecast from now → Same-day consumption adjustment → Discharge planner (drain)
Chain 12
Safety net for the battery charge
If the main charge sensor goes quiet, its last value may still brake for 30 minutes, but never release. Then a backup takes over.
Steps in order (5)
Charge level from the battery monitor (shunt) → Charge level source with 30-minute grace period → Charge level emergency brake with restart hysteresis → Miners: power level → Flight recorder (who switched what, when)
The map grows
The map shows everything that's known today. When new systems join, or a block turns out to be two, new grey areas appear. That's not a flaw. That's the plan.
Your experience counts
Which system runs in your house, and where does it get stuck? I'd like to hear about your experiences, your doubts and your ideas, in the comments under the videos. Good ideas get picked up and built in public: as a video of their own or as an addition to an existing one.
To the channel