The house spirit picks its mood from a ladder: the first condition that holds, top to bottom, wins. That is the right shape for safety (a leak beats everything) and the wrong shape for personality. On the day a new gadget was bought and somebody used an IQOS indoors, the spirit was "thrilled" for 376 minutes of a 12-hour window and "annoyed" for 137 more. Together, 71 percent of the day, two moods, both true, both boring by lunchtime.
A mood engine built on strict priorities has a flaw that only shows up at scale: it is very good at being right and very bad at being interesting. On the day it spent eleven hours alternating between two true moods, the household filed a complaint, and the engine learned to get bored.
A spirit that gets tired of itself
The fix is not a smarter ladder. It is fatigue. Every five minutes a script reads the spirit's
own mood history from the recorder, adds up how long each word has been showing in the last two
and a half hours, and publishes the ones that have had twenty minutes or more. The ladder
carries a small guard on each of its "flavour" branches: and 'thrilled' not in
tired.
A tired mood steps aside, the next true branch takes the stage, and when the sliding window forgets enough of the first mood it can come back. The result is a rotation of about twenty minutes among whatever is true right now, which is what a person watching the display experiences as "it changes".
Three details keep it honest. Nothing is stored; the state is derived from history, so it survives a restart and cannot drift. Hysteresis (tired at twenty minutes, released below twelve) stops it flapping. And the safety moods (alarm, leak, dangerous air, heat, storm, illness) never tire; a spirit that got bored of a leak would be a liability. We started with ten-minute rotation and were told within an hour that it was too fast. Twenty is one number in one file.
What time is it, spirit
The same day's review found the spirit writing "what a lovely day, and I am not alone" at five in the morning, because "cheerful" sat higher in the ladder than "sleepy" and nothing below the safety rules knew the hour. Now the ladder knows.
Between eleven at night and five in the morning a block near the top makes it sleepy if the flat is asleep, tired if somebody is still up, and bleary if somebody has just walked through the entrance, which is the way to the toilet. The diary greeting follows the clock: good morning before ten, lovely day, good evening after six.
The bleary case grew into a proper detector. The way to the toilet is bedroom, living room, entrance, in that order, and the bedroom has two sensors: a presence radar that holds "on" all night because somebody is lying there, and a plain motion sensor, the kind that lights the air monitor's display when you wave at it.
The radar cannot tell "got up" from "asleep". The motion sensor can, though it also fires twenty times a night on people turning over. As the first link of a three-room sequence inside ten minutes it is exactly right, and it is useless alone.
Remarks, on rotation
A detector that only changes a colour is a sensor. One that comments is a character. So the toilet trip between three and eight in the morning gets one of four remarks, rotating every ten minutes so that a second trip does not hear the same joke: "somebody's off to the toilet, and I'm counting steps instead of sheep"; "through the hall at 4 a.m., bladders do not keep hours".
Somebody awake at four in the living room with an IQOS gets a different set, on the theme of neither of us sleeping. Whether the remarks are funny is for the household to judge. That they are situational is the point: they can only appear when the sequence has actually happened, at an hour when it means what it says.
It now changes its mind every twenty minutes or so, which the household considers lively and the engine, if it could consider anything, would probably consider a loss of principle.