Wind direction missing in week month year

200 views
Skip to first unread message

Greg from Oz

unread,
Apr 29, 2018, 5:32:49 AM4/29/18
to weewx-user
My web page displays the wind direction and is using this value $current.windDir.formatted

The week web page is using this: $week.wind.max from $week.wind.gustdir ($week.wind.gustDir.ordinal_compass) at $week.wind.maxtime

This is what is displayed on the current conditions webpage;
Wind6 km/h from 217° (SW)

This is what is being displayed on the week webpage:
High Wind23 km/h from N/A (N/A) at 11:47:27 (Friday)
So my question is why doesn't the directions show up on any other webpages?
Also where is the data for these values stored?
Are they calculated somewhere?

I noticed this direction data was missing after I installed the android weewx app (which is great BTW) and it showed my missing data.

Thanks in advance.


Thomas Keffer

unread,
Apr 29, 2018, 10:38:48 AM4/29/18
to weewx-user
For stats on a 'week', the data would be stored in the daily summaries. If you have the start and stop of the week in unix epoch time, you can query the database directly using the tool sqlite3 and see if the data is in there.

For example, for the week 21-28 April, AEST, the start and stop time would be 1524319200 to 1524924000. If you are not in the AEST time zone, adjust as necessary. 

In the example, it's assumed you've used the setup.py install method and the location of your sqlite database is /home/weewx/archive/weewx.sdb. If you used a Debian install, it will be /var/lib/weewx/weewx.sdb

You may have to install the tool sqlite3: 

$ sudo apt install sqlite3

then

$ sqlite3 /home/weewx/archive/weewx.sdb
SQLite version 3.11.0 2016-02-15 17:29:24
Enter ".help" for usage hints.
sqlite> select max, datetime(maxtime,'unixepoch','localtime') from archive_day_wind where dateTime>1524319200 and dateTime<=1524924000;
9.0|2018-04-22 00:20:00
16.0|2018-04-23 15:25:00
16.0|2018-04-24 13:45:00
11.0|2018-04-25 14:50:00
12.0|2018-04-26 14:40:00
34.0|2018-04-27 09:51:15
16.0|2018-04-28 11:55:00
sqlite> .quit

This shows the strength and time of the max wind speeds for the seven days of the week. Try it and see what you get.




--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Milner

unread,
Apr 29, 2018, 11:18:34 AM4/29/18
to weewx-user
Tom
I'm a bit baffled - after the thread was started I looked at my database
It seems as though the daily summaries for gust and gust dir are not being populated - they are all NULL, and surely these are the tables which are used with the week tag - or am i mistaken?  The query you gave would indeed return the highest wind from the archive table - but the poster was trying to use the tags to obtain the result.  OK - my station does not output gust - although there is a gust column (and gust dir) in the archive table.

Have I missed something??
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

Thomas Keffer

unread,
Apr 29, 2018, 11:23:44 AM4/29/18
to weewx-user
No you haven't. My next question was going to be, "What kind of weather station?"

-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.

Andrew Milner

unread,
Apr 29, 2018, 11:48:59 AM4/29/18
to weewx-user
I forgot to say that the archive columns for windGust and windGustDir ARE populated, whilst the summary tables are populated in archive_day_windGust but not in archive_day_windGustDir - I have a FineOffset station.

Greg from Oz

unread,
May 1, 2018, 5:34:25 AM5/1/18
to weewx-user
Hi
I am using fineoffset as well and I am also using mysql database.
I had a look at other fineoffset weather stations using the hardware selection from the web page: http://weewx.com/stations.html and they didn't have any wind directions either except for the current conditions.

Greg from Oz

unread,
May 1, 2018, 5:45:36 AM5/1/18
to weewx-user
Hi I am using mysql I ran the command you suggested an got this:
MariaDB [weewx]> select max, datetime(maxtime,'unixepoch','localtime') from archive_day_wind where dateTime>1524319200 and dateTime<=1524924000;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(maxtime,'unixepoch','localtime') from archive_day_wind where dateTime>152431920' at line 1

MariaDB [weewx]> select max, datetime from archive_day_wind where dateTime>1524319200 and dateTime<=1524924000;+------------------+------------+
| max              | datetime   |
+------------------+------------+
| 4.80001193419655 | 1524405600 |
| 3.70000919927651 | 1524492000 |
| 4.80001193419655 | 1524578400 |
| 5.40001342597112 | 1524664800 |
| 6.50001616089117 | 1524751200 |
| 4.10001019379289 | 1524837600 |
| 5.40001342597112 | 1524924000 |
+------------------+------------+
7 rows in set (0.01 sec)
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

Greg from Oz

unread,
May 1, 2018, 5:59:23 AM5/1/18
to weewx-user
Hi It seems like any fineoffset weather stations don't see wind direction for week/month/year only current.
I have looked at other weather sites running fineoffset.

Greg


On Monday, 30 April 2018 00:38:48 UTC+10, Thomas Keffer wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

Andrew Milner

unread,
May 1, 2018, 6:44:34 AM5/1/18
to weewx-user
That matches what I see anyway!!

The command Tom gave was for SQLite - MySQL handles date conversions differently

I THINK it is something like SELECT max, FROM_UNIXTIME(maxtime)
eg:

SELECT max, FROM_UNIXTIME(maxtime) from archive_day_wind where dateTime>1524319200 and dateTime<=1524924000;

Greg from Oz

unread,
May 1, 2018, 6:51:19 AM5/1/18
to weewx-user
So it's not just me them that is not seeing wind directions for week etc.?
That reassuring🙂

Andrew Milner

unread,
May 1, 2018, 6:55:09 AM5/1/18
to weewx-user
I'm hoping Tom comes back with comment/reasons from my earlier posting regarding the archive table gust/gustdir and summary tables gust and gust/dir being populated/not populated for fine offset stations.

Thomas Keffer

unread,
May 1, 2018, 8:52:42 AM5/1/18
to weewx-user
I think the issue is that the hardware in Fine Offset stations emit windGust, but not windGustDir.

Matthew would know the details of how record generation is done for these stations, but until he chimes in, one thing you could try is to switch to software record generation. Then the accumulators in weeWX would be used to generation windGust and windGustDir, rather than download them from the hardware.

In weewx.conf, you want:

[StdArchive]
    record_generation = software

-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+unsubscribe@googlegroups.com.

Andrew Milner

unread,
May 1, 2018, 10:31:44 AM5/1/18
to weewx...@googlegroups.com
Tom
I am already using software generation - so it is not that!

So yes, maybe Matthew is the man!!

Andrew


--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/CMcLQWiqtvI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+unsubscribe@googlegroups.com.

Thomas Keffer

unread,
May 1, 2018, 11:00:37 AM5/1/18
to weewx-user
Andrew, are you saying that you are using software record generation on an FO station, yet you do not have windGustDir?

-tk

Andrew Milner

unread,
May 1, 2018, 11:19:20 AM5/1/18
to weewx-user
After checking yet again I appear to have, from my FO station, with software record generation:

Archive - windspeed, windDir, windgust but NOT windgustdir

Daily summaries - windspeed, windgust, winddir (not very helpful 0-360!!) but null for windgustdir

am a little baffled because this is not what I thought I saw the other day!!



On Tuesday, 1 May 2018 18:00:37 UTC+3, Thomas Keffer wrote:
Andrew, are you saying that you are using software record generation on an FO station, yet you do not have windGustDir?

-tk
On Tue, May 1, 2018 at 7:31 AM, Andrew Milner <andrew.s...@gmail.com> wrote:
Tom
I am already using software generation - so it is not that!

So yes, maybe Matthew is the man!!

Andrew

On 1 May 2018 at 15:52, Thomas Keffer <tke...@gmail.com> wrote:
I think the issue is that the hardware in Fine Offset stations emit windGust, but not windGustDir.

Matthew would know the details of how record generation is done for these stations, but until he chimes in, one thing you could try is to switch to software record generation. Then the accumulators in weeWX would be used to generation windGust and windGustDir, rather than download them from the hardware.

In weewx.conf, you want:

[StdArchive]
    record_generation = software

-tk
On Tue, May 1, 2018 at 3:55 AM, Andrew Milner <andrew.s...@gmail.com> wrote:
I'm hoping Tom comes back with comment/reasons from my earlier posting regarding the archive table gust/gustdir and summary tables gust and gust/dir being populated/not populated for fine offset stations.



On Tuesday, 1 May 2018 13:51:19 UTC+3, Greg from Oz wrote:
So it's not just me them that is not seeing wind directions for week etc.?
That reassuring🙂

--
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.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/CMcLQWiqtvI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
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.

Thomas Keffer

unread,
May 1, 2018, 1:57:32 PM5/1/18
to weewx-user
Could you check:
  1. That record_generation is indeed software.
  2. Run from the command line, and see if windGustDir is printed out.
  3. Check the database and see if windGustDir is null.
-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.

Andrew Milner

unread,
May 1, 2018, 9:51:51 PM5/1/18
to weewx-user
Tom
1.  record generation set to software
2.  from command line windustdir is NOT printed out for LOOP or REC
3.  windgustdir is null

Also just checked the weewx hardware guide and see Matthew has NOT included windgustDir as an available field for the FO stations.

Andrew

Greg from Oz

unread,
May 2, 2018, 8:28:48 AM5/2/18
to weewx-user
Why does the direction show up on the current conditions page but not the others? I would have thought it would have carried through to the week and month and year.

Andrew Milner

unread,
May 2, 2018, 8:42:30 AM5/2/18
to weewx-user
I cannot say as I do not use the standard skin.

1.  Check the index.html.tmpl and see what the source of the dats actually is
2.  Check the database and see what you actually have in the archive table windspeed, winddir, windgust, windgustdir fields, and the day_windspeed, day_gustspeed and day_gust dir tables

I appear to have nulls everywhere for gustdir.

Greg from Oz

unread,
May 4, 2018, 7:18:35 AM5/4/18
to weewx-user
MariaDB [weewx]> select dateTime,windspeed, winddir, windgust, windgustdir from archive where dateTime > 1523758896;
+------------+-------------------+------------------+------------------+-------------+
| dateTime   | windspeed         | winddir          | windgust         | windgustdir |
+------------+-------------------+------------------+------------------+-------------+
| 1523759196 |   2.0000049725819 |              225 | 4.10001019379289 |        NULL |
| 1523759496 |  1.40000348080733 |              315 | 2.40000596709828 |        NULL |
| 1523759796 |  1.70000422669461 |             22.5 | 3.10000770750194 |        NULL |
| 1523760096 |  3.40000845338922 |              225 |  5.8000144204875 |        NULL |
| 1523760396 |  3.40000845338922 |              180 | 4.80001193419655 |        NULL |
| 1523760696 | 0.700001740403664 |               45 | 1.70000422669461 |        NULL |
| 1523760996 |  1.40000348080733 |               45 | 2.70000671298556 |        NULL |
| 1523761296 |  2.70000671298556 |              225 |  5.8000144204875 |        NULL |
| 1523761596 |  2.70000671298556 |               90 |  5.8000144204875 |        NULL |
| 1523761896 |  1.40000348080733 |                0 | 2.40000596709828 |        NULL |
| 1523762196 |   2.0000049725819 |              135 | 3.40000845338922 |        NULL |
| 1523762496 |  2.40000596709828 |               90 | 5.10001268008384 |        NULL |
| 1523762700 |  2.13333863742069 | 37.1235426243259 | 3.70000919927651 |        NULL |
+------------+-------------------+------------------+------------------+-------------+
13 rows in set (0.00 sec)

I have NULL for gustdir as well.

Andrew Milner

unread,
May 4, 2018, 8:57:26 AM5/4/18
to weewx-user
Well I guess that is simply because the station does not provide wind gust direction.

See
for a more definitive structure to the FineOffset data structures.

SO, for the FO stations you either have to put up with N/A on your web page, or amend the template to not even attempt to put out the direction or go into convoluted code to obtain the max wind/winddir instead of gust dir

Guess you can't have something that cannot be read or derived - and since FO do not provide gust direction you're well and truly st...ed

Still, problem solved in effect as it is not really a weewx issue - the data simply is not available!!

Thomas Keffer

unread,
May 4, 2018, 10:57:12 AM5/4/18
to weewx-user
But, if you are truly using software record generation, it should be available.

Try as I may, I have been unable to reproduce this using my Vantage station. I have modified the vantage driver so that it does not emit windGustDir, then turned off software record generation. windGustDir appears in the database, as it should.

I've attached a lightly instrumented version of engine.py. It will log what kind of record generation it is using, and the value of windGustDir.

Could you both give it a try? Remember to set debug=1.

-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+unsubscribe@googlegroups.com.
engine.py

Andrew Milner

unread,
May 4, 2018, 1:06:34 PM5/4/18
to weewx-user
Here's my log
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
weewx.log.asrm

Thomas Keffer

unread,
May 4, 2018, 5:32:31 PM5/4/18
to weewx-user
OK, this tells us that the problem is in the accumulators. For some reason, they are extracting None for windGustDir.

I'm not very familiar with the FO driver, so could you answer a question for me? If you run from the command line, does it emit a value for windGust in every LOOP packet? Or, just on the archive records? 

If it does, then I think I understand the problem. If it does not, then I have no idea. :-)

-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.

Greg from Oz

unread,
May 4, 2018, 6:52:02 PM5/4/18
to weewx-user
I am running mqtt in weewx and it outputs winDir every minute and I have mqtt set to loop.
My last winDir had a value of 90.0 so it looks like it does output.

Thanks

Greg from Oz

unread,
May 4, 2018, 6:54:47 PM5/4/18
to weewx-user
The field name is windDir

Thomas Keffer

unread,
May 4, 2018, 7:06:11 PM5/4/18
to weewx-user
Thanks, Greg, but I believe the problem occurs if the LOOP data includes windGust, but not windGustDir. In this case, the accumulator uses windGust to set the new high but, because windGustDir is missing, it logs the companion direction as 'None.'

So, unless windGust, but not windGustDir, is being emitting in your LOOP packets, you're not tickling the corner case.

-tk

On Fri, May 4, 2018 at 3:54 PM, Greg from Oz <ubea...@gmail.com> wrote:
The field name is windDir

Greg from Oz

unread,
May 4, 2018, 9:01:20 PM5/4/18
to weewx-user
Thanks.
This is all the data that is transmitted as far as I know. Its from the mqtt loop:

jedwood/raw/weather/loop {"cloudbase_meter": "2740.87486697", "outHumidity": "33.0", "pressure_mbar": "947.4", "rain_cm": "0.0", "maxSolarRad": "585.328757075", "barometer_mbar": "1026.92235717", "dewpoint_C": "1.22021017952", "rainTotal": "47.34", "ptr": "30836.0", "windGust_kph": "5.04001253091", "heatindex_C": "17.7", "dayRain_cm": "0.0", "inDewpoint_C": "7.8764472353", "outTempBatteryStatus": "0.0", "delay": "1.0", "altimeter_mbar": "1027.80761276", "windchill_C": "17.7", "appTemp_C": "15.2004163697", "outTemp_C": "17.7", "status": "0.0", "humidex_C": "17.7", "rain24_cm": "0.0", "rxCheckPercent": "100.0", "hourRain_cm": "0.0", "inTemp_C": "18.5", "windSpeed_kph": "3.60000895065", "usUnits": "16.0", "UV": "0.0", "rainRate_cm_per_hour": "0.0", "dateTime": "1525481944.0", "windDir": "315.0", "inHumidity": "50.0"}
jedwood/raw/weather/cloudbase_meter 2740.87486697
jedwood/raw/weather/outHumidity 33.0
jedwood/raw/weather/pressure_mbar 947.4
jedwood/raw/weather/rain_cm 0.0
jedwood/raw/weather/maxSolarRad 585.328757075
jedwood/raw/weather/barometer_mbar 1026.92235717
jedwood/raw/weather/dewpoint_C 1.22021017952
jedwood/raw/weather/rainTotal 47.34
jedwood/raw/weather/ptr 30836.0
jedwood/raw/weather/windGust_kph 5.04001253091
jedwood/raw/weather/heatindex_C 17.7
jedwood/raw/weather/dayRain_cm 0.0
jedwood/raw/weather/inDewpoint_C 7.8764472353
jedwood/raw/weather/outTempBatteryStatus 0.0
jedwood/raw/weather/delay 1.0
jedwood/raw/weather/altimeter_mbar 1027.80761276
jedwood/raw/weather/windchill_C 17.7
jedwood/raw/weather/appTemp_C 15.2004163697
jedwood/raw/weather/outTemp_C 17.7
jedwood/raw/weather/status 0.0
jedwood/raw/weather/humidex_C 17.7
jedwood/raw/weather/rain24_cm 0.0
jedwood/raw/weather/rxCheckPercent 100.0
jedwood/raw/weather/hourRain_cm 0.0
jedwood/raw/weather/inTemp_C 18.5
jedwood/raw/weather/windSpeed_kph 3.60000895065
jedwood/raw/weather/usUnits 16.0
jedwood/raw/weather/UV 0.0
jedwood/raw/weather/rainRate_cm_per_hour 0.0
jedwood/raw/weather/dateTime 1525481944.0
jedwood/raw/weather/windDir 315.0
jedwood/raw/weather/inHumidity 50.0

I have windGust speed but not direction.

On Saturday, 5 May 2018 09:06:11 UTC+10, Thomas Keffer wrote:
Thanks, Greg, but I believe the problem occurs if the LOOP data includes windGust, but not windGustDir. In this case, the accumulator uses windGust to set the new high but, because windGustDir is missing, it logs the companion direction as 'None.'

So, unless windGust, but not windGustDir, is being emitting in your LOOP packets, you're not tickling the corner case.

-tk
On Fri, May 4, 2018 at 3:54 PM, Greg from Oz <ubea...@gmail.com> wrote:
The field name is windDir

--
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.

Andrew Milner

unread,
May 4, 2018, 9:12:05 PM5/4/18
to weewx-user
Tom
LOOP indeed has gustspeed but not gustdir

REC has gustspeed and NONE for gustdir

Command line output attached



On Saturday, 5 May 2018 02:06:11 UTC+3, Thomas Keffer wrote:
Thanks, Greg, but I believe the problem occurs if the LOOP data includes windGust, but not windGustDir. In this case, the accumulator uses windGust to set the new high but, because windGustDir is missing, it logs the companion direction as 'None.'

So, unless windGust, but not windGustDir, is being emitting in your LOOP packets, you're not tickling the corner case.

-tk
On Fri, May 4, 2018 at 3:54 PM, Greg from Oz <ubea...@gmail.com> wrote:
The field name is windDir

--
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.
commandline.txt

Thomas Keffer

unread,
May 4, 2018, 9:18:05 PM5/4/18
to weewx-user
Thanks, Andrew & Greg. 

I now understand what the issue is.

Try this version of accum.py. It first adds windSpeed to the highs and lows, then windGust. This way, the direction will be saved the first time a high value is seen.

I'm hoping the fix is that simple, but maybe not...

-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.
accum.py

Andrew Milner

unread,
May 4, 2018, 9:41:13 PM5/4/18
to weewx-user
so we will see nothing different until the next highest windgust is seen - is that correct??  And when we have a new high windgust there should then be a windgustdir entry??

What about in the archive where also there is a windgust but no windgustdir??  or is it also necessary to set windgustdir = winddir somewhere in weewx.conf??  i.e what/where/how is windgustdir actually getting a value since it is never actually coming from the station - since I thought greg said that the current tag provides a value for windgustdir ….

gjr80

unread,
May 4, 2018, 11:51:34 PM5/4/18
to weewx-user
Just playing a little devils advocate here; but are we bordering on inventing data? The FO stations provide windSpeed, windDir and windGust per loop packet. It would appear that windSpeed is some sort of average over the period and windGust is presumably the max wind speed seen over the loop period. It appears now that we are setting windGustDir to windDir, but is that necessarily correct, we are not stretching it a little are we?

I also don't see any inconsistency between the Standard skin pages in terms on wind/speed/dir. You need to compare apples with apples not apples with oranges. index.html shows the current conditions (windSpeed/windDir based) in the top left pane and day max values (wind.max/wind.maxdir based) in the lower left pane. week.html shows the week max values (wind.max/wind.maxdir based) in the top left pane and month max values (wind.max/wind.maxdir based) in the lower left pane. The FO problem is with windGustDir/wind.maxdir so anywhere wind.maxdir is used will show N/A. So given that limitation the Standard skin pages are completely consistent.

Gary

Andrew Milner

unread,
May 5, 2018, 12:03:59 AM5/5/18
to weewx-user
I am almost inclined to agree Gary.  I had come to the same conclusions until Tom said there may be a problem with the accumulators and from the original posting it seemed that current was able to provide a gust direction by some means or another. IF there is an implied gustdir==winddir which enables this then weewx should at least be consistent.  However, I came to the conclusion that as the station does not appear to ever output gust dir then the current situation is correct as long as gust direction is NEVER available in any form, anywhere, by any tag for a (standard) FO weather station.

Andrew Milner

unread,
May 5, 2018, 5:41:09 AM5/5/18
to weewx-user
Tom
the new accum.py did not seem to make any difference as far as I could tell.
Andrew

Thomas Keffer

unread,
May 5, 2018, 7:35:04 AM5/5/18
to weewx-user
Because Andrew reported that the new accum does not make any difference, it appears that FO stations do indeed define wind gust that way: it's the max wind seen during a loop period, which can be greater than the wind speed for that period. 

I don't know if setting windGustDir to windDir is inventing data, but we are making an assumption: that the gust is in the same direction as the average wind. But, this is the same assumption we are making for every station that uses software record generation and/or does not emit windGust

Try this version of accum.py. It explicitly substitutes windDir when windGustDir is unavailable.

-tk


accum.py

Andrew Milner

unread,
May 5, 2018, 8:38:45 AM5/5/18
to weewx-user
Tom - before I try the new accum I need to check that I have not misled you!!  I only checked the contents of the db tables - windgustdir in archive, daily windgustdir table and maxwinddir in daily wind table.  Was my answer misleading or as expected?

Andrew
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

Thomas Keffer

unread,
May 5, 2018, 9:05:02 AM5/5/18
to weewx-user
That's what I was expecting. Once we get the datum we want in the database, the rest is easy!

-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.

Andrew Milner

unread,
May 5, 2018, 9:06:35 AM5/5/18
to weewx-user
Well I tried anyway!!

I now have values for windgustdir in the archive table!
I now have a value for today in the daily windgustdir table which looks ok - but I suspect that this is a bogus value!

surely windgust max and windgustdir max times should be the same??

I suspect windgustdir values will be min 0, max 359 for most days (like winddir currently is)
I suspect windgust table needs additional max_dir coluimn to be populated at time of max gust - which I assume to be purpose of max_dir in wind table except that I do NOT have value for max_dir in the daily wind table - but I do not know what this column represents anyway!!

So it seems an improvement to me.  I don't try and use the tags though, so cannot comment on those!!

Thomas Keffer

unread,
May 5, 2018, 10:27:47 AM5/5/18
to weewx-user
It would not surprise me if there is no value for max_dir in the daily wind table if the max wind gust was seen earlier in the day from when you installed the new accum.py. 

More telling would be the value after running for a day or two.

How about you, Greg from Oz?

-tk



To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.

Greg from Oz

unread,
May 5, 2018, 8:05:26 PM5/5/18
to weewx-user
I will give it a go later on tonight when I get 5 minutes and see what happens.

Greg from Oz

unread,
May 5, 2018, 8:35:36 PM5/5/18
to weewx-user
OK I had 5 minutes to spare so put the new accum.py in and now have numbers.

MariaDB [weewx]> select datetime, windgustdir from archive where dateTime > 1525563900;
+------------+-------------+
| datetime   | windgustdir |
+------------+-------------+
| 1525564200 |        NULL |
| 1525564500 |        NULL |
| 1525564800 |        NULL |
| 1525565100 |        NULL |
| 1525565400 |        NULL |
| 1525565700 |        NULL |
| 1525566000 |        NULL |
| 1525566429 |        NULL |
| 1525566600 |         180 |

So I guess I have to wait for a day yo see if anything shows up in the week stats?


On Sunday, 6 May 2018 00:27:47 UTC+10, Thomas Keffer wrote:

Thomas Keffer

unread,
May 5, 2018, 8:44:35 PM5/5/18
to weewx-user
Excellent. 

The gust values will show up either on a new day, or if you hit a new wind speed max.

Thanks, Greg

-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.

Greg from Oz

unread,
May 5, 2018, 8:45:15 PM5/5/18
to weewx-user
Watching my wind direction weather vane it spins around a lot so the direction would be pot luck whether it was a gust or just a breeze, so I think any number/direction is better than nothing.


On Sunday, 29 April 2018 19:32:49 UTC+10, Greg from Oz wrote:
My web page displays the wind direction and is using this value $current.windDir.formatted

The week web page is using this: $week.wind.max from $week.wind.gustdir ($week.wind.gustDir.ordinal_compass) at $week.wind.maxtime

This is what is displayed on the current conditions webpage;
Wind6 km/h from 217° (SW)

This is what is being displayed on the week webpage:
High Wind23 km/h from N/A (N/A) at 11:47:27 (Friday)
So my question is why doesn't the directions show up on any other webpages?
Also where is the data for these values stored?
Are they calculated somewhere?

I noticed this direction data was missing after I installed the android weewx app (which is great BTW) and it showed my missing data.

Thanks in advance.


Andrew Milner

unread,
May 5, 2018, 9:43:53 PM5/5/18
to weewx-user
Tom
With the start of a new day I am now able to say that all gustdir fields appear to be being populated.

The only issue I now find is that there seems to be no correlation between daily gust speed and daily gust direction in that it seems max for daily gustdir is the highest cardinal direction - which will probably settle at 359 by the end of the day, and the time will be then maxtime will be the time at which 359 was seen, whilst gustspeed maxtime will be the time of the gust - so the result of day.windgust.max from day.winddir.max at day.windgust.maxtime will not be what one expects in that direction will usually just be some random high direction close to 359 ….  Unless there is some other way to get the direction of the max gust.

Andrew

Greg from Oz

unread,
May 5, 2018, 9:47:23 PM5/5/18
to weewx-user
OK. It is calm here at the moment but Friday was really windy so I won't see anything until Monday for the week. Unless the wind picks up to over 45kph!

Andrew Milner

unread,
May 5, 2018, 9:51:14 PM5/5/18
to weewx-user
greg - what about for the day??  if it works for the day it should work for the rest - or are you saying it has always worked when using the day tag??

Thomas Keffer

unread,
May 5, 2018, 9:51:59 PM5/5/18
to weewx-user
The value for $day.windDir.max will, indeed, be the highest cardinal value seen for the day, and always has been. Kind of a useless statistic. 

You want $day.wind.gustdir

-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+unsubscribe@googlegroups.com.

Andrew Milner

unread,
May 5, 2018, 9:59:26 PM5/5/18
to weewx-user
where does that come from Tom? In the daily wind table I have a field called max_dir but I do not see a field called gustdir - that is only in the archive table.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

Greg from Oz

unread,
May 6, 2018, 4:11:36 AM5/6/18
to weewx-user
I have added to my index web page:
<td>
                          High Wind 
                        </td>
                        <td>
                          $day.wind.max from $day.wind.gustdir ($day.wind.gustDir.ordinal_compass) at $day.wind.maxtime
                        </td>

And it displays this:
High Wind16 km/h from 45° (NE) at 15:30:00

So it is looking good as far as I can tell.


Andrew Milner

unread,
May 6, 2018, 4:31:45 AM5/6/18
to weewx-user
well I am baffled still!!
day.wind.max  I assumed was from the max column of the archive_daily_wind table - or is it in fact a result of max(windSpeed) from the archive table??

day.wind.gustdir is what??  My archive_daily_wind table has no such column - but it does have a column called max_dir, and the archive table has a column called gustDir (with a capital D) - but what/where is gustdir??

day.wind.gustDir is what?? gustDir is the column name in the archive table

I guess I am missing or not understanding some fundamentals regarding the use of tags and tables, and in particular when the daily summary tables are used and when the archive table is used!!!!

Thomas Keffer

unread,
May 6, 2018, 7:59:38 AM5/6/18
to weewx-user
Where does gustdir come from? See line 1113 in manager.py.

Where is it documented? Apparently nowhere. Fixed in commit 9ebd4c8

-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.

Andrew Milner

unread,
May 6, 2018, 8:18:30 AM5/6/18
to weewx-user
AHA - many thanks for that enlightenment Tom - so it is actually derived from max_dir which kind of makes more sense now, and leaves daily gustdir and winddir tables somewhat useless as you pointed out previously.

I'm not certain that all those summary style 'tags' around line 1113 in manager.py are documented anywhere - although most are pretty obvious there did seem to be a couple more (esoteric to me) possibly undocumented ones!!

Greg from Oz

unread,
May 7, 2018, 5:51:45 AM5/7/18
to weewx-user
Its Monday and a new week has started and I am seeing wind direction and speed and time which is good.

High Wind24 km/h from 45° (NE) at 11:14:30 (Monday)

I am getting some NULL values but I think they are because there is NO wind speed, so that is expected.
| 1525685400 |        NULL |
| 1525685700 |         270 |
| 1525686000 |        NULL |
| 1525686300 |        NULL |

So far so good.
Reply all
Reply to author
Forward
0 new messages