Some issues and problems

406 views
Skip to first unread message

eumesmamente

unread,
May 4, 2012, 9:51:06 AM5/4/12
to weewx...@googlegroups.com
Hi all.
I am new to the group and wanted to introduce myself and ask some questions. I'm from Galicia in Spain and am trying to install weewx using a Vantage Vue in a school. I am a user with good knowledge of Linux, but not programming. My issues and problems are:

1 - I'm trying to translate to Galician some templates. When I use the
translated index.html.tmpl the reports and web pages are not generated correctly  and an error in syslog appears about some 'ascii' can not encode or decode 0xXX character (I forget). I'm using utf8 option on skins.conf file.

2 - I can not interpret the contents of the dateTime column in the
Sqlite database. How can I convert the contents of this column on a date and time?.

3 - I wish I could send data to meteoclimatic.com station, a Spanish weather web. They use a data template like this:

http://personal.telefonica.terra.es/web/majycman/freewxsummary10.html
http://jordicorbella.com/meteocam/meteo/meteoclimatic.htx

I may do this in some way from weewx?
Many thanks

Thomas Keffer

unread,
May 4, 2012, 11:05:42 AM5/4/12
to weewx...@googlegroups.com
Hello, and welcome to the weewx users group!

1. This will be familiar to long-time users, but please set debug=1, run again, then send the relevant log snippet! Also, when you say you are using the utf8 option, do you mean that you replaced the line 
  encoding = html_entities
with a line
  encoding = utf8

2. The dateTime column is what is called "unix epoch time". The template conversion code in weewx should do the conversion to local time for you. If you want to do something special, say time in a different time zone, that gets more involved. Can you give us more detail what you are trying to do?

3. The link to the format used by meteoclimatic is lacking some detail. Does one fill out a file with the desired information then send it to them? Or, is this an HTTP GET? If the former, then there it should be quite easy --- just create a Cheetah template, just like the other templates, with the framework they give and plug in the relevant numbers using "dot" codes. So, it would look something like:
*VER=DATA2
*COD=
*SIG=
*UPD=$current.dateTime     # You may have to do a time conversion here!
*TMP=$current.outTemp
*WND=$current.windSpeed
...

-tk

--
You received this message because you are subscribed to the Google Groups "Weewx Weather Station Discussion" group.
To post to this group, send email to weewx...@googlegroups.com.
To unsubscribe from this group, send email to weewx-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/weewx-user?hl=en.



--
Thomas Keffer

kef...@threefools.org
+1 541-386-8891 (h)
+1 541-490-9507 (c)
Skype: tkeffer

eumesmamente

unread,
May 4, 2012, 4:31:37 PM5/4/12
to weewx...@googlegroups.com
Many thanks...

1. Next week I will send you the syslog with debug=1, but looking for this problem on weewx group I found this possible solution from
Michal Leinweber:

I spent last 2 days searching for solution of this error when using
UTF-8 characters in templates:

UnicodeDecodeError: 'ascii' codec can't decode byte .......  : ordinal
not in range(128)

Finally I found answer in Cheetah documentation (http://
www.cheetahtemplate.org/docs/users_guide_html_multipage/moduleFormatting.encoding.html).
After adding line:

#encoding UTF-8

as the first line of template file, everything works ok.

Maybe it helps somebody.

PS: I'm still unsuccessfull with UTF-8 image titles (it is internally
converted by weewx directly to Latin-1 :().

2. I was thinking about extractind the necessary columns for the generation of a meteoclimatic template for sending ftp data to meteoclimatic.com with cron and a bash script. The last answer about question 3 is very interesting... Let's go with it...

3. I think that I can send the meteoclimatic template using ftp or I can put this template with data on any public web site accesible from meteoclimatic.com. I have seen this code and it seems to be interesting:
http://code.google.com/p/wfrog/source/browse/trunk/wfrender/renderer/meteoclimatic.py?r=838
I also thik the "Cheetah template" is the solution... but I need more information from meteoclimatic and about "Cheetah template"...

Many thanks in advance

2012/5/4 Thomas Keffer <tke...@gmail.com>

Thomas Keffer

unread,
May 5, 2012, 9:46:06 AM5/5/12
to weewx...@googlegroups.com
Hello.

1. Thanks for the reminder that #encoding UTF-8 has to be at the top of Cheetah template files! The templates test for UTF8 characters and then sets the meta charset accordingly, but there doesn't seem to be possible to automatically include the #encoding directive. I'll have to investigate.

Unfortunately, the image files must be in Latin-1, because the Python Imaging Library does not support UTF8 characters. This is explained in the Customizing weewx manual (cf. section 3.2.3)

2. The templates are very flexible in how the time can be formatted. This is explained in the manual Customizing weewx manual under the section Type dateTime

3. The meteoclimatic link is very cryptic about just what data is needed and what format it should be in. I think you'll find that the template "dot code" used by weewx is very flexible --- most likely you will not have to write any Python code. Just request the proper formatting. But, it's hard to say without more information about what meteoclimatic expects.

-tk

eumesmamente

unread,
May 7, 2012, 10:21:47 AM5/7/12
to weewx...@googlegroups.com
Hi again.

1 - I have solved the problem using html entities...

3 - About the meteoclimatic template. I understand that I need to create a similar file to the example mygenerator.py using the correct values... as explained on  http://www.weewx.com/docs/customizing.htm

But I need some help with this values. Where I can find all the possible equivalent values for creating a custom generator for meteoclimatic template?  More info about meteoclimatic template in spanish: http://www.meteoclimatic.com/index/wp/plantilla_es.html

And a quick automatic translation from google...
many thanks again

Data File Format
The data file comprises a series of fields. Each field consists of an identifying label and the corresponding value. The label shall state in uppercase characters, is preceded by an asterisk and ends with an equals sign. This tag identifies the value that follows it.
Broadly speaking, this file is divided into:

    Head
    Current Data
    Daily data (highs, lows and precipitation)
    Monthly data (highs, lows and precipitation)
    Annual data (highs, lows and precipitation)
    End of file

Important: The purpose of this file is to be understood by a program and not shown to a user. It is therefore very important not to format the information to make it visually attractive. It needs to be a text file net, without marks or labels hypertext between its brands and end of file header.

Head
Aims to mark the start of the data block and station identification. It contains the following fields:
* VER = DATA2
Mark the beginning of the file. Version data file. Constant value.
* COD = [código_estación]
ID code of the station
* UPD = [update]
Date and time of the data. The date should indicate in a standardized format day / month / year. It means the Anglo-Saxon type format month / day / year. Following the date must state the time, preferably in 24 hours. Exception: If the user specifically requires the date format Anglo-Saxon, this date will be preceded by the characters us_ Example: * UPD = US_03/14/2007 14:25

Current Data
Contains the data upon sending the file and make the following fields:
* TMP = [temperature]
Temperature in degrees Celsius
* WND = [velocidad_viento]
Wind speed in km / h
* AZI = [address]
Wind direction. Can be stated in degrees, where 0 ° or 360 ° are the north and 90 º, 180 º and 270 º are the east, south and west, respectively. You can also specify the geographical or literal format (N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SSW, SW, SW, WSW, SW, W, W, WNW, NW, NW , NW, NNW, NW)
* BAR = [pressure]
Pressure in hPa or mb.
* HUM = [moisture]
relative humidity

* SUN = [radiación_solar]
Solar radiation W/m2. Blank if not provided.

Daily data
Contains the daily maximum and minimum and total precipitation of the day, according to the following fields:
* DHTM = [temperature]
Maximum daytime temperature in degrees Celsius
* DLTM = [temperature]
Minimum day temperature in Celsius
* DHHM = [humidity]
Maximum relative humidity of the day
* DLHM = [humidity]
Minimum relative humidity of day
* DHBR = [pressure]
Maximum pressure of the day
* DLBR = [pressure]
Minimum pressure of the day
DGST * = [velocidad_viento]
Maximum wind gust of the day
* DPCP = [precipitation]
Total precipitation days in mm

Monthly data
Contains the maximum and minimum monthly and total rainfall of the month, according to the following fields:
* MHTM = [temperature]
Maximum temperature in degrees Celsius of the month
* MLTM = [temperature]
Minimum temperature in degrees Celsius of the month
* MHHM = [humidity]
Maximum relative humidity of the month
* MLHM = [humidity]
Minimum relative humidity of the month
* MHBR = [pressure]
Maximum pressure of the month
* MLBR = [pressure]
Minimum pressure of the month
MGST * = [velocidad_viento]
Maximum wind gust of the month
* MPCP = [precipitation]
Total precipitation in mm month

Annual Data
Contains the maximum and minimum annual total rainfall of the year, according to the following fields:
* YHTM = [temperature]
Maximum temperature in degrees Celsius year
* YLTM = [temperature]
Minimum temperature in degrees Celsius year
* YHHM = [humidity]
Maximum relative humidity of the year
* YLHM = [humidity]
Minimum relative humidity of the year
* YHBR = [pressure]
Maximum pressure of the year
* YLBR = [pressure]
Minimum pressure of the year
* YGST = [velocidad_viento]
Maximum wind gust of the year
* YPCP = [precipitation]
Total precipitation in mm year

End of file
The data file ends with a mark end of text * EOT *
Because many free services web hosting based funding in the insertion of advertising, often modify the pages that send users to make this appear. To be able to discriminate between advertising and data, marks the beginning and end of data file with these tags.

EXAMPLE FILE

*VER=DATA2
*COD=ESCAT0800000008226A
*UPD=06/01/2007 20:01
*SKY=
*TMP=8.1
*WND=0
*AZI=N
*BAR=1027.2
*HUM=74
*SUN=
*DHTM=13.2
*DLTM=5.3
*DHHM=80
*DLHM=56
*DHBR=1028.9
*DLBR=1025.7
*DGST=16
*DPCP=0
*MHTM=14.5
*MLTM=5.3
*MHHM=80
*MLHM=32
*MHBR=1035.0
*MLBR=1023.5
*MGST=23
*MPCP=0
*YHTM=14.5
*YLTM=5.3
*YHHM=80
*YLHM=32
*YHBR=1035.0
*YLBR=1023.5
*YGST=23
*YPCP=0
*EOT*

2012/5/5 Thomas Keffer <tke...@gmail.com>

eumesmamente

unread,
May 7, 2012, 11:34:04 AM5/7/12
to weewx...@googlegroups.com
I am triying to find the apropiate values for the meteoclimatic template.

Could it be somethig similar to this?

*VER=DATA2
*COD=Estation code
*UPD=06/01/2007 20:01$current.dateTime.format("%d/%m/%Y %H:%M")
*SKY=
*TMP=$current.outTemp.degree_C.formatted
*WND=$current.windSpeed.km_per_hour.formatted
*AZI=$current.windDir.degree_compass.formatted
*BAR=$current.pressure.mbar.formatted
*HUM=$current.outHumidity.percent.formatted
*SUN=
*DHTM=$day.outTemp.max.degree_C.formatted
*DLTM=$day.outTemp.min.degree_C.formatted
*DHHM=$day.outHumidity.max.percent.formatted
*DLHM=$day.outHumidity.min.percent.formatted
*DHBR=$day.pressure.max.mbar.formatted
*DLBR=$day.pressure.min.mbar.formatted
*DGST=$day.windSpeed.max.km_per_hour.formatted
*DPCP=$day.rain.mm.formatted ????????????????????????? (total day rain)
*MHTM=$month.outTemp.max.degree_C.formatted
*MLTM=$month.outTemp.min.degree_C.formatted
*MHHM=$month.outHumidity.max.percent.formatted
*MLHM=$month.outHumidity.min.percent.formatted
*MHBR=$month.pressure.max.mbar.formatted
*MLBR=$month.pressure.min.mbar.formatted
*MGST=$month.windSpeed.max.km_per_hour.formatted
*MPCP=$month.rain.mm.formatted  ????????????????????????? (total month rain)
*YHTM=$year.outTemp.max.degree_C.formatted
*YLTM=$year.outTemp.min.degree_C.formatted
*YHHM=$year.outHumidity.max.percent.formatted
*YLHM=$year.outHumidity.min.percent.formatted
*YHBR=$year.pressure.max.mbar.formatted
*YLBR=$year.pressure.min.mbar.formatted
*YGST=$year.windSpeed.max.km_per_hour.formatted
*YPCP=$year.rainyear.mm.formatted ????????????????????????? (total year rain)
*EOT*

2012/5/7 eumesmamente <manx...@gmail.com>

Thomas Keffer

unread,
May 7, 2012, 10:00:23 PM5/7/12
to weewx...@googlegroups.com
This looks like a very straightforward file. I doubt that you will need to create a custom generator. Just create a template with the format as outlined, and put in dot codes for the required values.

Here's a sample of what it would like look (NOT TESTED):

Current Data
* TMP = $current.outTemp.degree_C
* WND = $current.windSpeed.km_per_hour
* AZI = $current.windDir
...

Daily data
* DHTM = $day.outTemp.max.degree_C
* DLTM = $day.outTemp.min.degree_C
* DHBR = $day.barometer.min
...

and so on.

-tk

eumesmamente

unread,
May 9, 2012, 9:42:02 AM5/9/12
to weewx...@googlegroups.com
I have creted a template as described before for testing with name meteoclimatic.html.tmpl on skins/Standard and added it on skins.conf:

[[[Meoclimatic]]]
            template = meteoclimatic.html.tmpl

but I can see meteoclimatic.html on public_html after generation.

Any help?




2012/5/8 Thomas Keffer <tke...@gmail.com>

Thomas Keffer

unread,
May 9, 2012, 9:55:35 AM5/9/12
to weewx...@googlegroups.com
(I am assuming that you meant "I can not see ...")

Things to check:

The template should be in the subdirectory skins/Standard, along with the other templates.

The configuration file skin.conf should look like

[FileGenerator]

  ... (other sections)

  [[ToDate]]

    ... (other templates)

    [[[Meoclimatic]]]
      template = meteoclimatic.html.tmpl

Is this what you are doing?

Also, if this does not work, set debug=1 in the main configuration file weewx.conf, run, then send us the results from your system log.

I am about to embark on a sailing trip, so I will not be reachable until Monday. Perhaps others can help.

-tk

eumesmamente

unread,
May 29, 2012, 10:12:10 PM5/29/12
to weewx...@googlegroups.com
Many thanks. I have resolved most of my problems.  Now I need to solve a small question.

I neen some data for template:

*DGST = Day max wind gust kmh

*MGST = Month max wind gust kmh

*YGST = Year max wind gust kmh

I can use

*DGST = day.wind.max.km_per_hour

but I can't use

*DGST = day.windGust.max.km_per_hour

When I see the log, the .max and .km_per_hour are not adminted for windGust????

How I can use windGust for max value on day, month and year?

Thanks again


2012/5/9 Thomas Keffer <tke...@gmail.com>

Thomas Keffer

unread,
May 30, 2012, 3:46:35 PM5/30/12
to weewx...@googlegroups.com
Well, I guess it depends on what you mean by "max wind gust". Presumably, it's the maximum wind for the day (or month, or year), in which case it is given by the tags you are using below.

Statistically, max(wind) is the same as max(max(wind)).

-tk

eumesmamente

unread,
May 30, 2012, 6:56:13 PM5/30/12
to weewx...@googlegroups.com
What I mean is that I have some doubts about getting the correct value of the maximum wind gust. When I open the file weewx.db, I can see that the windSpeed column values ​​are usually lower than windGust column. So when I need to put in the template the value of, for example, monthly maximum wind gust, the only option I find is $month.wind.max that seems more appropriate for the maximum monthly wind speed, but not for the monthly maximum wind gust.

Is this right or am I wrong in something?
A greeting and thank you very much again


2012/5/30 Thomas Keffer <tke...@gmail.com>

Thomas Keffer

unread,
May 30, 2012, 11:01:18 PM5/30/12
to weewx...@googlegroups.com
I see your point.

The wind speeds are the average over the archive interval, the wind gust the maximum value seen during the interval. So, you are right. The max of one is not necessarily the max of the other.

For tags such as $day.wind.max, weewx reports the absolute maximum wind seen during the day --- that is the max wind gust. This data comes out of the statistical summary archive, stats.sdb. If for some reason you wanted the maximum value of the average wind speeds over the archive intervals, then you'd have to define your own statistic by writing a custom report generator. As this data would have to come out of the main archive, weewx.sdb, rather than the usual stats.sdb, this is a more involved project than what is outlined in the section Writing a custom generator, in the Customizing Weewx manual.

My apologies, but right now I am on a small boat a few hundred kilometers from my main development computer, so I can't give you much guidance on how to do this.

Frankly, for your purposes of reporting to meteoclimatic, I would just use the same value for both, that is the maximum wind speed seen during the day ($day.wind.max). Calculating the max of the average wind speeds over the archive interval is going to be sensitive to things like the length of the archive interval and, therefore, not of much use.

If you're really determined to nail this down, I would contact meteoclimatic and find out just what they see as the difference between max(wind) and max(windGust)!

-tk

eumesmamente

unread,
Jun 4, 2012, 6:37:16 PM6/4/12
to weewx...@googlegroups.com
Hello again from San Sadurniño in Galicia, Spain. The station is already in use in http://www.meteoclimatic.com/perfil/ESGAL1500000015560A.

Maybe it could be interesting in some way incorporate the meteoclimatic template into weewx if that were useful to someone else.

Thank you very much again for your help and good sea voyage.


2012/5/31 Thomas Keffer <tke...@gmail.com>

copi...@gmail.com

unread,
Sep 13, 2013, 2:07:21 AM9/13/13
to weewx...@googlegroups.com
Hello, I'm interested in sending data to meteoclimatic, you can indicate the steps and the template. thanks

copi...@gmail.com

unread,
Sep 27, 2013, 3:01:01 AM9/27/13
to weewx...@googlegroups.com
Hello, I made the template for meteoclimatic, lay it down if you can be of interest:

include and  skin.conf

[FileGenerator]
...
....
[[[Meoclimatic]]]
            template = meteoclimatic.html.tmpl

create meteoclimatic.html.tmpl

*VER=DATA2
*COD=code by station
*SIG=key
by station
*UPD=$current.dateTime.format("%d/%m/%Y %H:%M")
*TMP=$current.outTemp.formatted
*WND=$current.windSpeed.formatted
*AZI=$current.windDir.formatted
*BAR=$current.barometer.formatted
*HUM=$current.outHumidity.formatted
*SUN=$current.radiation.formatted
*UVI=$current.UV.formatted
*DHTM=$day.outTemp.max.formatted
*DLTM=$day.outTemp.min.formatted
*DHHM=$day.outHumidity.max.formatted
*DLHM=$day.outHumidity.min.formatted
*DHBR=$day.barometer.max.formatted
*DLBR=$day.barometer.min.formatted
*DGST=$day.wind.max.formatted
*DPCP=$day.rain.sum.formatted
*MHTM=$month.outTemp.max.formatted
*MLTM=$month.outTemp.min.formatted
*MHHM=$month.outHumidity.max.formatted
*MLHM=$month.outHumidity.min.formatted
*MHBR=$month.barometer.max.formatted
*MLBR=$month.barometer.min.formatted
*MGST=$month.wind.max.formatted
*MPCP=$month.rain.sum.formatted
*YHTM=$year.outTemp.max.formatted
*YLTM=$year.outTemp.min.formatted
*YHHM=$year.outHumidity.max.formatted
*YLHM=$year.outHumidity.min.formatted
*YHBR=$year.barometer.max.formatted
*YLBR=$year.barometer.min.formatted
*YGST=$year.wind.max.formatted
*YPCP=$year.rain.sum.formatted
*EOT*

Message has been deleted

Thomas Keffer

unread,
Apr 3, 2014, 5:10:45 PM4/3/14
to weewx-user
$day.wind.max will give you the max wind since midnight.

-tk


On Thu, Apr 3, 2014 at 2:08 PM, Ed Fardos <edfa...@gmail.com> wrote:

I just tried to use $current.windGust.max only to find it's not implemented.   Stations report wind and wind-gust, i'd like to know the max for each over the course of a day.

--edfardos

--
You received this message because you are subscribed to the Google Groups "Weewx user's group" 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.

Ed Fardos

unread,
Apr 3, 2014, 5:12:16 PM4/3/14
to weewx...@googlegroups.com
I just tried to use $day.windGust.max only to find it's not implemented.   Stations report wind and windGust, i'd like to know the max for each over the course of a day.

Ed Fardos

unread,
Apr 3, 2014, 5:14:31 PM4/3/14
to weewx...@googlegroups.com


On Thursday, 3 April 2014 14:10:45 UTC-7, Tom Keffer wrote:
$day.wind.max will give you the max wind since midnight.


Right, but we're not looking for max wind.  We're looking for max windGust.  These are separate values as reported by most station hardware.

thanks,
-edfardos 

Thomas Keffer

unread,
Apr 3, 2014, 5:23:01 PM4/3/14
to weewx-user
The value $day.wind.max is the maximum gust seen since midnight. Max is max.

There was a discussion about this a few months ago.

-tk


--

Ed Fardos

unread,
Apr 3, 2014, 5:40:52 PM4/3/14
to weewx...@googlegroups.com
Okay, I read the discussion, and the arguments seem to go in the same circles, or I'm not reading it right.  Maybe  you can help with my example.

Say my station reported three records today:

Record1:
wind:           2 
windGust:   11

Record2:
wind           5
windGust    9

Record3:
wind:          3
windGust   12


What will $day.wind.max report?   Is it what I would expect $day.windGust.max (which doesn't exist)?


thank you,
-edfardos


Thomas Keffer

unread,
Apr 3, 2014, 5:51:27 PM4/3/14
to weewx-user
Hello, Ed.

With your example, $day.wind.max would report 12: the wind gust seen in record 3. 

-tk


Ed Fardos

unread,
Apr 3, 2014, 6:08:39 PM4/3/14
to weewx...@googlegroups.com
Okay, that's what we want then, thanks!

I'll watch my data and see if it holds.

http://sierraglider.com/wx/     (April 3rd 2014)

On the left, Since Midnight, you see Wind Gust($day.wind.max) is 6mph.

On the Right, the wind speed graph shows no sustained winds that high, so it's looking good.  On the other hand, it shows the Max wind at the wrong time, at least according to the graph, but maybe that's just pixel antialiasing, and the topic for another thread :)

thanks again,
-edfardos
Reply all
Reply to author
Forward
0 new messages