Using two station sources into a single instance of WeeWx

69 views
Skip to first unread message

Justin Tume

unread,
Jun 27, 2021, 11:50:46 PM6/27/21
to weewx-user
First time poster here.  I have a Davis VP2 with serial interface and also a Airmar 150WX.  I would like to know if its possible to have two station sources in WeeWx and choose the data that is used from each station.

Eg, The Davis would supply all weather parameters except for the wind speed and direction.  The Airmar 150WX would supply the wind data as this is much more accurate than the Davis.

Is this possible?

Thanks
Justin

weewx-user

unread,
Jun 28, 2021, 5:05:55 PM6/28/21
to weewx-user
one approach looks something like this:

1) run two instances of weewx, one for the vantage, and one for the airmar.

weewxd /etc/weewx/vantage.conf
weewxd /etc/weewx/airmar.conf

be sure that the two configuration files refer to:
 - separate databases, e.g., /var/lib/weewx/vantage.sdb and var/lib/weewx/airmar.sdb
 - separate HTML_ROOT, e.g., /var/www/vantage and /var/www/airmar

that way you can verify that each component works, no matter how you might combine data later

2) create a skin that combines the data, with a structure like this:

mkdir /etc/weewx/skins/combined
/etc/weewx/skins/combined/skin.conf
/etc/weewx/skins/combined/index.html.tmpl

the skin.conf will indicate different databases for images, like this:

[ImageGenerator]
    ...
    [[day_images]]
        # show barameter from both stations in the barometer graph
        [[[daybarometer]]]
            [[[[vantage]]]]
                data_binding = vantage_binding
                data_type = barometer
                label = vantage
            [[[[airmar]]]]
                data_binding = airmar_binding
                data_type = barometer
                label = airmar
        # show only airmar in the wind graph
        [[[daywindspeed]]]
            [[[[windSpeed]]]]
                data_binding = airmar_binding
            [[[[windGust]]]]
                data_binding = airmar_binding

the index.html.tmpl will use data bindings for any references to variables (see the customization guide for the syntax for that).


3) create a config file, say 'combined.conf', just for generating reports from the combined databases.

...
[Station]
    ...
    station_type = unspecified

[StdReport]
    [[combined]]
        skin = combined

[DataBindings]
    [[vantage_binding]]
        database = vantage_sqlite
        manager = weewx.wxmanager.WXDaySummaryManager
        table_name = archive
        schema = schemas.wview.schema
    [[airmar_binding]]
        database = vantage_sqlite
        manager = weewx.wxmanager.WXDaySummaryManager
        table_name = archive
        schema = schemas.wview.schema

[Databases]
    [[vantage_sqlite]]
        database_name = vantage.sdb
        database_type = SQLite
    [[airmar_sqlite]]
        database_name = airmar.sdb
        database_type = SQLite

4) finally, run wee_reports regularly (e.g., via cron) with your combined config file (and customized skin)

wee_reports /etc/weewx/combined.conf

Reply all
Reply to author
Forward
0 new messages