Skip to content

Piezo rain gauge

gary edited this page Aug 9, 2023 · 1 revision

Support for Traditional and Piezo Rainfall Gauges

Note: Throughout this wiki the 'standard' WeeWX rainfall fields refers to the fields rain and rainRate appearing in the default wview_extended database schema. By extension, it may also include fields such as dayRain, monthRain, yearRain etc commonly used in a number of WeeWX drivers and uploaders.

Introduction

The inclusion of support for the WS90 sensor suite in the Ecowitt LAN/Wi-Fi Gateway API has necessitated some changes to the rainfall related fields produced by the Ecowitt gateway driver. As the API and driver now support rainfall data from both a traditional tipping gauge and a piezo rainfall gauge, a number of new internal driver fields have been introduced to support piezo rainfall gauge data from the WS90. The new internal piezo rainfall gauge fields are p_rain, p_rainevent, p_rainrate, p_rainday, p_rainweek, p_rainmonth and p_rainyear.

Changes to the default field map

The default field map has been adjusted as of the Ecowitt gateway driver v0.5.0b1 such that the traditional rainfall gauge data is default mapped to the 'standard' WeeWX rainfall fields such as rain and rainRate, and the piezo rainfall gauge data is mapped through to WeeWX fields with a 'p_' prefix. The rainfall related entries in the default field map are:

WeeWX field name Gateway device field name Description
p_rain p_rain piezo gauge rainfall in the current archive or loop period
p_rainevent p_rainevent rainfall event total piezo gauge rainfall
p_rainrate p_rainrate piezo gauge rain rate
p_rainday p_rainday total piezo gauge rainfall today
p_rainweek p_rainweek total piezo gauge rainfall this week
p_rainmonth p_rainmonth total piezo gauge rainfall this month
p_rainyear p_rainyear total piezo gauge rainfall this year
rain t_rain traditional gauge rainfall in the current archive or loop period
stormRain t_rainevent rainfall event total traditional gauge rainfall
rainRate t_rainrate traditional gauge rain rate
hourRain t_rainhour total traditional gauge rainfall this hour
dayRain t_rainday total traditional gauge rainfall today
weekRain t_rainweek total traditional gauge rainfall this week
monthRain t_rainmonth total traditional gauge rainfall this month
yearRain t_rainyear total traditional gauge rainfall this year
totalRain t_raintotal total traditional gauge rainfall

Note: The Ecowitt LAN/Wi-Fi Gateway API does not currently support hour rainfall and total rainfall fields for the piezo rainfall gauge data as it does for traditional rainfall gauge data.

Implications of changes to the default field map

Users that do not have a rainfall gauge of any description connected to their Ecowitt gateway device are unaffected by these changes, Most users that only have a traditional rainfall gauge connected to their Ecowitt gateway device should see no change. Users with a WS90 sensor suite that intend to save piezo rainfall data to database, or include piezo rainfall data in reports, will need to make some changes to their system configuration.

Users with a traditional rainfall gauge only

Users who have a traditional rainfall gauge only should see no difference, and need do nothing unless a custom field map involving rainfall related fields is being used. If a custom field map is being used it will need to be adjusted to use the new internal 't_' rainfall field names. For example, if the following field map extension was being used to map WH40 rain rate data to WeeWX field my_rain_rate_field:

[GW1000]
    ...
    [[field_map_extensions]]
        my_rain_rate_field = rainrate

it will need to be changed to:

[GW1000]
    ...
    [[field_map_extensions]]
        my_rain_rate_field = t_rainrate

Users with a piezo rainfall gauge only

Users whose only connected rainfall gauge is a WS90 sensor suite and are using the default field map will see the piezo rainfall data appear in WeeWX loop packets in fields starting with 'p_' as per the above table. Such users that want the piezo rainfall data to appear in the 'standard' WeeWX rainfall fields will need to use a custom field map. The easiest way to create a custom field map for the piezo rain is to add suitable entries under the [GW1000] [[field_map_extensions]] stanza. A suitable custom field map to map piezo rain to the 'standard' WeeWX rainfall fields may look something like:

[GW1000]
    ....
    [[field_map_extensions]]
        rain = p_rain
        stormRain = p_rainevent
        rainRate = p_rainrate
        dayRain = p_rainday
        weekRain = p_rainweek
        monthRain = p_rainmonth
        yearRain = p_rainyear

Users with both traditional and piezo rainfall gauges

Users who have both a traditional rainfall gauge and a WS90 sensor suite connected to the Ecowitt gateway device will need to decide what rainfall data they wish to appear in what WeeWX fields. When used with the default field map the traditional rainfall gauge data will appear in the 'standard' WeeWX rain fields in loop packets and archive records and the WS90 piezo rainfall data will appear in WeeWX loop packets and archive records with a 'p_' prefix. If the default wview_extended database schema is in use the traditional rainfall gauge data in the 'standard' WeeWX rain related fields will be saved to database; the WS90 piezo rainfall data will be lost.

If both traditional rainfall gauge data and WS90 piezo rainfall data is to be saved to database then the data to be saved to database must be present in WeeWX fields that exist in the WeeWX database. This can be achieved in a number of ways, the most common approaches are:

  • Save the traditional rainfall gauge data to the 'standard' WeeWX rain related fields and save the piezo rainfall gauge data to new database fields. The preferred method of adding fields to the database is to use the wee_database utility with the --rename-column action. Provided the new database fields match the piezo rainfall gauge fields in the loop packet WeeWX will automatically save the piezo rainfall gauge data to database.

  • Save the traditional rainfall gauge data to the 'standard' WeeWX rain related fields and save the piezo rainfall gauge data to other, unused database fields. This involves having the Ecowitt gateway driver map the piezo rainfall gauge data to the existing unused fields. The preferred method for doing this is through a [[field_map_extensions]] stanza under [GW1000] in weewx.conf. For example, to save the piezo rainfall gauge data fields p_rain and p_rainrate to unused WeeWX fields hail and hailRate the following [[field_map_extensions]] might be used:

    [GW1000]
        ....
        [[field_map_extensions]]
            hail = p_rain
            hailRate = p_rainrate
    
  • Save the piezo rainfall gauge data to the 'standard' WeeWX rain related fields and save the traditional rainfall gauge data to new database fields. This will involve adding new fields to the database for the traditional rainfall gauge data, mapping the traditional rainfall gauge data to the these new fields and mapping the piezo rainfall gauge data to the 'standard' WeeWX rainfall fields. The preferred method of adding fields to the database is to use the wee_database utility with the --rename-column action. The preferred method of mapping the traditional and piezo rainfall gauge data is through a [[field_map_extensions]] stanza under [GW1000] in weewx.conf. The [[field_map_extensions]] stanza for such a configuration might be:

    [GW1000]
        ....
        [[field_map_extensions]]
            rain = p_rain
            stormRain = p_rainevent
            rainRate = p_rainrate
            dayRain = p_rainday
            weekRain = p_rainweek
            monthRain = p_rainmonth
            yearRain = p_rainyear
            new_rain = t_rain
            new_stormRain = t_rainevent
            new_rainRate = t_rainrate
            new_dayRain = t_rainday
            new_weekRain = t_rainweek
            new_monthRain = t_rainmonth
            new_yearRain = t_rainyear
            new_totalRain: t_raintotals
    

    where the new fields used for traditional rainfall gauge data start with 'new_'

Note: When mapping rainfall data to new fields or unused database fields care should be taken to ensure the WeeWX unit system is properly updated so that WeeWX knows the correct unit group these fields belong to. If this is not done there will likely be unit conversion, labelling and formatting issues that could result in incorrect data being saved to database and/or included in reports. Refer to the xxxxx section in the Customization Guide.

Note: In cases where both a traditional rainfall gauge and a piezo rainfall gauge are connected to and Ecowitt gateway device the Ecowitt WSView Plus app uses a rainfall priority setting to determine which rainfall data is displayed or uploaded to external services. The Ecowitt gateway driver does not use this setting nor is there an equivalent setting with the Ecowitt gateway driver config options. Rather, with the WeeWX environment the rainfall data displayed in reports or uploaded to external services is determined by the field names, the report template/skin configuration and the individual uploader settings/defaults.

Note: Many WeeWX uploaders default to uploading rainfall data from the 'standard' WeeWX rain fields. Some uploaders allow this to be changed via config option, others are hard coded to upload the rainfall data from the 'standard' WeeWX rain fields. Likewise for skins tha generate reports including rainfall data. Users that place rainfall data in fields other than the 'standard' WeeWX rainfall fields should pay particular attention to any uploader or skins that process rainfall data to ensure the expected rainfall data is being used.