Skip to content

The Configuration File

Scope: weewx.conf read the way the engine lives it — station identity first, then the driver, the pipeline services, the archive, the database binding, the reports, and finally the engine's own roster of who runs when.

A WeeWX station is its weewx.conf: about five hundred lines as generated, most of it comments the project wrote for you. It is a ConfigObj file — sections in [brackets], deeper nesting for subsections, values that may be lists. Two habits keep it safe: edit it with the engine stopped (it is read at startup, and a half-saved file is a stopped station), and know that tools which edit it for you — weectl extension install is one — save a timestamped copy first. This build's station directory holds weewx.conf.20261105085831, left there by exactly that courtesy.

[Station] — who and where

[Station]
    location = Meadowbrook Hollow Test Station
    latitude = 39.05
    longitude = -95.68
    altitude = 920, foot
    station_type = Simulator
    rain_year_start = 1
    week_start = 6

The location and coordinates are not decoration: the name titles every report, the latitude and longitude drive the almanac (sunrise, moon phase) and are printed on the NOAA summaries, and the altitude feeds the pressure reductions. station_type names the driver stanza to use — it must match a section elsewhere in the file that carries a driver line. rain_year_start says when the rain year (and so the "yearly rain" totals) begins; week_start does the same for weekly graphs.

The driver stanza — [Simulator]

However station_type is set, the matching stanza holds the driver's options and the driver module to load:

[Simulator]
    loop_interval = 2.5
    mode = simulator
    #mode = generator
    #start = 2011-01-01T00:00
    driver = weewx.drivers.simulator

The simulator's options are the pattern for every driver's: a timing (loop_interval, the seconds between LOOP packets), a mode choice (real-time simulator, or generator, which emits packets as fast as the machine can for load-testing), an optional start for replaying weather from a chosen date, and the driver line itself. Chapter 5 shows real stanzas; the shape does not change, only the options do — a serial port and baud rate there, an IP address there.

The pipeline stanzas — [StdConvert], [StdCalibrate], [StdQC], [StdWXCalculate]

Between the driver and the archive sits the processing pipeline, and each stage has a stanza even when (as generated) it mostly holds defaults and commented examples:

  • [StdConvert] — the unit system packets are converted to for storage (target_unit = US as created, matching the station's --units choice).
  • [StdCalibrate] [[Corrections]] — small arithmetic repairs applied to every packet, as formulas: the generated file's examples show the shape, such as correcting a consistently-off sensor. Corrections are honest about being corrections: they apply to new data only, never rewrite the past.
  • [StdQC] [[MinMax]] — sanity limits per observation. A packet value outside its range is set aside (stored as absent) rather than archived as fact. It is the quiet guard against the classic failure of a dying sensor reporting 999.
  • [StdWXCalculate] [[Calculations]] — which derived observations the engine calculates, and for each, whether to prefer the hardware's own value when the station supplies one. This stanza is why the chapter 3 LOOP packet arrived already carrying dewpoint, windchill, heatindex, altimeter, and cloudbase: the calculation service runs on every packet, upstream of everything else.

[StdArchive] — the interval and the summaries

[StdArchive]
    archive_interval = 60        # 300 as generated; see chapter 3
    record_generation = hardware
    loop_hilo = True

archive_interval is the station's heartbeat (chapter 3). record_generation chooses who summarises the interval: hardware asks the station for its own stored record when the driver can provide one (many stations keep their own archive in a data logger), and software always builds the record from the LOOP packets WeeWX saw. With the simulator there are no hardware records, so the engine builds them in software regardless — the first startup's log line "Using archive interval of 60 seconds (specified in weewx configuration)" is the engine saying which mode it settled into.

[DataBindings], [Databases], [DatabaseTypes] — where records live

Three stanzas divide a job that sounds like one: a binding names a database and the schema it uses; [Databases] says where the file (or server) is; [DatabaseTypes] says which kind of database it is.

[DataBindings]
    [[wx_binding]]
        database = archive_sqlite
        table_name = archive
        manager = weewx.manager.DaySummaryManager
        schema = weewx.schemas.wview_extended.schema

[Databases]
    [[archive_sqlite]]
        database_name = weewx.sdb
        database_type = SQLite

[DatabaseTypes]
    [[SQLite]]
        driver = weedb.sqlite
        SQLITE_ROOT = archive

As generated, that chain lands on one file, archive/weewx.sdb, carrying the extended schema — the 115 observation columns chapter 6 counts. The indirection earns its keep the day you add a second database (a common one is a separate binding for a special report) or swap SQLite for MySQL by changing the type stanza and nothing else. Chapter 6 opens the file itself.

[StdReport] — what gets published

The report stanza names where skins live (SKIN_ROOT = skins), where output goes (HTML_ROOT = public_html), which database binding reports read (wx_binding), and then defines each report as a subsection — a skin, and whether it is enabled:

    [[SeasonsReport]]
        skin = Seasons
        enable = true
    [[SmartphoneReport]]
        skin = Smartphone
        enable = false
        HTML_ROOT = public_html/smartphone

Two things to notice. The FTP and rsync uploaders live here too, as [[FTP]] and [[RSYNC]] "reports" whose skins happen to send files instead of building them — chapter 8. And the [[Defaults]] subsection holds the unit groups, time formats, and labels every report inherits, so a change from °F to °C on the website is one line here, not an afternoon in the templates.

[StdRESTful] — the onward posts

The services that post readings to the internet each have a subsection — [[StationRegistry]], [[Wunderground]], [[PWSweather]], [[CWOP]], [[WOW]], [[WOW-BE]], [[AWEKAS]] — all generated with enable = false and placeholder credentials. The lab's engine logged the result at startup, one line per service: "Posting not enabled." Chapter 8 takes each service's account requirements in turn.

[Engine] — the roster

The last stanza is the one that makes the others a system. It lists, by pipeline stage, the exact service classes the engine runs, in order:

[Engine]
    [[Services]]
        prep_services = weewx.engine.StdTimeSynch
        data_services = ,
        process_services = weewx.engine.StdConvert, weewx.engine.StdCalibrate,
                           weewx.engine.StdQC, weewx.wxservices.StdWXCalculate
        xtype_services = weewx.wxxtypes.StdWXXTypes, weewx.wxxtypes.StdPressureCooker,
                         weewx.wxxtypes.StdRainRater, weewx.wxxtypes.StdDelta,
                         user.vaporpressure.VaporPressureService
        archive_services = weewx.engine.StdArchive
        restful_services = weewx.restx.StdStationRegistry, weewx.restx.StdWunderground, ...
        report_services = weewx.engine.StdPrint, weewx.engine.StdReport

Read top to bottom, it is chapter 1's packet life with names on: time synchronisation, conversion, calibration, quality control, calculation; the XTypes services that answer on-demand calculations (that last user.vaporpressure entry is chapter 9's doing — the engine's roster is where custom code is enlisted); the archiver; the posters; and the reporters, StdPrint first, which is why the foreground run in chapter 3 could show you every packet. Almost nothing in WeeWX happens by magic: if a behaviour surprises you, some line in this roster, or in the stanza that configures it, is where it came from.