I think the jury is still out on the wind vane that comes with WH1080 weather stations (e.g. Fine Offset, Mapin). Some people claim it works fine when placed high up away from any buildings, trees or other obstructions. Many people complain that it is just not reliable regardless. It doesn’t help that the weather stations come with a short pole.

From watching the vane it seems one of the issues is when the wind is gusty. I’ve noticed that when a gust ends the vane becomes destabilized and simply spins around and around.

For me it is simply not feasible to locate the vane on the chimney so I wondered if adding software filtering to my weather station code might work.

pywws already contains wind direction averaging for hourly summaries so I thought it would give that a try. Here is how the wind direction data looked a few days ago before adding averaging to the code:

The top part shows the wind speed and gusts. The bottom shows the wind direction. As you can see it is hard to see any pattern beyond the wind coming from the south, east or north.

Here is the wind direction data today after adding the averaging:

Much better. It is clear the wind was coming out of the west. While the above data was being captured I could see the vane swinging from north to south all the time, so it is pretty nice that the averaging was able to pick out the correct wind direction.

As previously mentioned the algorithm was taken from pywws, but with a couple of changes added. It works as follows:

  • When the receiver starts it collects a new wind vector every 48 seconds. The vector consists of the wind direction and average speed. This comes directly from the weather station transmitter.
  • While the receiver is collecting the first 16 wind vectors it reports the current wind direction to Weather Underground. So for the first 12.8 minutes (16 x 48 seconds) after reset the wind direction is not averaged.
  • Once 16 wind vectors have been collected the receiver starts averaging the wind direction and reporting the average to Weather Underground. Every 48 seconds when new data is received the oldest wind vector is overwritten. So the receiver always has the last 16 wind vectors to work with.
  • The latest 16 wind vectors are converted into weighted vectors. There is one vector for each compass point direction and the size of each vector is the sum of the average wind speeds measured coming from that direction. This method ensures the result favors directions where stronger winds came from.
  • Using some trigonometry the average wind direction is calculated.
  • In the situation where there is no wind for all 16 wind vectors (so no wind for 12.8 minutes) then the last average wind direction is used.

The code can be obtained from github.