HWS-template (WD34) beta test July version

Not strange at all, the original release contained hundreds of html “notices” / problems.
I removed them all, but had to rewrite 90% of the code.

I can probably change the code in such a way that you do not have to blacklist the template. I already changed the code, but need the extension to test with.

But that is for ‘one fo these days’ later next week.
Tomorrow it is “conformation” day for the grand children, to important for them and for me to miss that large family gathering.

Wim

Hi Wim,

I see a problem with weather alerts.
It shows the distance of a discharge (Nexstorm).
Instead of 1509 km he gives an alarm because of a thunderstorm at 1,509 km.
See red blocks.

https://www.weerstation-assen.nl/actueel-weer2.php

Edit: After refresh alarm message is gone. See picture how it looked.

Furthermore, it looks great. Many thanks!

Brgds,
Oebel


Can you please PM me the link to the NSRealtime.txt file you are using? Then I can test / check.

The comma in the distance is a number_format error, I will check that.
The alert is always given if the “lightningtimeago” is less then 500 seconds.
Both the WeatherFlow or Boltek are used for that. Boltek has priority if both devices are available.

Wim

Hi Wim,

You have PM.

Brgds,
Oebel

Wim, when is the WXSIM parser ‘plaintext-parser.php’ run, meaning at which stage during the loading of all the other templates? Is the WXSIM parser ‘plaintext-parser.php’ run before the ‘w34_util_wxsim.php’? If yes, then the value of the path to the ‘plaintext.txt’ data file set in ‘plaintext-parser.php’ template should be passed on to the ‘w34_util_wxsim.php’ template and not be fixed in the ‘w34_util_wxsim.php’ template, thus preventing the current situation, that is ‘assuming’ that a file/template is in the root directory when that file/template can/could be in a totally different directory.

The WXSIM parser ‘plaintext-parser.php’ needs to be edited in order to provide the required information for its proper operation - the ‘w34_util_wxsim.php’ template should not have be edited.

Note: On all the systems I have operating on my home/office server as well as my online server, no template, no data file is place in the root directory - for me, the root directory is ‘sacred’ and not to be used for any purposes except for an .htaccess routing file.

One thing I noticed with this beta on 12 hr. clock it doesn’t change from am to pm till a screen refresh is done.
https://www.shermanctweather.org/pwsTEST/index.php
Tom

Attached correct formatted distance number.
There is only an alert when the age is less then 600 seconds

Wim


advisory_c_small.php.zip (3.37 KB)

w34_util_wxsim.php serrvices all wxsim blocks/popups,
it is loaded by all wxsim scripts as the first include
and it then
=> compares the age of plaintext.txt versus the age of the cache arrays
==> if a new file arrived
===> it loads the parser
===> and saves Ken True’s arrays to the cache
==> if no new file arrived it loads the arrays from the cache
=> and returns the arrays to the calling script
Then the normal scripts can print what they need.

The WXSIM parser 'plaintext-parser.php' needs to be edited in order to provide the required information for its proper operation -
Yes it should be edited as it is the exact copy of Ken True's script. I stopped making small changes in someone else scripts as it always resulted in large problems
the 'w34_util_wxsim.php' template should not have be edited.
As w34_util_wxsim.php starts before the parser they both should now the exact location to check the filetime and to read the file
Note: On all the systems I have operating on my home/office server as well as my online server, no template, no data file is place in the root directory - for me, the root directory is 'sacred' and not to be used for any purposes except for an .htaccess routing file.
I agree with that 100%. That is why I have all my template/scripts in separate folders.

So I will make clear in the documentation that there are 2 locations to check.
As most wxsim users upload to the root, I leave the current relative addressing as is.

Wim

Thanks for finding that, it has been the same script form months.
The 24 hour clock can not have that problem. I will test tomorrow around noon.
If possible can you test this “enhanced” version.

Wim


clock_c_small.php.zip (2.32 KB)

Hi Wim,

The problem is not solved.
A storm warning is displayed when the distance is hundreds of kilometers.
https://www.weerstation-assen.nl/actueel-weer2.php

Brgds,
Oebel


I checked the scripts.

  1. advisory box displays a message when
    1.1 the age of last-strike = less then 500 seconds
    1.2 and there are no other more important messages

  2. A notification is always shown when the age of last-strike = less then 700 seconds

On both cases the distance is shown but it is not used to filter the messages.

I only have a Weatherflow device and IMHO that device only signals strikes when they are close by

I received the scripts as is, no explanation.

I would be happy to alter the scripts if there is a description of the algorithm to use.

Wim

New beta version 2019_06_10 available at http://wd34.weather-template.com/beta.php

Includes all discussed changes.

Wim

Wim, rather than asking the user to check that the two locations be edited to point to the same location, could you not ask for the location of the ‘plaintext.txt’ data file in the main configuration template (as you ask for the path to the realtime data file) once the user has selected to use WXSIM when that product has been installed?

Wim,
I tried the new clock_c_small.php but now it stays am even after a screen refresh.
Seen at https://www.shermanctweather.org/pwsTEST/
Tom

This one should do.
I tested for midnight last night, not yet for noon.
Wim


clock_c_small.php.zip (2.32 KB)

Wim,
That one works with a screen refresh. I’ll let you know tomorrow if it changes automatically.
Tom

It looks good from my end for the most part. The only problem I find is that the nearby metar popup is not nearby. It’s Brussels. https://stillwaterweather.com/pws/index.php

Have you entered your nearby airport details in easyweathersetup, and your CheckWX API?

Oops, I got down the metar code, but forgot I had a CheckAPI code. It’s good now. Thanks.

I can not check your settings but with the debug console one can check all data files => https://stillwaterweather.com/pws/w34_module_test.php

Your ./jsondata/metar34.txt is not refreshed (an age of 12 hrs 16 min 14 seconds) so you probably not set the api, as @bitsostring also indicated

===

Your data file is entered as “https://stillwaterweather.com/wx/clientraw.txt
That will result in multiple external file loads every minute.
Always try to use relative addressing for files on the same webserver.
You should change that to “…/wx/clientraw.txt”, that will use less overhead.

===
I see a new problem, thanks for that. #-o
The nws alerts do not nicely fit in the box.

Wim