StdWXCalculate: beaufort = prefer_hardware

174 views
Skip to first unread message

Vetti52

unread,
Jul 8, 2020, 9:42:00 AM7/8/20
to weewx-user
Hi you Weewx experts!

first I would like to say, that my station ( a WS2900 clone) is not that sophisticated, especially concerning wind speed and direction. There are many tall trees around, being closer than their 10fold height, so that the wind is often much smoother and more disturbed than on top of the trees. However, I still would like to compare the data to the data provided by local weather forecasters. Commonly the wind is announced in the literally equation of the predicted Beaufort value. So, they talk of "fresh breeze", when wind with 5 bft is expected. Therefore I wanted to display the wind data in bft and its literal equivalent also. In Weewx 3 I adopted the solution found here:
which works fine so far.
After upgrading to Weewx 4 I found a new entry in

[StdWXCalculate]
    [[Calculations]]
          beaufort = prefer_hardware

which raised the question, if I could replace the previous solution by that introduced in version 4.
I expected, that there would be an option in the [[[Units]]] section to chose 'beaufort' instead of 'knot'. But this is not offered in the options there. Anyway, this would not be the solution, because I want to see the wind speed as it is actually shown, and in addition in terms of Beaufort. This should also be shown in an extra graph over time.

Does anyone have a clue, how to manage this?

Tom Keffer

unread,
Jul 8, 2020, 12:25:06 PM7/8/20
to weewx-user
Beaufort is treated as a separate observation type, not an alternative unit. So, you should be able to use it like any other type. For example,

  <p>The current wind speed is $current.windSpeed, which is beaufort $current.beaufort.</p>

If you want to plot it, you would need to put 'beaufort' in your database schema.

-tk



--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/e766b133-65d4-4821-917e-49a31936a43do%40googlegroups.com.

Vetti52

unread,
Jul 8, 2020, 3:10:05 PM7/8/20
to weewx-user
On,  July 8th 2020 18:25:06 UTC+2 Tom Keffer wrote:
Beaufort is treated as a separate observation type, not an alternative unit. So, you should be able to use it like any other type. For example,

  <p>The current wind speed is $current.windSpeed, which is beaufort $current.beaufort.</p>

If you want to plot it, you would need to put 'beaufort' in your database schema.

-tk


Thanks, Tom, for your patient introduction into some parts of Weewx.
Well.... I hoped, according to the Customization Guide, I could just use to change units for a single report. But, no way...

So, my current PHP solution $current_beaufort could be replaced by $current.beaufort. Right? What about gust? Does this work the same way, such as $current.gust.beaufort?
But finally, there is an additional variable $word_current_beaufort, which presumably lacks in the observation type. So I will at least still have to use the PHP script to assign the lexical description to the bft scale.

Modifying the database schema is definitely new for me. I will have to dig into this.

-Peter

Tom Keffer

unread,
Jul 8, 2020, 3:56:28 PM7/8/20
to weewx-user
I am not familiar with the tag $current_beaufort. Is that part of some extension skin?

Unfortunately, a wind gust in beaufort would not work that way. To do that would require extending the unit system, to allow beaufort to be used as a new unit type, which is not a bad idea. Unfortunately, it's a bit problematic, because wind speed expressed in Beaufort no longer takes a unit label (such as m/s), so would require some code changes to make sure that didn't happen.

I'll have to think about all this.

-tk


--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

Vetti52

unread,
Jul 9, 2020, 5:26:02 AM7/9/20
to weewx-user
The tags are derived from the listing of Paul VE1DX (@WindnFog), which he presented in the thread mentioned in my post above. I expanded it to treat with gust also, by evaluating $current.windGust.raw the same way and put it all together into skins/seasons/current.inc where it finally is displayed.

Vetti52

unread,
Jul 21, 2020, 6:55:37 AM7/21/20
to weewx-user
Hi, Tom!

As there was almost no wind last week, I just tried to activate $current.beaufort. I decided to show both values, such as $current_beaufort ($current.beaufort). However, the new value always shows (0), while the other one looks ok to me. Do I have to drive another screw somewhere in Weewx. The only place, I know, is the entry in [StdWXCalculate], which is set to "prefer_hardware" as by default.
It is not that bad, as the solution from @WindnFog works as well. But, at least, the new solution should work too.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.

gjr80

unread,
Jul 21, 2020, 10:54:16 PM7/21/20
to weewx-user
Hi,

If you have beaufort = prefer_hardware under [StdWXCalculate] then you should be seeing field beaufort in loop packets and archive records provided you have field windSpeed in the same packet/record. I would go back to basics as far as you can and run WeeeWX directly for at least an archive interval (you want to see at least one archive record) and observe the loop packets (lines starting with LOOP:) and archive records (lines starting with REC:) on the console. Do they have a field windSpeed and what is its value, do they have a field beaufort and what is its value? If you have windSpeed and no beaufort or have windSpeed and have an incorrect beaufort value then something is wrong and we need to dig deeper. If the loop packets/archive records are correct then the issue is downstream in the skin/skin config.

Gary

Vetti52

unread,
Jul 23, 2020, 8:38:14 AM7/23/20
to weewx-user
Hi, Gary!
Thanks for the hints. In deed, there is a value for beaufort in the loop:
LOOP:   2020-07-23 14:16:36 CEST (1595506596) altimeter: 30.065488730750573, appTemp: 69.20122805363343, barometer: 30.014, beaufort: 1, cloudbase: 3824.7354273385445, dateTime: 1595506596, dewpoint: 52.73310752508154, heatindex: 69.1, humidex: 72.72248011924633, inDewpoint: 54.980122811806766, inHumidity: 64.0, inTemp: 67.6, maxSolarRad: 820.4582989978796, outHumidity: 56.0, outTemp: 69.1, pressure: 29.949, radiation: 604.7, rain: None, rainEvent: 0.0, rainRate: 0.0, txBatteryStatus: 0.0, usUnits: 1, UV: 5.0, windchill: 69.1, windDir: 240.0, windGust: 3.36, windSpeed: 1.34

I did not wait for the REC: record.
So then I should have a look into the skin/skin config. However, I use the seasons skin with some translations of the descriptions into German and just added the value, as Tom posted above. I put it into current.inc here
  <div class="widget_contents">
  <table>
    <tbody>
      <tr>
        <td class="label">$obs.label.outTemp</td>
        <td class="data">$current.outTemp</td>
      </tr>
      <tr>
        <td class="label">$obs.label.heatindex</td>
        <td class="data">$current.heatindex</td>
      </tr>
      <tr>
        <td class="label">$obs.label.windchill</td>
        <td class="data">$current.windchill</td>
      </tr>
      <tr>
        <td class="label">$obs.label.dewpoint</td>
        <td class="data">$current.dewpoint</td>
      </tr>
      <tr>
        <td class="label">$obs.label.outHumidity</td>
        <td class="data">$current.outHumidity</td>
      </tr>
      <tr>
        <td class="label">$obs.label.barometer</td>
        <td class="data">$current.barometer (Trend: $trend.barometer.formatted)</td>
      </tr>
      <tr>
        <td class="label">$obs.label.wind</td>
        <td class="data">$current.windSpeed ($current.beaufort bft) $current.windDir.ordinal_compass ($current.windDir)<br/>$word_current_beaufort<br />Böen $current_gust_beaufort</td>
      </tr>

gjr80

unread,
Jul 23, 2020, 9:20:06 AM7/23/20
to weewx-user
If you have beaufort in the loop packets then you should end up with beaufort in archive records. Does it work now? If not $current.xxxxx tags come from the archive record hence the suggestion to run WeeWX directly for at least a full archive period to confirm that beaufort is appearing in archive records.

Gary

Vetti52

unread,
Jul 23, 2020, 3:02:08 PM7/23/20
to weewx-user
Well, I had to wait for some wind first. Now, after sunset, wind seems to be growing. And this is the latest archive record:

REC:    2020-07-23 20:50:00 CEST (1595530200) altimeter: 29.94844953418796, appTemp: 64.63492618774067, barometer: 29.897333333333336, beaufort: 0.4444444444444444, cloudbase: 2464.8536620841987, dateTime: 1595530200, dewpoint: 53.68325395886734, ET: 0.000133188221454822, extraTemp1: 133.6604, heatindex: 64.06666666666666, humidex: 68.17774431413599, inDewpoint: 61.099461593234274, inHumidity: 75.77777777777777, inTemp: 69.07777777777778, interval: 5.0, maxSolarRad: 10.611708312518399, outHumidity: 69.0, outTemp: 64.06666666666666, pressure: 29.83233333333333, radiation: 15.47888888888889, rain: 0.0, rainEvent: 0.0, rainRate: 0.0, txBatteryStatus: 0.0, usUnits: 1, UV: 0.0, windchill: 64.06666666666666, windDir: 171.3974954238297, windGust: 4.92, windGustDir: 202.0, windrun: 0.08481481481481483, windSpeed: 1.017777777777778

At least, there is a value for beaufort. But it is still displayed as 0 bft in the skin. To be sure, I will have to wait for more wind, until tomorrow.

kind of curious
Peter

Vetti52

unread,
Jul 26, 2020, 4:17:29 AM7/26/20
to weewx-user
Well, there is still low wind activity, but currently at least 5 km/h. And $current.beaufort shows 0 bft. $current_beaufort shows 1 bft, as it should. What is going on here? Maybe things change, when moving to gw1000 api driver?
Reply all
Reply to author
Forward
0 new messages