Tweeting rain 24h

77 views
Skip to first unread message

Invisible Man

unread,
Oct 11, 2020, 12:50:41 PM10/11/20
to weewx-user

Hi,
I would like to tweet the amount of rain for the last 24 hours. I am using this extension : https://github.com/weewx/weewx/wiki/Twitter

The config line I use is the following. I use "rain24" for the amount of rain. But apparently, it's not the right one (e.g currently rain24 says 1.6mm when the real correct value is 16.8mm). What should I use to get that 16.8mm value?

format = {dateTime:%H:%M} Temp: {outTemp:%.1f} °C; Humidité: {outHumidity:%.0f}%; Pression: {barometer:%.0f} hPa; Pluie 24h: {rain24:%.1f} mm; Vent: {windSpeed:%.1f} km/h; Dir: {windDir:%03.0f}

Thanks
Axelle.

gjr80

unread,
Oct 11, 2020, 5:06:38 PM10/11/20
to weewx-user
Hi,

The Twitter extension only offers basic unit conversion in the string it publishes, it’s really a case of all or nothing. By default the tweet uses the unit system of your WeeWX database for all obs. I’m guessing you are using the METRIC unit system in your database (target_unit = METRIC under [StdConvert] in weew.conf), the METRIC unit system records rain in cm which explains what you are seeing. If you read through the config instructions at the start of twitter.py you will see that you can use the unit_system config option to set the unit system to use in your tweets, for example:

[StdRESTful]
    [[Twitter]]
        ....
        unit_system = METRICWX

Will use the METRIC_WX unit system which will give you rain in mm but wind speed will be in m/s (refer my earlier link). As an aside using unit_system = US would give rain in inches.

Unfortunately, as the Twitter extension stands you cannot change units for individual obs.

Gary

Invisible Man

unread,
Oct 12, 2020, 4:12:11 PM10/12/20
to weewx-user
Thanks Gary, I get it... either I'm going to get cm, or m/s... Okay! Maybe I'm just multiply my rain24 cm reading by 10 to mimic mm...
Thanks!
Reply all
Reply to author
Forward
0 new messages