WXSIM "EWN-style"

Spot on! Very hard to find any free time at the moment

Thank you all for the help!
I updated the version of my PHP, and disabled error reporting on the data.php file and everything is now working as I had hoped!

Hi all,
@Henkka thanks for the nice script :smiley:
The following occurs in the table see the column precipitation.
The precipitation value is in some lines with 14 digits after the point see photo. Can I solve it somewhere?

Link to the WXsim forecast: http://www.leudalweer.nl/wxsimnew/forecast.php

Thanks for your advice.

Peter.


I have problems with this script could you help?
Link forecast.php
www.meteostroncone.info/forecast.php
www.meteostroncone.info/short.php
www.meteostroncone.info/graph.php
Thanke you!!

Hi,
With regards the multiple decimals in ‘pre’ ((prec)precipitation) on some lines.
It bugged me for ages so found a fix : In “wxsim_frc_2017.js” around line (“198”).

Replace :


if(item.prec>0&&item.prec<1){pre=item.prec;}else{pre=Math.round(item.prec);}

With :


if(item.prec>0&&item.prec<1){pre=item.prec.toFixed(1);}else{pre=item.prec.toFixed(1);} 

And I do prefer to see the decimal point value rather than rounded to none.

Kind Regards,


Hi Tony,

It’s been a while since I have asked the question on this forum.
So you can see that there is ever an answer to your question. :lol:
Fine is it that I get an answer from someone who lives 16.832 km away from me.
Thanks for your help Tony. It works! :smiley:

Greetings from the Netherlands,

Peter.

Hi Peter,
:lol: I’m glad it worked for you.
Kind regards from the Apple Isle Tasmania.

Hi I realise this is an old thread, however just curious if anyone else has had this issue and if they may have found a cause or fix.
when “Chance of precipitation less than 20 percent. Precipitation mostly less than 2 mm.” the overview (precip) displays as 120% instead of 20%

below : Quote from my plaitext.txt :

Today: Partly cloudy in the morning, becoming mostly sunny in the afternoon. A slight chance of rain. Windy. High 17. UV index up to 7. Wind west-northwest around 27 kph, gusting to 51 kph. Chance of precipitation less than 20 percent. Precipitation mostly less than 2 mm.

Link to page : https://beaumaris-weather.com/wxsim/forecast.php

Also attached my lastret.txt

Kindest regards,
Tony


lastret.txt (130 KB)

All of the other scripts treat ‘Less than 20%’ as ‘10%’

The new EWN style attempts to do this, but keeps the number ‘2’ within the value, making it ‘120%’

I have found the line that the issue resides in…

In the plaintext.php

if ($wxallpop == ‘<20’) {$wxallpop[$i] = 10;}

I’m not an expert, but removing [$i] fixes the problem, and doesn’t cause any issues.

if ($wxallpop == ‘<20’) {$wxallpop = 10;}

I even changed every single day to Chance of precipitation less than 20 percent. Precipitation mostly less than 2 mm. and it still works.

Hi Mapantz,
Greatly appreciated.
I agree not sure it is the ultimate fix, but yes I confirm it works.
Thankyou,
kind Regards,

Hi there,

I tried to get the Wxsim Ewn Style script to work, but it doesn´t work. It only loads one circle all time.
I tried a few solutions from here, but to no avail. I hope someone can help me?

My files: https://fil.email/K4REIYR7

forecast.php: www.büchelbergwetter.de/WxsimSkripts/Skript1/forecast.php
data.php: www.büchelbergwetter.de/WxsimSkripts/Skript1/wxsim/data.php
lastret.txt: www.büchelbergwetter.de/wxsim/lastret.txt

Greetings,
Manuel

Hi Wetter-Bu
I looked at your config file
$path_to_langfiles = “/WxsimSkripts/Skript1/wxsim/lang”; should work with= “lang/”;
$path_to_lastret = “/wxsim/lastret.txt”; the path has to be exact but try= “https://www.büchelbergwetter.de/wxsim/lastret.txt”;
but you may need to check the path with your host
mine is “E:/Domains/h/hc-iom.co.uk-10digit number/user/my root folder/weather/lastret.txt”; this is an internal path
mine did not work with http://www.hc-iom.co.uk/weather/lastret.txt

$path_to_dataphp = “/WxsimSkripts/Skript1/wxsim/”; should work with= “wxsim/”;
$path_to_js = “/WxsimSkripts/Skript1/js/”; should work with= “js/”;
$path_to_css = “/WxsimSkripts/Skript1/css/”; should work with= “css/”;

hope this is of some help

Your script is started from www.büchelbergwetter.de/WxsimSkripts/Skript1/forecast.php
but that results in => https://büchelbergwetter.de/WxsimSkripts/Skript1/forecast.php
The lastret-file location is https://büchelbergwetter.de/wxsim/lastret.txt
But you haver to find the real path, similar to something like “”/Users/xyz/http_doscs/wxsim/lastret.txt".

Use the attached script

  1. put the unzipped hardpath.php in the wxsim folder
  2. run it as https://büchelbergwetter.de/wxsim/hardpath.php
    and it will display the internal path to your wxsim files

===
The lastret file is not synchronised.
This script only displays the lines of lastret.txt which are ‘exactly’ on the hour, your files does not contain any of those lines

 2:19p DNS.OVCS CHNC. DRZ  11,4  10,3   9,0  11,4   8,5  212   14    6  100   93    4  5511       4,9   0,3  12,0  11,1                        0,0  1,0  0,0   53   25  1011 -0,7 -2,0  0,3  SSW  100    9          0 2020-02-02_12:19_UTC
 2:49p DNS.OVCS            11,6  10,3   9,2  11,6   8,7  212   17    6  100   92    4  5512       5,0   0,2  12,2  11,4                        0,0  1,0  0,0   59   25  1011 -0,6 -1,9  0,3  SSW  100    9          0 2020-02-02_12:49_UTC

Try to adjust the run-times of wxsim to be on-the-hour, not 19 minutes after the hour.

===
The data from the https://www.büchelbergwetter.de/wxsim/plaintext.txt is not displayed as the same path is used as for lastret.txt

The link ANONYMOUS - Filemail link does not work.


hardpath.php.zip (578 Bytes)

Hello everybody,
thank you for your help. I have already adapted some of the paths. The lastret path is right. But I will check it again next weekend with the hardpath.php. The problem with the times in the lastret was also known to me. This is because my meteohub updates the file 22020lg.txt with the data imported from Wxsimate to: 24 and: 53 and therefore only data up to: 21 or 53 is available. This ultimately creates the timestamps in the lastret, which sometimes vary 1-2 minutes. I saw earlier in this topic that I can adjust the timestamps in the script. Problem: the timestamps sometimes vary by 1-2 minutes. Is it possible to adapt the script so that it automatically takes the timestamps that are in the lastret?
And yes the link no longer works, it was only valid for 1 week.

The correct path is essential.
The current path is invalid as the scripts use the same lastret setting for the plaintext.txt file as that should be in the same folder.
And the plaintext data is not displayed either

The problem with the times in the lastret was also known to me. This is because my meteohub updates the file 22020lg.txt with the data imported from Wxsimate to: 24 and: 53 and therefore only data up to: 21 or 53 is available. This ultimately creates the timestamps in the lastret, which sometimes vary 1-2 minutes. I saw earlier in this topic that I can adjust the timestamps in the script. Problem: the timestamps sometimes vary by 1-2 minutes. Is it possible to adapt the script so that it automatically takes the timestamps that are in the lastret?
I attach a version which can cope with all minutes from :50 to :59

Succes next weekend.

Wim


data.php.zip (6.06 KB)

Hi,

here is the result. But there are some problems.

  1. It shows only the next Tuesday at the Top
  2. at the graphic ° C is not shown on the left
  3. at the Overview the description ist not german

Update:
Since Wxsim’s calculation this morning, it has not worked at all and the circle is spinning all the time. The timestamp in lastret has increased by 1 minute. However, I used the modified data.php. Is there still a mistake in it? @Wim


I copied your lastret and plaintext to my MAMP-server.
I used the data php from the previous post which accepts the 50 - 59 minutes
I added your station name to config php
And set the path right
It then works as in the attached screenshot. No problems at all.

As I can not post code anymore on this forum (get a 403 forbidden) i attach a textfile with my settings in config php

When it works with the least amount of changes, then you can start to change other things,

Wim


config.txt (824 Bytes)

Hi Wim,
it works :smiley:

Problem was that I forgot to upload the new data.php file :oops:

How can I get the forecast in german language? In the skript are
translations into german ? The problem with the graphs °C at the left is still there. Also the wind speed ist very low in view of the storm tomorrow. Is it maybe a problem with m/s or. km/h in wret?

Normally it works out of the box.

  1. You can add lang=de to the url https://www.xn–bchelbergwetter-zvb.de/WxsimSkripts/Skript1/forecast.php?lang=de
  2. If this not work, add the default language to the forecast script add line 5
$lang="de";
$wxsimtype="forecast";
The problem with the graphs °C at the left is still there.
Your webserver does not set the default character encoding. The script returns UTF-8. It now depends on your other website-scripts where you should change that. Normally in 2020 we want aal scripts to be in UTF-8 as that is a more universal encoding. Otherwise you could change the generated html yourself Add the following line as the first line to forecast.php
header('Content-type: text/html; charset=UTF-8');
Also the wind speed ist very low in view of the storm tomorrow. Is it maybe a problem with m/s or. km/h in wret?
Did you set the units in config.php correctly ? They should be equal to the ones in plaintext.txt
# IMPORTANT! Units in use, temperature, precip, wind, pressure, snowdepth, visibility
$uoms = array('C','mm','kmh','hPa','cm','km');  

This is a forecasting program with dozens of settings. so probably it is a setting of which external forecast server the WXSIM program is using.
If it in normal situations after a few weeks use, still is not correct, you should ask the author of WXSIM in the correct topic.

Succes,

Wim

There is currently a problem with the ww-server so i can not post most php code examples.

So I will use an image to explain how the first line should look
Start with a less then sign <
Then a ?
Then php and a space
Then the text from the previous post

header('Content-type: text/html; charset=UTF-8');

Then a space and a ? and a greather then >

See attached screenshot

Wim


Hi Wim,

The translation into German works. I also added the first line in config.php. The overview and the next update are now correctly displayed with ä or ü. Only with the graphics does the ° C still not want? Under Overview, the description on the right is also not translated correctly? When I call the plaintext.php the HTTP Error 500 comes up. Is this normal? The rest of it works fine now. Only the 2 problems are left.

https://www.büchelbergwetter.de/WxsimSkripts/Skript1/wxsim/plaintext.php