W34 skin - mixed data

160 views
Skip to first unread message

Radoslav Drdla

unread,
Jun 18, 2019, 1:27:25 PM6/18/19
to weewx-user
Hi, I have weewx 3.9.1 installed and I added W34 skin. I had a few problems I solved, but with one I don't know how to go on. The thing is that the data from weewx database is in Imperial units (recommended) and templates are converted to metric. But the W34skin data from "realtime.txt" is displayed correctly, but leaves the data it receives directly from the database in its original units and then the skin displays nonsense. E.g. the current temperature is 25.1 ° C, but the Max / min temperatures are 81.7 ° C / 59.9 ° C (which are actually temperatures in ° F), similarly the wind speed is in km / h, but the values correspond to mph etc.
My database has data since 2013 and I don't want to lose data or convert it to a metric system. Is it possible to solve it or is W34 skin unusable for me?


temperature.png
barometer.png

Radoslav Drdla

unread,
Jun 19, 2019, 4:39:22 AM6/19/19
to weewx-user
Hi Ion

Since you have not received attachments in the e-mail, I give them here.


Dne úterý 18. června 2019 19:27:25 UTC+2 Radoslav Drdla napsal(a):
w34stats.php
realtime.txt
Message has been deleted
Message has been deleted

Radoslav Drdla

unread,
Jun 20, 2019, 3:11:43 AM6/20/19
to weewx-user
Hi
No, it does it for all units that are in the "English" database, eg temperature ° C and ° F, speed km / h and mph, air pressure hPa and inHg. It is well visible on the charts. And when I switch units (with the button at the top right), the page recalculates it, but because the values under which it is based are bad, the result is even worse, such as 170 ° F and so on.
Simply: in the weewx database, the values are in English units (eg, rainfall is in ing) and weewx converts it to mm before displaying it, but w34 displays it as it is in the database, just changing the label. As a result, only 2.44 mm is displayed in the graph instead of 62 mm, etc. And by changing the units directly on the page, the values are recalculated and the situation gets worse - this time this results in 0.096 inch.
I set something wrong, but I can't figure out what.
I attach settings.php files (I didn't edit them), settings1.php, and two screenshots with graphs.

Dne úterý 18. června 2019 19:27:25 UTC+2 Radoslav Drdla napsal(a):
Hi, I have weewx 3.9.1 installed and I added W34 skin. I had a few problems I solved, but with one I don't know how to go on. The thing is that the data from weewx database is in Imperial units (recommended) and templates are converted to metric. But the W34skin data from "realtime.txt" is displayed correctly, but leaves the data it receives directly from the database in its original units and then the skin displays nonsense. E.g. the current temperature is 25.1 ° C, but the Max / min temperatures are 81.7 ° C / 59.9 ° C (which are actually temperatures in ° F), similarly the wind speed is in km / h, but the values correspond to mph etc.
barometer.png
settings.php
settings1.php
temp_F.png

Andrew Milner

unread,
Jun 20, 2019, 4:11:35 AM6/20/19
to weewx-user
weewx databases do not use 'english'

weewx database units are metric or us (which is what you call english) or metricwx (a variation of metric)

so in the weewx database your temperatures will be EITHER Celsius OR Farenheit but not both

Is your database US (the default) or metric?

the skin should convert from database values to display values as required.

Radoslav Drdla

unread,
Jun 20, 2019, 4:19:27 AM6/20/19
to weewx-user
Sorry. I don't know much English and I translate everything using google. This probably caused a translation error.
My database is US (default)


Dne čtvrtek 20. června 2019 10:11:35 UTC+2 Andrew Milner napsal(a):

Radoslav Drdla

unread,
Jun 20, 2019, 4:31:23 AM6/20/19
to weewx-user
"No, it does it for all units that are in the "English" database, eg temperature ° C and ° F, speed km / h and mph, air pressure hPa and inHg."
I explained it wrongly, thinking that the values DISPLAYED in metric units actually correspond to the values that are stored in the database (that is, US), and it applies to everyone that is different from each other, not both. For example, the time is the same in the US and SI, but the speed is in US in mph, in SI in km / h and therefore it is wise to convert, which is not happening here and the value from the database (mph) is not converted to km / h. Ex. the database is 10 mph and displayed as 10 km / h. (instead of the correct 16 km / h).

Dne čtvrtek 20. června 2019 10:19:27 UTC+2 Radoslav Drdla napsal(a):
Message has been deleted

steeple ian

unread,
Jun 20, 2019, 6:49:38 PM6/20/19
to weewx...@googlegroups.com
From my weewx.conf

[[Defaults]]
        
        [[[Units]]]
            
            # The following section sets what unit to use for each unit group.
            # NB: The unit is always in the singular. I.e., 'mile_per_hour',
            # NOT 'miles_per_hour'
            [[[[Groups]]]]
                
                group_altitude = meter    # Options are 'foot' or 'meter'
                group_degree_day = degree_C_day    # Options are 'degree_F_day' or 'degree_C_day'
                group_pressure = hPa    # Options are 'inHg', 'mmHg', 'mbar', or 'hPa'
                group_rain = mm    # Options are 'inch', 'cm', or 'mm'
                group_rainrate = mm_per_hour    # Options are 'inch_per_hour', 'cm_per_hour', or 'mm_per_hour'
                group_speed = km_per_hour    # Options are 'mile_per_hour', 'km_per_hour', 'knot', or 'meter_per_second'
                group_speed2 = km_per_hour2    # Options are 'mile_per_hour2', 'km_per_hour2', 'knot2', or 'meter_per_second2'
                group_temperature = degree_C    # Options are 'degree_F' or 'degree_C'
On 20 Jun 2019, at 23:44, J D <balloon...@gmail.com> wrote:

Hi,
In you weewx conf file you you have your reports set up for metric or us. They need to be metric.
Can you post your weewx.conf file. Hide any info you do not want to seen by everyone.
Thanks Jerry

--
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/709ff0da-5550-4c1e-9ee9-7ad38083696e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Radoslav Drdla

unread,
Jun 21, 2019, 12:52:21 AM6/21/19
to weewx-user
Hi All
Fault removed. In weewx.conf I missed the [[Units]] section of the w34 skin definition. I assumed that it is enough to place it in the skin.conf, because I have some skins in Czech and some in English and I solved it in skin.conf for individual skins.
All I have to do is replace some of the labels, because not everything can be done with "langxx.php".
Thank you all for trying to help.

Dne úterý 18. června 2019 19:27:25 UTC+2 Radoslav Drdla napsal(a):
Hi, I have weewx 3.9.1 installed and I added W34 skin. I had a few problems I solved, but with one I don't know how to go on. The thing is that the data from weewx database is in Imperial units (recommended) and templates are converted to metric. But the W34skin data from "realtime.txt" is displayed correctly, but leaves the data it receives directly from the database in its original units and then the skin displays nonsense. E.g. the current temperature is 25.1 ° C, but the Max / min temperatures are 81.7 ° C / 59.9 ° C (which are actually temperatures in ° F), similarly the wind speed is in km / h, but the values correspond to mph etc.

Radoslav Drdla

unread,
Jun 21, 2019, 12:59:51 AM6/21/19
to weewx-user
Hi Ion
As I wrote, I have no definition of units in weewx.conf, but in skin.conf for different skins. When I added it to section [[w34skinReport]] in weewx.conf, everything is fine. It didn't occur to me because it works for other skins.


Dne úterý 18. června 2019 19:27:25 UTC+2 Radoslav Drdla napsal(a):
Hi, I have weewx 3.9.1 installed and I added W34 skin. I had a few problems I solved, but with one I don't know how to go on. The thing is that the data from weewx database is in Imperial units (recommended) and templates are converted to metric. But the W34skin data from "realtime.txt" is displayed correctly, but leaves the data it receives directly from the database in its original units and then the skin displays nonsense. E.g. the current temperature is 25.1 ° C, but the Max / min temperatures are 81.7 ° C / 59.9 ° C (which are actually temperatures in ° F), similarly the wind speed is in km / h, but the values correspond to mph etc.

gjr80

unread,
Jun 21, 2019, 1:00:10 AM6/21/19
to weewx-user
Hi,

If you were running a a pre-3.9.0 version of WeeWX you may have been affected by the changes to skin defaults introduced in WeeWX 3.9.0. The upshot is if you had previously customised a skin.conf to use non-US customary units then the upgrade to 3.9.x would override those customisations and revert to US customary units. The solution, as you have found, is to do those customisations/overrides in weewx.conf.

Gary

Radoslav Drdla

unread,
Jun 21, 2019, 7:48:13 AM6/21/19
to weewx-user
Yes, I found out before. Since version 3.9.0, weewx.conf takes precedence over skin.conf, so I had to remove all [unit] sections etc. from weewx.conf and move them to skin.conf of each skin. I didn't think it not worked with w34. The second option is to add the [units] section to define each skin in weewx.conf, which didn't seem to me appropriate because weewx.conf grew disproportionately (not only because of units, but also labels, etc.) and also because of every minor change in weewx.conf it was necessary to restart weewx, but the change in skin.conf does not need restart.
Radek

Dne pátek 21. června 2019 7:00:10 UTC+2 gjr80 napsal(a):

Radoslav Drdla

unread,
Jun 22, 2019, 2:45:40 PM6/22/19
to weewx-user
Hi
After fixing the bug in weewx.conf I discovered two more
1. the apache error.log file still encountered an error:

[Fri Jun 21 16:28:40.181183 2019] [php7:notice] [pid 28426] [client IP:port] PHP Notice:  A non well formed numeric value encountered in /srv/www/html/w34/livedata.php on line 103, referer: http://www.pocasi-kucerov.cz/w34/index.php
[Fri Jun 21 16:28:40.181312 2019] [php7:notice] [pid 28426] [client IP:port] PHP Notice:  A non well formed numeric value encountered in /srv/www/html/w34/livedata.php on line 104, referer: http://www.pocasi-kucerov.cz/w34/index.php

I removed it quite easily, commented out lines 103 and 104 in livedata.php (in the realtime.txt file there are "NULL"). I only mention this in case someone has a similar problem.

2. The second is rather annoying and I don't know exactly what causes it. Appears in syslog:

Jun 21 07:55:40 server weewx[14238]: cheetahgenerator: Generate failed with exception '<type 'exceptions.TypeError'>'
Jun 21 07:55:40 server weewx[14238]: cheetahgenerator: **** Ignoring template /home/weewx/skins/w34skin/result.csv.tmpl
Jun 21 07:55:40 server weewx[14238]: cheetahgenerator: **** Reason: unsupported operand type(s) for +: 'float' and 'NoneType'
Jun 21 07:55:40 server weewx[14238]: ****  Traceback (most recent call last):
Jun 21 07:55:40 server weewx[14238]: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 332, in generate
Jun 21 07:55:40 server weewx[14238]: ****      fd.write(str(compiled_template))
Jun 21 07:55:40 server weewx[14238]: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in __str__
Jun 21 07:55:40 server weewx[14238]: ****      rc = getattr(self, mainMethName)()
Jun 21 07:55:40 server weewx[14238]: ****    File "_home_weewx_skins_w34skin_result_csv_tmpl.py", line 216, in respond
Jun 21 07:55:40 server weewx[14238]: ****  TypeError: unsupported operand type(s) for +: 'float' and 'NoneType'
Jun 21 07:55:40 server weewx[14238]: cheetahgenerator: Generated 3 files for report w34skinReport in 3.98 seconds

However, this error is strange. It only appears after WeeWX reboots and only lasts until midnight! After the first archive record after midnight it disappears and appears again after the Weewx reboot. I think the error occurs on line 24 or 25 in the result.csv.tmpl file, but I don't know how to remove it. I don't mind, weewx often not restartin, but I have a script that backs up my mysql database every Monday and stopping weewx for the time of backup to avoid backup error.

Dne pátek 21. června 2019 13:48:13 UTC+2 Radoslav Drdla napsal(a):
Reply all
Reply to author
Forward
0 new messages