WeeWX import¶
Purpose¶
rainlog weewx-import copies daily rain from a WeeWX archive SQLite database into the rainlog.sqlite schema used by rainlog.
Source query¶
The importer runs:
sumis assumed to be inches in the WeeWX database and is multiplied by 25.4 to store millimetres inrain_daily.rain.dateTimeis written intorain_daily.dateas provided by WeeWX for each archive day row.
Target¶
Rows are inserted into rain_daily in the database opened via --db-dir / rainlog.sqlite.
Typical usage¶
# Default paths: ./weewx.sdb → ~/.local/share/rainlog/rainlog.sqlite
rainlog weewx-import
rainlog 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
datewill cause SQLite errors on re-import; for a clean re-import, use a fresh DB or clear rows first.