The most satisfying automations are the ones where you did not buy a sensor for the thing you are detecting. You already have the signal; it is hiding inside a sensor you bought for something else. It is the closest home automation comes to found money.
None of the sensors in this flat were bought to detect cooking, exercise, or sleep. They were bought to measure air and temperature and whether a door is open. Detection is what you get when you stop asking a sensor what it measures and start asking what it has noticed.
Cooking, from an air-quality sensor
A particulate sensor near the hob sees cooking long before a human would describe the kitchen as smoky. The naive rule, "PM2.5 above X", fires on toast and misses a simmering pot. A rise-based rule works far better: a rate of increase in particulates or volatile organics, at the sensor closest to the source.
The payoff is not knowing that you are cooking. It is everything downstream: air-quality alerts get suppressed, the extractor prompt becomes relevant, and a smoke warning can tell the difference between dinner and a fire.
Two indoor sources that look identical to a particulate sensor
Here is the interesting one. Cooking and heated-tobacco use both raise particulates, so a PM sensor alone cannot separate them, and treating them the same means either false fire alarms or a suppression rule that hides real events.
They separate cleanly on a different pollutant. A formaldehyde channel rises sharply for one and barely moves for the other, while particulates behave the opposite way. The detection rule becomes:
formaldehyde rising AND particulates flat → source A
particulates rising AND formaldehyde flat → source B (cooking)
Two cheap sensors and a conjunction turn an ambiguous signal into an unambiguous one. The general lesson: when one channel cannot separate two events, look for a channel where they differ in opposite directions rather than in magnitude.
Occupancy-free activity detection
A room with no motion sensor can still tell you it is being used. CO₂ concentration rises whenever someone is in it, and the slope of that rise scales with how hard they are breathing. That makes a CO₂ trace a usable proxy for "a recurring activity is happening in here", without any dedicated sensor and without a camera.
Two design notes that make it work. First, anchor on the rate of change, not the absolute level, the level depends on ventilation, room size and how long the door has been shut.
Second, if the room also has an air conditioner, remember that cooling changes temperature and humidity but cannot manufacture CO₂ (a recirculating unit, that is; a system that trades air with outside muddies the channel), which makes CO₂ the one channel that stays honest when other signals are being driven by a machine. The slope itself scales with room volume and whether the door is shut, so its thresholds are per-room, not universal.
Sleep, inferred from the whole home winding down
The obvious signal, bedroom CO₂, is defeated by an open window and by any activity in the room. A better one is the absence pattern across the living areas: media off, no presence for a while, and no activity elsewhere. The home tells you it has gone quiet, and that is a more robust definition of "asleep" than anything measured in the bedroom.
Cross-flat airflow
Two window contacts on opposite sides of a home, both open, is a through-draught, a state neither sensor knows individually. It is worth deriving because it means two opposite things depending on context: excellent when the place is stuffy, and money leaving through the wall when the air conditioning is running. Same physical state, two different notifications.
A sensor that is online and completely wrong
The failure that motivated this one cost eleven days of data. A sensor stayed connected, kept reporting on schedule, and its value never moved. Every availability check passed.
Detect it by watching last-changed rather than last-updated, and require two independent channels from the same device to be frozen at once, a single value can legitimately sit still for a long time, but temperature and CO₂ both freezing means the device is stuck. Then attempt a reload before bothering anyone, and only alert if the recovery failed.
The philosophical objection is that inference is guesswork. The practical answer is that so is everything else, and at least the guesses here come with timestamps.