Skip to content

WeeWX import

Purpose

rain weewx-import copies daily rain from a WeeWX archive SQLite database into the MyWeather.sqlite schema used by rain.

Source query

The importer runs:

SELECT dateTime, sum FROM archive_day_rain;
  • sum is assumed to be inches in the WeeWX database and is multiplied by 25.4 to store millimetres in rain_daily.rain.
  • dateTime is written into rain_daily.date as provided by WeeWX for each archive day row.

Target

Rows are inserted into rain_daily in the database opened via --db-dir / MyWeather.sqlite.

Typical usage

# Default paths: ./weewx.sdb → ./MyWeather.sqlite
rain weewx-import

rain weewx-import --weewx-db /var/lib/weewx/weewx.sdb --db-dir ~/weather-data

Caveats

  • Ensure WeeWX day boundaries align with how you want your 09:00-based buckets to behave; mixing schemas without checking can offset a day.
  • Duplicate keys on date will cause SQLite errors on re-import; for a clean re-import, use a fresh DB or clear rows first.

See also