Repository navigation
readings tool: any stored reading at an interval, each row with its time - #63
Merged
Merged
Conversation
… row with its time "What was the humidity each hour for the last 5 hours" got "the tool can't give me an hour-by-hour table": weather_history only sends a period's lows and highs. The new `readings` tool (lib/history.py) takes a metric (outdoor.humidity, rainfall.rain, air.pm2_5 ...), a start, an end and an interval, and returns a row per interval read straight from ecobot.sqlite: - every interval for every reading: one the sensor stores is read as it is, any other is worked out from its finer readings (never coarser: the air sensor's older hourly history isn't split into half hours); intervals are blocks of local time (an hour from :00, four hours from midnight) - means per 30-minute slot as the charts take them; gusts the highest; rain the mm that fell (the daily total's rise, midnight reset included); air particles without glitches, as air_quality has them; days from the day rows, with when their extremes happened - at most 300 rows: a longer request is refused with the finest interval that fits; gaps are rows with no value, and a period held only coarser says which interval to ask for - the metrics offered are what each sensor has sent; the air sensor's own temperature and humidity only when the words name them "each hour", "every 30 minutes", "hourly" no longer take the fast path to a highs-and-lows summary (intent.INTERVAL); the prompt sends them to readings. scripts/show_request.py runs the tool on a file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
…er hints, routing)
The readings tool:
- rain from two resolutions: a coarser reading counts only where no finer one falls in the time it
covers; their times mean different moments, so the seam read as a midnight reset (11.8 mm for an
hour that had 1.5)
- 4hour rows are the station's own 4-hour records, cut on UTC hours as Ecowitt cuts them (3am, 7am
... in AEDT); a stored reading counts only in an interval that holds all its time, never straddling
- gusts take the records' own highest, not the first gust stored
- "ask for a coarser interval" only for empty rows a coarser reading (or a day row) actually covers,
never for the interval still filling; an all-empty result with one says to ask again
- an air glitch at the window's edge is judged by the readings just outside it, as air_quality does
- a sensor named is kept ("air.humidity" is the air sensor's own, never outdoor's); a time with an
offset ("...Z") is moved into local time; the interval offered instead is always one then accepted
Routing (intent): a chart of hourly values is still drawn in code; "miles per hour", "km/h per hour"
are units, not intervals; "every ten minutes", "every half an hour", "in 15 minute steps" and
"highest hourly rain each month" reach the model instead of a highs-and-lows shortcut.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBwHofjb1g9onaYRdLZMbf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
readingstool (lib/history.py) returns a row per interval, read straight fromecobot.sqlite.outdoor.humidity,rainfall.rain,air.pm2_5…), a start, an optional end, and an interval:1min,5min,30min,1hour,4houror1day.4hour, which follows the station's own 4-hour records. Ecowitt cuts those on UTC hours, so in AEDT they start at 3am, 7am and so on.air_qualitydoes. Days come from the day rows, with the times of their lows and highs.fits).lib/intent.py): "each hour", "every 30 minutes", "every ten minutes", "hourly" and "in 15 minute steps" reach the model, which the prompt points atreadings. Before, some of these took a code shortcut to a highs-and-lows summary.scripts/show_request.pycan run the tool against a file.Generated by Claude Code