Repository navigation
Release v7.2
weewx-loopdata 7.2
A feature release. Drop-in upgrade: install over 7.1, no configuration
changes, nothing to edit by hand. Nothing changes on your station until
you declare one of the new fields.
Every period LoopData serves — hour, day, week, month, year,
rainyear, alltime — is a stretch of time, and WeeWX report tags have
always been able to ask when that stretch begins and ends. LoopData
refused all four of those tags. It no longer does, so a live page can
work out for itself when a period started rather than being told once, at
report time, by an answer that goes stale the moment midnight passes.
What's new
- A period's own boundaries are now fields.
start,end,length
anddateTime— the same four properties$week.startand its
siblings give a Cheetah template — can be declared like any other
field. Declareweek.start.rawand every packet carries the instant
this week began. They take no aggregate, since they are properties of
the period rather than of an observation, and they accept the usual
unit override,round(n)and format specs.start,endand
dateTimeare instants and render through the period's time format;
lengthis a duration and renders as one, so
week.length.long_form()reads7 days, 0 hours, 0 minutes. The
rolling periods (1m–1440m,1h–24h) andtrendhave no fixed
span and do not carry them. - They cost no accumulator. A period's span is a property of the
calendar, not of anything the period accumulated, so it is computed
from the packet's own time. A report may declareweek.start.rawand
no otherweekfield and still get it on every packet. - The question they exist to answer: did this period begin today? On
the first day of a week, this week's high is just today's high wearing
a badge, and a page that says "WEEK HIGH" there is saying nothing.
Comparingweek.start.rawwithday.start.rawsettles it, and keeps
settling it correctly across midnight — which a value baked into the
page when the report ran cannot do. A kiosk page left up for a
fortnight crosses a great many midnights. alltimespans the archive's first record to the packet in hand,
which is what the$alltimereport tag spans.alltime.endand
alltime.lengththerefore advance with every packet, where the
calendar periods' stay put until the period rolls over. On a
brand-new station — WeeWX and LoopData installed together — the archive
is still empty when LoopData starts, so there is no first record to
read; those four fields then appear with the station's first archive
record, five minutes in by default, and LoopData takes the value from
the record itself rather than going back to the database. Everything
else,alltimeaggregates included, works from the first packet.- One field form went away. Because a period's
dateTimeis now its
start,<period>.dateTimewith an aggregate on it —day.dateTime.max
and its kin — is no longer recognized, and is logged as an unrecognized
field. That form was never a report tag:$day.dateTimehas always
been the day's start and never thedateTimeobservation, so a
declaration is unlikely to name it.current.dateTime.raw, which live
pages do use for the packet's timestamp, is untouched.
Requirements
- WeeWX 4.6 or later
- Python 3.7 or later
- No third-party Python packages required
- Satellite almanac fields (
almanac.iss.next_pass...and friends) need
weewx-skyfield
registered as the almanac; every other almanac field works with
PyEphem or WeeWX's built-in almanac, as always
Installing/upgrading
Download weewx-loopdata.zip
and install it over your existing copy, then restart weewxd:
weectl extension install weewx-loopdata.zip