Can a CO2 Log Show When You Ventilated? Comparing AI Estimates with Rule-Based Detection on 5-Minute Data from an Italian Living Room

One way to cut down on winter window condensation is to ventilate. Yet when you opened a window, and how much air was exchanged, usually goes unrecorded. If you keep an indoor CO2 monitor, the CO2 log captures the pattern: CO2 builds up in an occupied room and drops when outside air comes in. So can you read that log afterwards and pinpoint when the room was ventilated? And what answers come back if you hand the reading over to AI?
This article contains affiliate links. As an Amazon Associate, we earn from qualifying purchases.
The data come from a public dataset (CC BY 4.0) recorded every 5 minutes in the south-facing living room (25 m²) of an apartment in Bolzano, Italy. This site did not measure the room itself. One caveat up front: the dataset has no record of when the windows were opened. Since there is no way to check which answers were right, this article does not report hit rates. Instead, it uses a rule defined by this site to pick out intervals in which CO2 and room temperature fell at the same time, and counts how often the times the AI named overlap with them (called agreement below). What the rule picks up are ventilation candidates, not necessarily the times a window was opened.
The results first. Over the 479 days with data in the heating season (November to March), the rule found 260 ventilation candidates (0.543 per day), concentrated in the 7 a.m. and 8 a.m. hours. For the 258 candidates with readings both before and after, comparing 30 minutes before with 60 minutes after gave a median drop in absolute humidity of 0.82 g/m³.
When AI was given one week of the same living room log, claude -p (claude-sonnet-5-5) with the rule spelled out in words named the same times as the rule in both weeks. Asked without the rule which times the room was probably ventilated, it matched 7 of the rule’s 9 candidates in one week and named 11 times against the rule’s 3 in the other. The local gemma4:12b nearly filled its context limit with one week of CSV, and even with the data cut to 3 days, agreement stayed low. Every condition was run once.
- Where the CO2 log comes from — 5-minute records from a living room in Bolzano
- Before reading CO2 values — 1,000 ppm is a building management standard, and the global outdoor average is 425.63 ppm
- The rule for picking ventilation candidates — CO2 falls 200 ppm and room temperature 0.5°C within 30 minutes
- 260 candidates in 479 heating-season days — ventilation candidates clustered in the 7 a.m. and 8 a.m. hours
- Around the ventilation candidates, absolute humidity fell by a median of 0.82 g/m³
- Outside air at 70–80% relative humidity still holds only 50–60% of the living room’s water vapour
- Giving AI the same CO2 log — one week and three days, with and without the rule
- Results — given the rule, Claude named the same times as the rule on the one-week data
- The local gemma4:12b nearly filled its context limit with one week of CSV
- How to read it — do not leave the ventilation decision to AI; set the rule first and pass it on
- What this measurement cannot tell you
- Summary — a CO2 log gives you ventilation candidates, and a person sets the rule for judging them
- Sources
Where the CO2 log comes from — 5-minute records from a living room in Bolzano

The data are “Indoor Environmental Quality – Residential Apartment, Bolzano, Italy (2023–2026)”, published on Zenodo on 2026-05-09 by Cristian Pozza under a CC BY 4.0 licence. According to the record’s description, it logs temperature, relative humidity, CO2, noise and barometric pressure every 5 minutes in the south-facing living room (25 m²) of an apartment building in Bolzano. The home has radiators for heating and an air conditioner for cooling. This article does not use the noise or pressure data.
The device is the Netatmo Smart Indoor Air Quality Monitor, listed in the record as HomeCoach. According to the specifications on its product page, it records every 5 minutes; temperature runs from 0 to 50°C with ±0.3°C accuracy, relative humidity from 0 to 100% with ±3% accuracy, and CO2 is measured from 0 to 5,000 ppm.
The product page has no line for CO2 accuracy; Netatmo’s help page puts it at ±100 ppm. The same help page says a 200 ppm difference between two units is perfectly normal. CO2 values should be read with a margin of about that size.
The CSV comes as four files, one per calendar year (2023–2026), with 311,692 rows in total. Despite the four files, the first and last timestamps span 2023-03-04 to 2026-05-06, about 3 years and 2 months. There are gaps. By this site’s count, 93.36% of the 5-minute slots in the period are filled, and there are 181 gaps longer than 15 minutes. The longest is 277 hours, from late April to early May 2023.
Timestamps need care. The record’s description says nothing about the time zone. However, on the spring days when daylight saving time begins (2023-03-26, 2024-03-31, 2025-03-30), the 2 a.m. hour is missing, and on the autumn days when it ends (2023-10-29, 2024-10-27, 2025-10-26), each time in the 2 a.m. hour appears twice. This site therefore concluded that the timestamps are Italian local time with daylight saving. Because the first and second 2 a.m. hours in autumn cannot be told apart, the 67 rows from those 3 days were dropped. Those 3 days fall in October and would not enter the heating-season tally anyway.
One more detail: the seconds in the timestamps are irregular (30, 38, 55 seconds and so on). This article therefore gives times without seconds.
Attribution: the data are C. Pozza (2026). Indoor Environmental Quality – Residential Apartment, Bolzano, Italy (2023–2026). Zenodo. DOI 10.5281/zenodo.20098783, licensed under CC BY 4.0. The tallies, tables and figures in this article were produced by this site by processing that CSV. The CSV itself is not reproduced here; please download the original data from the Zenodo record.
Before reading CO2 values — 1,000 ppm is a building management standard, and the global outdoor average is 425.63 ppm

This article treats CO2 concentration only as an indicator of how much ventilation is happening. Many people associate CO2 with 1,000 ppm. One source of that figure is Japan’s Order for Enforcement of the Act on Securing a Sanitary Environment in Buildings (Kenchikubutsu Eisei-ho Shikorei). Article 2 sets the building environmental sanitation management standards, and item 3 of the table in Article 2, item 1(a) sets the carbon dioxide content at “1,000 parts per million or less” (1,000 ppm or less).
However, the standard applies only to the specified buildings defined in Article 1: occupied rooms with air conditioning or mechanical ventilation in buildings used as shops, offices, department stores, libraries, inns and the like, with a total floor area of 3,000 m² or more (8,000 m² or more for schools and similar). Homes are not among the covered uses. So 1,000 ppm is a building management standard, not a value set for homes to meet. This article does not judge the living room’s readings against it.
Outdoor CO2 is not a single fixed value either. According to NOAA’s Global Monitoring Laboratory, the 2025 global average was 425.63 ppm (an average of marine surface sites, data as of 2026-11-19). Urban outdoor air, on the other hand, varies from day to day and hour to hour (Batterman, 2017). Outdoor CO2 in Bolzano is not part of this dataset.
The living room record has some odd values too. 1.1% of the readings (3,458 points) are below 400 ppm, with a minimum of 329 ppm. Since values below the global average were recorded, the sensor’s absolute readings may be offset. At the other end, 6 readings sit at 5,000 ppm, the top of the measuring range. This article therefore picks out ventilation candidates by how far CO2 drops over a short time, not by its absolute level.
The rule for picking ventilation candidates — CO2 falls 200 ppm and room temperature 0.5°C within 30 minutes

The rule is this site’s own definition and has three parts.
- If, within 30 minutes from a given time, CO2 falls by 200 ppm or more and room temperature falls by 0.5°C or more over the same 30 minutes, the start of that interval is a “ventilation candidate”
- The next candidate must be at least 60 minutes after the previous one
- Only 5-minute values from the heating season (November to March) are used
Because the definition only requires the drop to be complete within the next 30 minutes, a candidate can be a little earlier than the moment the values actually start falling. An AI answer counted as agreeing with a rule candidate when the two times were within ±15 minutes of each other.
The rule does not rely on CO2 alone because CO2 also falls when people leave the room. Batterman (2017), who reviewed how to derive air change rates from the CO2 decay (the decay method), also lists the decay method as usable after occupancy, when people leave or their number drops. Opening a window in winter lets in cold outside air, so room temperature should fall too. That is why the rule requires CO2 and room temperature to fall together. Even so, if the heating was switched off just as people left, the same pattern could appear without any window being opened.
Limiting the analysis to the heating season also has a reason. This home has an air conditioner, so in summer the room can cool down without a window being opened. In addition, Ume-Ezeoke et al. (2024, an arXiv preprint), who estimated window opening in homes from indoor temperature alone, report that their method beat another method (SVM) on the main metric, except when the indoor–outdoor temperature difference was small. The reasoning here is that ventilation shows up more clearly in the room temperature in winter, when the difference from outside is large.
The thresholds were set as follows. The 200 ppm for CO2 follows Batterman (2017), who writes that for the decay method a change of 100 ppm or more is often enough, but that, given the performance of typical instruments, at least several hundred ppm is preferable, together with the ±100 ppm accuracy from Netatmo’s help page. The 0.5°C for room temperature asks for a drop larger than the ±0.3°C accuracy, given that the readings are in 0.1°C steps. No published precedent offering numerical thresholds like these was found. They are this site’s own definition.
For the window length, the preliminary plan was 15 minutes. Before running anything, it was decided to count both, with 30 minutes as the main result and 15 minutes as a sensitivity check, and this was not changed after seeing the results.
What the decay equation shows, and why this article does not report air change rates
Batterman’s (2017) decay method assumes a single well-mixed room, in which the difference between indoor CO2 and the CO2 of the incoming air shrinks exponentially. As an equation:
C(t) = (C_s − C_r) × exp(−A_d × t) + C_r
C(t): indoor CO2 at time t (ppm); t is elapsed time (h)
C_s: concentration when the decay starts; C_r: concentration of the incoming air
A_d: air change rate derived from the decay (per hour)
Subtracting C_r from both sides and taking logarithms, ln(C(t) − C_r) becomes a straight line in time, and A_d follows from its slope. The paper also lists the assumptions: a single well-mixed room, careful choice of the time window to analyse, and the caution that opening windows increases spatial variation in indoor concentration, which can break the single well-mixed room assumption.
This article does not compute air change rates with this equation. The CO2 of the incoming air (C_r) is not in the data, and if the global average of 425.63 ppm were assumed, the living room readings below 400 ppm would make the value inside the logarithm negative at some points. The equation is used only to read the CO2 decline as the gap to the outside air narrowing.
260 candidates in 479 heating-season days — ventilation candidates clustered in the 7 a.m. and 8 a.m. hours

The heating season has 131,107 rows of 5-minute values, covering 479 days with data. The 30-minute rule found 260 ventilation candidates, or 0.543 per day. The 15-minute rule found 123 (0.257 per day), a little under half of the 30-minute count (123 ÷ 260 ≈ 0.47). Since the same drop has to happen in a shorter time, a smaller count is what the definition would lead you to expect.
Counts per winter are shown below. Each winter is labelled by the year in which its November falls. The first winter only includes March 2023, because the data start on 2023-03-04.
| Winter | Months covered | 30-minute rule (count) | 15-minute rule (count) |
|---|---|---|---|
| 2022–23 | March 2023 only | 11 | 8 |
| 2023–24 | November 2023 – March 2024 | 78 | 40 |
| 2024–25 | November 2024 – March 2025 | 96 | 46 |
| 2025–26 | November 2025 – March 2026 | 75 | 29 |
| Total | — | 260 | 123 |
The data cannot explain the differences between winters, because nothing records whether the number of window openings changed or whether occupancy or heating habits changed. The amount of missing data also varies slightly from winter to winter (from 2023–24 to 2025–26, 94.7–95.7% of the 5-minute slots are filled).
By time of day, on the other hand, the skew is clear. Counting the start times of the candidates (local time) by hour gives the following.
| Hour | 30-minute rule (count) | 15-minute rule (count) |
|---|---|---|
| 7 a.m. | 50 | 23 |
| 8 a.m. | 44 | 15 |
| 9 a.m. | 31 | 13 |
| 10 a.m. | 19 | 10 |
| 11 a.m. | 19 | 12 |
| 12 p.m. | 20 | 13 |
| 1 p.m. | 17 | 7 |
| 2 p.m. | 17 | 4 |
| 3 p.m. | 7 | 5 |
| 4 p.m. | 5 | 3 |
| 5 p.m. | 6 | 3 |
| 6 p.m. | 6 | 3 |
| 7 p.m. | 13 | 9 |
| 8 p.m. | 4 | 2 |
| 9 p.m. | 1 | 0 |
| 10 p.m. | 1 | 1 |
| 11 p.m. – 6 a.m. | 0 | 0 |
Under the 30-minute rule, the 7 a.m. and 8 a.m. hours account for 94 candidates, 36% of the 260 ((50 + 44) ÷ 260 ≈ 0.36). The morning continues through the 9 a.m. to 12 p.m. hours, the afternoon tails off from 3 p.m., and there is a small peak in the 7 p.m. hour. There were none at all from 11 p.m. to the 6 a.m. hour. Under the 15-minute rule, too, the busiest hour is 7 a.m. with 23.
A household that opens the windows right after getting up could produce this pattern. But morning may also be when people move in and out of the room and the heating changes mode. The record has neither, so this skew is read only as the times of day when CO2 and room temperature tend to fall together.
Around the ventilation candidates, absolute humidity fell by a median of 0.82 g/m³

Ventilation helps against condensation when it lowers the amount of water vapour in the room air and so lowers the dew point. For each candidate, absolute humidity (grams of water vapour per cubic metre of air, g/m³) was therefore compared before and after. The conversion uses Vaisala’s humidity conversion formulas.
A = 2.16679 × Pw ÷ T
A: absolute humidity (g/m³); Pw: water vapour pressure (Pa); T: temperature (K)
Pw = (U ÷ 100) × ew(t) × 100
U: relative humidity (%); ew(t): saturation vapour pressure over water (hPa)
the final 100 converts hPa to Pa
ew(t) = 6.112 × exp(17.62 × t ÷ (243.12 + t))
t: temperature (°C)
The saturation vapour pressure ew(t) was calculated with the Magnus-type approximation (over water, −45 to 60°C) from the WMO (World Meteorological Organization) guide to observing instruments, the same as in Why does winter condensation form on windows? — Measure, ventilate and insulate, reasoning from the dew point and the window surface temperature (published 2026-11-30).
The coefficient 2.16679 is almost equal to 1,000 times the reciprocal of the specific gas constant of water vapour (about 461.5 J/(kg·K), the gas constant 8.314462618 J/(mol·K) divided by the molar mass of water, 18.0153 g/mol). In Vaisala’s worked example (water vapour pressure 1,870 Pa, from Vaisala’s own saturation vapour pressure formula), the absolute humidity at 20°C and 80% is 13.82 g/m³. Calculating the same conditions with the WMO formula used in this article gives 13.79 g/m³.
The comparison is between absolute humidity 30 minutes before the start of a candidate and 60 minutes after. Because the record has gaps, “30 minutes before” was limited to readings 30–40 minutes before and “60 minutes after” to readings 60–70 minutes after, and candidates without a reading in those windows were not compared. Under the 30-minute rule, 2 of the 260 candidates dropped out for lack of a reading 60 minutes after; under the 15-minute rule, 1 of the 123.
For the 258 candidates under the 30-minute rule, the median difference (before − after) was 0.821 g/m³, with quartiles of 0.442–1.164 g/m³. The median of the before values was 8.883 g/m³ and the median of the after values 8.028 g/m³ (both computed only over the compared candidates). The difference of the medians (8.883 − 8.028 = 0.855) and the median of the differences (0.821) do not match because the calculations are done in a different order.
| Rule | Candidates (count) | Compared (count) | Median difference (g/m³) | Quartiles of difference (g/m³) | Median 30 min before (g/m³) | Median 60 min after (g/m³) |
|---|---|---|---|---|---|---|
| 30 minutes | 260 | 258 | 0.821 | 0.442–1.164 | 8.883 | 8.028 |
| 15 minutes | 123 | 122 | 0.829 | 0.482–1.299 | 8.920 | 7.992 |
Reading this difference requires taking the hygrometer’s accuracy into account. The ±3% relative humidity accuracy corresponds to about ±0.52 g/m³ of absolute humidity at 20°C (2.16679 × 0.03 × 2,332.6 Pa ÷ 293.15 K ≈ 0.52, where 2,332.6 Pa is the saturation vapour pressure at 20°C from the WMO formula). Humidity is also recorded in 1% steps, and 1% at 20°C is about 0.17 g/m³.
Note, however, that ±0.52 g/m³ is the accuracy of a single reading, which is not the same as the uncertainty of a before–after difference. The uncertainty of the difference depends on the size of the temperature and humidity errors at the two times and on how those errors are correlated (NIST’s explanation of the propagation of uncertainty). This article counts a difference of about 0.5 g/m³ or more as a decrease, and treats smaller differences as “not judged a decrease by this criterion”. The 0.5 g/m³ is a working category this site set from that accuracy estimate, not a threshold that guarantees a decrease.
By this criterion, the median difference of 0.82 g/m³ is above 0.5 g/m³. By the definition of the median, at least half of the compared candidates had a difference of 0.82 g/m³ or more. On the other hand, the lower quartile is 0.442 g/m³, so at least a quarter of the candidates fell short of 0.5 g/m³ and are not judged a decrease by this criterion. In other words, at many of the times when CO2 and room temperature fell together, the amount of water vapour fell too, but not at every candidate.
Absolute humidity can be calculated from temperature and relative humidity. With a thermo-hygrometer that logs both, you can make the same before-and-after comparison in your own room.
Outside air at 70–80% relative humidity still holds only 50–60% of the living room’s water vapour

Ventilation removes water vapour from a room because cold winter air holds little water vapour even when its relative humidity is high. This was checked against outdoor data for Bolzano. The source is the meteorological data of the Autonomous Province of South Tyrol (licensed CC0, no login needed): 10-minute air temperature and relative humidity from station 83200MS (Bozen/Bolzano) at 245 m above sea level. The data description says these are raw, unvalidated data. They also come from a station in the city, not from just outside the living room window.
Per-winter medians are shown below. Outdoor absolute humidity was calculated with the same formula as for the living room, from each 10-minute pair of temperature and relative humidity. Outdoor records with relative humidity above 100% (all of them 100.1%) were excluded from the calculation; from 2023–24 to 2025–26 they make up 10.0–13.5% of the outdoor records.
| Winter | Outdoor temperature (°C) | Outdoor relative humidity (%) | Outdoor absolute humidity (g/m³) | Living room relative humidity (%) | Living room absolute humidity (g/m³) | Outdoor ÷ living room |
|---|---|---|---|---|---|---|
| 2022–23 (March 2023 only) | 10.9 | 49.9 | 5.05 | 47.0 | 8.25 | 0.61 |
| 2023–24 | 6.2 | 74.8 | 4.96 | 50.0 | 8.36 | 0.59 |
| 2024–25 | 5.2 | 73.4 | 4.49 | 50.0 | 7.99 | 0.56 |
| 2025–26 | 5.7 | 69.6 | 4.82 | 56.0 | 9.11 | 0.53 |
The rightmost column is this site’s calculation: the median outdoor absolute humidity divided by the median living room absolute humidity (for example, 4.49 ÷ 7.99 ≈ 0.56 for 2024–25).
Leaving out the first, March-only winter, median outdoor relative humidity was 69.6–74.8%, higher than in the living room (50.0–56.0%). Measured by the amount of water vapour, however, the outside air held only 50–60% of what the living room air held. Relative humidity is the ratio to the maximum water vapour the air can hold at that temperature, and cold air has a small maximum, so a high ratio can still mean a small amount.
Recounting with the excluded 100.1% records included as 100%, for the winters from 2023–24 to 2025–26 the median outdoor relative humidity becomes 77.4–79.0%, the median absolute humidity 4.70–5.12 g/m³, and the ratio to the living room 0.55–0.61 (this site’s calculation). The reading that outdoor air holds 50–60% of the living room’s water vapour does not change.
As an example, the same formula can be applied to sample conditions. Air at 5°C and 75% relative humidity has an absolute humidity of about 5.09 g/m³, roughly 60% of the about 8.62 g/m³ in air at 20°C and 50% (5.09 ÷ 8.62 ≈ 0.59). If that 5°C air is warmed to 20°C without adding water vapour, the vapour pressure stays the same and the relative humidity falls to about 28% (vapour pressure at 5°C and 75%, 653.8 Pa ÷ saturation vapour pressure at 20°C, 2,332.6 Pa ≈ 0.28). All of these values are this site’s calculations, and 5°C/75% and 20°C/50% are conditions chosen for the example.
One caution: plugging medians into the formula does not give the median absolute humidity. The outdoor absolute humidity in the table above is the median of absolute humidity calculated from each 10-minute value, not a value calculated from the median temperature and median relative humidity.
Giving AI the same CO2 log — one week and three days, with and without the rule

The same task as the rule-based detection was given to AI by having it read the CSV. The test material was the first Monday-to-Sunday week with 7 full days of data in January 2025 and in January 2026: 2025-01-06 to 01-12 with 1,945 rows, and 2026-01-05 to 01-11 with 1,926 rows. Seven days have 2,016 five-minute slots, so the weeks are about 96.5% and about 95.5% filled (1,945 ÷ 2,016 ≈ 0.965, 1,926 ÷ 2,016 ≈ 0.955).
The definition of a full week was loosened once before anything was passed to the AI. It was originally “at least 1,976 rows (98%) in 7 days, with no gap longer than 15 minutes”, but no week in January 2025 or January 2026 met it, because many spots have a single missed 5-minute reading that makes the interval 10 minutes. It was changed to “at least 1,900 rows (94%), with no gap longer than 20 minutes”. The rule-based results had already been produced before this change and are unaffected.
Two kinds of question were used.
- Without the rule: ask the AI to list the times when the room was probably ventilated, leaving it to decide what counts as ventilation
- With the rule: write out the rule from the previous section in words (the start of an interval in which, within 30 minutes, CO2 falls by 200 ppm or more and room temperature by 0.5°C or more, with at least 60 minutes between candidates) and ask for the matching times
The AI was run under the following three conditions.
claude -p(no tools): Claude Code run non-interactively, with--model sonnet. The model ID recorded in the output is claude-sonnet-5-5. It was set up as a minimal configuration with no built-in tools, MCP or settings files, and called from a folder outside the home directory. On Anthropic’s pricing page, Claude Sonnet 5.5 costs $2 per million input tokens and $10 per million output tokensclaude -p(Python allowed): the same model, with the built-in tools narrowed to Bash and Read (--tools "Bash,Read") and only Python and Read allowed to run without confirmation (--allowedTools "Bash(python:*)" Read). Read-only commands such as cat and head may also run without confirmation under this setting. The CSV was passed as a file rather than pasted into the prompt, and this condition was run only for the with-rule question on the one-week data- gemma4:12b: Gemma 4 12B (released by Google DeepMind on 2026-06-03 under the Apache License 2.0), run through Ollama on a local GPU. The build has digest 6114515d63c1, 11.9B parameters and Q4_K_M quantization, with an 8.0GB download (the download size is not the VRAM usage)
gemma4:12b was run at temperature 0 with a context length (Ollama’s num_ctx, the maximum number of tokens for input and output combined) of 65536. It was run both with thinking (a feature that outputs a reasoning process before the answer) and with thinking turned off (think: false).
According to Ollama’s documentation, when num_ctx is not specified, the context length is 4096 tokens on machines with less than 24 GiB of VRAM, which cannot hold a week of 5-minute data. The plan decided before running was to first count whether one week fit in 65536 and, if not, cut it to 3 days. In practice, the one-week data were run without counting the input tokens first, and gemma4:12b had almost nothing left for output (see a later section).
So a 3-day condition was added afterwards, using the first 3 days of each week (Monday 00:00 to Thursday 00:00), and claude -p (no tools) and gemma4:12b were run on the same two questions. The rule candidates were also recounted within those 3 days for comparison. The one-week results were kept as they were.
Cost is the total_cost_usd returned by claude -p, which the official documentation describes as a client-side estimate that may differ from actual billing. The local model has no API cost, and electricity was not counted.
Whether the AI follows a rule depends heavily on how the question is written. For a practical guide to writing prompts that pin down what you want, this book is a good reference.
Results — given the rule, Claude named the same times as the rule on the one-week data

The one-week results are below. “Both” is the number of cases where a rule candidate and an AI time were within ±15 minutes of each other. gemma4:12b with thinking produced no answer in all 4 runs, so it is left out of the table and covered in a later section.
| Week | Question | AI | Rule candidates | Named by AI | Both | Rule only | AI only |
|---|---|---|---|---|---|---|---|
| 2025-01 | With the rule | claude -p (no tools) | 9 | 9 | 9 | 0 | 0 |
| 2025-01 | With the rule | claude -p (Python) | 9 | 9 | 9 | 0 | 0 |
| 2025-01 | With the rule | gemma4:12b (no thinking) | 9 | 4 | 1 | 8 | 3 |
| 2025-01 | Without the rule | claude -p (no tools) | 9 | 8 | 7 | 2 | 1 |
| 2025-01 | Without the rule | gemma4:12b (no thinking) | 9 | No answer (limit) | — | — | — |
| 2026-01 | With the rule | claude -p (no tools) | 3 | 3 | 3 | 0 | 0 |
| 2026-01 | With the rule | claude -p (Python) | 3 | 3 | 3 | 0 | 0 |
| 2026-01 | With the rule | gemma4:12b (no thinking) | 3 | 3 | 0 | 3 | 3 |
| 2026-01 | Without the rule | claude -p (no tools) | 3 | 11 | 2 | 1 | 9 |
| 2026-01 | Without the rule | gemma4:12b (no thinking) | 3 | 15 | 2 | 1 | 13 |
The 3-day results are below. Here too, the 4 runs with thinking produced no answer.
| First 3 days of the week | Question | AI | Rule candidates | Named by AI | Both | Rule only | AI only |
|---|---|---|---|---|---|---|---|
| 2025-01 | With the rule | claude -p (no tools) | 5 | 4 | 4 | 1 | 0 |
| 2025-01 | With the rule | gemma4:12b (no thinking) | 5 | 3 | 1 | 4 | 2 |
| 2025-01 | Without the rule | claude -p (no tools) | 5 | 3 | 3 | 2 | 0 |
| 2025-01 | Without the rule | gemma4:12b (no thinking) | 5 | 3 | 2 | 3 | 1 |
| 2026-01 | With the rule | claude -p (no tools) | 1 | 1 | 1 | 0 | 0 |
| 2026-01 | With the rule | gemma4:12b (no thinking) | 1 | 2 | 0 | 1 | 2 |
| 2026-01 | Without the rule | claude -p (no tools) | 1 | 7 | 1 | 0 | 6 |
| 2026-01 | Without the rule | gemma4:12b (no thinking) | 1 | 3 | 0 | 1 | 3 |
Given the rule, claude -p named the same times as the rule in both weeks of one-week data
With the rule, claude -p (no tools) named 9 times for the January 2025 week and 3 for the January 2026 week, and in both cases they matched the rule candidates to the exact time. They agreed even without using the ±15-minute margin. With Python allowed, the times also matched exactly in both weeks.
The rule candidates for the January 2025 week were 3 on Monday (2 in the morning, 1 in the evening), one each day from Tuesday to Friday at around 7:30 a.m., one on Saturday at around 12:30 p.m., and one on Sunday at around 9 a.m. The January 2026 week had 3: Wednesday at around 12:30 p.m., and Saturday at around 8:40 a.m. and just before noon. Following 1,900-odd 5-minute values, checking both the CO2 and room temperature drops over a 30-minute window, and keeping 60 minutes between candidates: claude -p without tools did all of this from the rule in words alone.
With the data cut to 3 days, however, the result was slightly different. Of the 5 rule candidates in the first 3 days of January 2025, claude -p named 4, and 1 was found by the rule alone. The 3 days in January 2026 had 1 candidate, which matched to the exact time. So it got everything right on one week but dropped one on the shorter 3-day data. Why it dropped it cannot be told from single runs. The result does not go as far as showing that passing the rule in words always makes the AI count exactly by the rule.
Without the rule, the number of times named varied from week to week
Without the rule, the answers of claude -p (no tools) took a different shape depending on the week. For the January 2025 week it named 8 times, overlapping with 7 of the rule’s 9 candidates; 1 was named by the AI only and 2 were found by the rule only. For the January 2026 week, however, it named 11 times against the rule’s 3, with 2 overlapping and 9 named by the AI only.
The 3-day data showed the same tendency. For the 3 days in January 2025 it named 3 times, all overlapping with rule candidates; for the 3 days in January 2026 it named 7 against the rule’s 1. The AI-only times were more than 15 minutes from any rule candidate. The AI may have read smaller drops that do not reach the rule’s thresholds (200 ppm and 0.5°C in 30 minutes) as ventilation too. Still, what criterion the AI used to choose its times cannot be determined from these runs.
What this shows is that if you pass along only the word “ventilation”, deciding what counts as ventilation is left to whoever answers the question. In one week the answer overlapped heavily with the rule’s 9; in another it named more than three times as many as the rule (11 ÷ 3 ≈ 3.7). With no record of window openings, it is also impossible to say which week’s answer is closer to the actual window use.
Cost and time — allowing Python cut the cost to just over a tenth
The cost (total_cost_usd, a client-side estimate) and time for claude -p were as follows.
| Data passed | Question | Condition | Cost (USD) | Time (s) | Input tokens |
|---|---|---|---|---|---|
| 1 week (2025-01) | Without the rule | No tools | 0.18148 | 10.3 | 43,031 |
| 1 week (2025-01) | With the rule | No tools | 0.205878 | 27.1 | 43,108 |
| 1 week (2025-01) | With the rule | Python | 0.0284786 | 15.5 | 23,159 |
| 1 week (2026-01) | Without the rule | No tools | 0.188596 | 16.3 | 43,070 |
| 1 week (2026-01) | With the rule | No tools | 0.204154 | 25.9 | 43,147 |
| 1 week (2026-01) | With the rule | Python | 0.0235475 | 15.5 | 22,428 |
| 3 days (2025-01) | Without the rule | No tools | 0.081076 | 7.3 | 18,905 |
| 3 days (2025-01) | With the rule | No tools | 0.09072 | 14.0 | 18,981 |
| 3 days (2026-01) | Without the rule | No tools | 0.085884 | 12.7 | 18,552 |
| 3 days (2026-01) | With the rule | No tools | 0.087828 | 12.9 | 18,628 |
One week without tools cost $0.18–0.21 per run, with about 43,000 input tokens. In the call records, almost all of the input in the no-tools runs was counted as 1-hour cache writes. On the pricing page that rate is twice the input rate, so the cost is higher than a calculation at the $2 input rate would give.
With Python allowed, the cost was $0.02–0.03, just over a tenth of the no-tools run for the same week (0.0284786 ÷ 0.205878 ≈ 0.14, 0.0235475 ÷ 0.204154 ≈ 0.12).
Without tools, the with-rule question also took longer and produced more output than the without-rule question. For the January 2025 week, output was 3,345 tokens with the rule and 936 tokens without it.
The local gemma4:12b nearly filled its context limit with one week of CSV

With gemma4:12b, one week of CSV plus the question came to 63,612–63,838 input tokens. Subtracted from the 65536 context length, that leaves only about 1,700–1,900 tokens for output. As a result, none of the 4 runs with thinking produced an answer. Two stopped at the context limit (Ollama’s done_reason was length), and the other two stopped with HTTP 500 (a server-side error in Ollama). Even without thinking, the without-rule question for January 2025 hit the limit partway through the answer.
The 3 runs that did return an answer without thinking either overlapped little with the rule candidates or named many times the rule did not. With the rule, for the January 2025 week it named 4 against the rule’s 9, with 1 overlapping, and for the January 2026 week it named 3 with 0 overlapping. The output was 95 and 74 tokens, ending with a short list of times. For the without-rule question in the January 2026 week it named 15, of which 2 overlapped.
Cut to 3 days, the input dropped to 26,785–27,468 tokens, and all 4 runs without thinking returned answers in 8.0–8.9 seconds. Agreement, however, did not improve. With the rule, it named 3 against the rule’s 5 for the 3 days in January 2025, with 1 overlapping, and 2 against the rule’s 1 for the 3 days in January 2026, with 0 overlapping. Without the rule, 2 of the 3 times it named for the 3 days in January 2025 overlapped.
With thinking, there was still no answer even on 3 days. For the without-rule question in January 2025, the thinking output grew to 38,124 tokens and, together with the 27,411 input tokens, hit the context limit (27,411 + 38,124 = 65,535). It took 230.1 seconds. The other 3 runs stopped with HTTP 500. In addition, when HTTP 500 first appeared in the one-week runs, the Ollama log showed that the underlying llama-server had crashed while processing the input.
claude -p counted the same one-week input as about 43,000 tokens. Tokenization differs from model to model, and in this run gemma4:12b counted more input tokens. If you have a local model read a log, count the input tokens before passing it and make sure enough is left for output and thinking. This run skipped that step, and as a result 5 of the 8 one-week gemma4:12b runs produced no answer.
How to read it — do not leave the ventilation decision to AI; set the rule first and pass it on

Three things can be read from this run. First, given the rule in words, claude -p named the same times as the rule in both weeks of one-week data; tracking differences between 5-minute values over a 30-minute window could be counted once it was passed as a rule in words. Second, asked only about “ventilation” without the rule, it named fewer times than the rule in one week and more than three times as many in another. How ventilation was interpreted varied by AI and, for the same AI, by week. Third, the local gemma4:12b nearly filled its context limit with one week of CSV, and agreement was low even on 3 days.
This sets the order of steps for having AI read a CO2 log. First, a person decides the rule for what counts as a ventilation candidate. Next, that rule is passed to the AI in words. Finally, the same rule is also run as a script and compared with the AI’s answer. In this run, claude -p with Python allowed also named the same times as the rule, at just over a tenth of the cost of the no-tools run. Once the rule is fixed, having the AI write and run code turned out cheaper than having it read the CSV directly.
There is also research on estimating window opening from CO2 and temperature. de Rautlin de la Roy et al. (2023, Building and Environment) report that, for detecting window openings in the heating season, a model feeding indoor temperature and CO2 into an RNN (recurrent neural network) performed best, and that indoor air temperature alone could detect up to 84–88% of the time windows were open. These figures, however, come from training and evaluating on buildings with records of window openings. They cannot be compared with the agreement counts in this article, which has no window records.
How to hand a log to AI was also tested with appliance power logs. Having AI read per-appliance power logs — how answer accuracy changes with the raw log, an hourly table, or code execution (published 2026-11-03) compares three approaches: pasting the raw log as it is, passing a table aggregated by hour, and allowing code execution. An example of leaving dew point calculations to AI with per-room temperature and humidity logs is in Counting condensation-prone hours from per-room temperature and humidity logs — having AI read winter data from UK homes and checking the dew point calculation with a script (published 2026-12-01). Both share this article’s approach of checking the AI’s answers with a script.
Steps for finding ventilation candidates in your own CO2 log
What follows are the steps for doing the same with your own CO2 log. It assumes you can export a CSV from a device that records CO2, temperature and relative humidity. Export specifications for particular products are not covered.
First, check the timestamps in the CSV: whether they are in UTC or local time, whether times go missing or repeat at the daylight saving changes, and whether the recording interval is constant. In this article’s data too, the time zone was not stated in the record and was inferred from what happened on the spring and autumn changeover days. If you count by time of day while this is unclear, the morning candidates can appear shifted by an hour.
Next, turn the rule into a script. Below is an example in pandas and NumPy of this article’s rule (the start of an interval in which, within 30 minutes, CO2 falls by 200 ppm or more and room temperature by 0.5°C or more, with at least 60 minutes between candidates). Rename the columns (time, co2, temp) to match your CSV. It is not the exact script used for this article’s tallies, but it counts in the same way.
import numpy as np
import pandas as pd
df = pd.read_csv("co2_log.csv", parse_dates=["time"]).sort_values("time")
# Keep only the heating season (November to March)
df = df[df["time"].dt.month.isin([11, 12, 1, 2, 3])]
t = df["time"].to_numpy()
co2 = df["co2"].to_numpy(dtype=float)
temp = df["temp"].to_numpy(dtype=float)
# For each row, the range of rows up to 30 minutes ahead
end = np.searchsorted(t, t + np.timedelta64(30, "m"), side="right")
starts, last = [], None
for i in range(len(t)):
co2_drop = co2[i] - co2[i:end[i]].min()
temp_drop = temp[i] - temp[i:end[i]].min()
if co2_drop >= 200 and temp_drop >= 0.5:
# Leave at least 60 minutes after the previous candidate
if last is None or t[i] - last >= np.timedelta64(60, "m"):
starts.append(t[i])
last = t[i]
events = pd.Series(pd.to_datetime(starts), name="start")
print(len(events))
print(events.dt.hour.value_counts().sort_index())
The last two lines print the number of candidates and the count per hour. Changing the thresholds of 200 and 0.5 and the 30-minute window to see how the count moves shows how much the result depends on how the rule is set. In this article too, shortening the window to 15 minutes reduced the candidates from 260 to 123.
To look at absolute humidity before and after, the following function converts temperature and relative humidity into g/m³. The formula is the same as in the earlier section; 20°C and 50% gives 8.62 g/m³.
import math
def abs_humidity(temp_c, rh):
ew = 6.112 * math.exp(17.62 * temp_c / (243.12 + temp_c)) # hPa
return 2.16679 * (rh / 100) * ew * 100 / (temp_c + 273.15) # g/m3
print(round(abs_humidity(20, 50), 2)) # 8.62
When passing the task to AI, write the rule out in words. The question might look like this:
The attached CSV contains 5-minute temperature (°C), relative humidity (%) and CO2 (ppm) readings from a living room.
List every time that matches the following rules.
1. Within 30 minutes from that time, CO2 falls by 200 ppm or more and room temperature falls by 0.5°C or more
2. When matching times run in a row, count the first one as one event, and leave at least 60 minutes before the next event
3. Reply with the list of times only
Compare the times that come back with the output of the script above. If they do not match, that is a lead for asking which part of the rule the AI took to mean something else. When the log is long, first count whether it fits in the local model’s context length, and if not, shorten the period or allow code execution.
If you want to write scripts like this one yourself to process logs and CSV files, this book teaches practical Python from the basics.
What this measurement cannot tell you

The limits to keep in mind when reading the results are collected here.
- No record of window openings: neither the rule candidates nor the AI’s times were checked against when the windows were opened. The agreement counts show how often the rule and the AI named the same times, not which is closer to the actual window use. CO2 and room temperature also fall when people leave the room or the heating is switched off
- A single room: the data come from one living room in an apartment building in Bolzano, over about 3 years and 2 months. They cannot be applied to other rooms or homes, or to homes in Japan
- Sensor accuracy: the ±100 ppm CO2 accuracy is from Netatmo’s help page; the product page has no CO2 accuracy line. The sensor type and calibration mechanism could not be confirmed on the product’s official pages. Some values are below 400 ppm, so the absolute readings may be offset
- The thresholds are this site’s definition: 30 minutes, 200 ppm, 0.5°C, 60 minutes and ±15 minutes are not figures from a published precedent. Changing them changes the number of candidates. The 0.5 g/m³ for absolute humidity differences and the 10-minute leeway allowed for the before and after readings are also this site’s choices
- The time zone is an inference: the timestamps were judged from the data to be local time with daylight saving. The record’s description does not state a time zone
- Outdoor air is from a station in the city: raw, unvalidated data from the Autonomous Province of South Tyrol, not values from just outside the living room window. Outdoor CO2 is not in the data
- One run per condition: each AI condition was run once, and variation across repeated runs was not measured. The 3-day condition was added after seeing the one-week results. gemma4:12b was tried only with Q4_K_M, temperature 0 and num_ctx 65536, not with other sizes or settings
- Possible training exposure: the Zenodo release (2026-05-09) predates the knowledge cutoff of Claude Sonnet 5.5 (June 2026), and whether the model saw this data in training was not checked
- Cost: total_cost_usd is a client-side estimate and was not converted to yen
- Treatment of CO2 values: CO2 concentration is treated only as an indicator of ventilation, and 1,000 ppm is not used as a target value for homes
Summary — a CO2 log gives you ventilation candidates, and a person sets the rule for judging them

- The data were public 5-minute records (about 3 years and 2 months, CC BY 4.0) from the living room (25 m²) of an apartment building in Bolzano, Italy. With no record of window openings, the article counted agreement between the rule and the AI rather than hits and misses
- Taking the start of an interval in which CO2 fell by 200 ppm or more and room temperature by 0.5°C or more within 30 minutes as a ventilation candidate, the rule found 260 candidates (0.543 per day) over the 479 heating-season days with data. 94 fell in the 7 a.m. and 8 a.m. hours, and none from 11 p.m. to the 6 a.m. hour. The 15-minute rule found 123
- The difference in absolute humidity between 30 minutes before and 60 minutes after a candidate had a median of 0.82 g/m³ (quartiles 0.442–1.164 g/m³) over the 258 candidates with readings on both sides. At least a quarter of the candidates had a difference below 0.5 g/m³, not judged a decrease under this site’s working category
- Outdoor air at a city station held 50–60% of the living room’s absolute humidity, even in winters with a median relative humidity of 70–80% (the same whether records above 100% are excluded or counted as 100%)
- Given the rule in words,
claude -p(claude-sonnet-5-5) named the same times as the rule in both weeks of one-week data; on 3 days in January 2025 it named 4 of 5. Without the rule, one week overlapped with 7 of the rule’s 9, and another named 11 against the rule’s 3 - The local gemma4:12b took about 64,000 input tokens for one week of CSV, nearly filling its context limit. Even on 3 days, it gave no answer with thinking and low agreement without it
- If you have AI read a CO2 log, decide first the rule for what counts as a ventilation candidate, pass it on, and check the answers with a script that applies the same rule
Sources
- C. Pozza (2026). Indoor Environmental Quality – Residential Apartment, Bolzano, Italy (2023–2026). Zenodo. DOI 10.5281/zenodo.20098783
- Creative Commons Attribution 4.0 International (legal code)
- Netatmo, “Smart Indoor Air Quality Monitor” product page (UK)
- Netatmo Help Center, “How do I calibrate my Smart Indoor Air Quality Monitor?”
- e-Gov Laws and Regulations Search, Order for Enforcement of the Act on Securing a Sanitary Environment in Buildings (Japanese)
- NOAA GML, “Global Monitoring Laboratory – Carbon Cycle Greenhouse Gases”, global average
- NOAA GML, annual mean global CO2 data
- Batterman, S. “Review and Extension of CO2-Based Methods to Determine Ventilation Rates with Application to School Classrooms”, IJERPH 14(2):145, 2017
- Ume-Ezeoke et al. “Towards a data-driven and scalable approach for window operation detection in multi-family residential buildings”, arXiv:2406.16957
- de Rautlin de la Roy et al. “Deep learning models for building window-openings detection in heating season”, Building and Environment 231, 110019, 2023
- NIST, “NIST TN 1297: Appendix A. Law of Propagation of Uncertainty”
- Vaisala, “Humidity Conversion Formulas” B210973JA-F (PDF, Japanese edition)
- WMO, “Guide to Instruments and Methods of Observation”, Volume I, Chapter 4, “Measurement of humidity” (Preliminary 2018 edition, PDF)
- NIST CODATA, “molar gas constant”
- NIST Chemistry WebBook, “Water”
- Autonomous Province of South Tyrol, “Webservice der meteorologischen und hydrographischen Messungen”
- Creative Commons, “CC0 1.0 Universal” (legal code)
- Anthropic, Models overview
- Anthropic, Pricing
- Claude Code, Model configuration
- Claude Code, CLI reference
- Claude Code, running non-interactively (headless)
- Ollama model page, gemma4:12b
- Google, “Introducing Gemma 4 12B”
- Google, “Apache License 2.0 | Gemma”
- Ollama documentation, “Thinking”
- Ollama documentation, “FAQ”
- Ollama documentation, “Context length”





