Notification Pop up for High Wind

Hello.

How do I change the notification pop up for high winds in the PWS Dashboard?

Sincerely
Mark

There are multiple notifications possible.

If you want to change the colors a.s.o. for all notifications
→ CSS is in PWS_index2.php lines 235 → 267

The code is generated by the PWS_notifications.php script current version: 01|2021-04-21|

The time the notification(s) are shown is set in line 40 of that script

There are test-settings to force the notifications to “show themselves” at lines 33-36 of that script

Succes,
Wim

Thank you. If I want a wind warning already at 12 m/s, how do I change that criterion?

The easiest way is and was to change line 78 from

if ($spd_kts >= $notifyWindGust )

to

if ($spd_kts >= 23 )

At least if i calculated correctly the 12 m/s into 23 knots.

Succes,
Wim

It does not work :confused:


$spd_kts        = $weather['wind_speed'] * $toKnots;
if ($spd_kts >= $notifyWindGust )

The notification blocks use wind_speednot wind_gust

If you want to use gust, change line 77 from

$spd_kts = $weather[‘wind_speed’] * $toKnots;

to

$spd_kts = $weather[‘wind_gust_speed’] * $toKnots;

Wim

Now it works.

Can you set criteria for when it should use warning $ntfc_strng_l

Hi Mark,

Please explain what you want, I do not understand what you refer to.

Wim

Two warnings have been issued for strong winds. When will the second high wind warning be activated?

Hi Mark, 79
Your website Fredericia Home Weather Station (weatherlink version)
The script http://www.vejret-balslev.dk/pwsWD/PWS_notifications.php?sce=view

It seems you changed the wrong line, my post says line 78 from

if ($spd_kts >= $notifyWindGust )

to

if ($spd_kts >= 23 )

You changed line 79

# ----------------------------------------- WIND
$spd_kts        = $weather['wind_gust_speed'] * $toKnots;
if ($spd_kts >= $notifyWindGust )
    {   if  ($spd_kts > 23)    { $txt1  =  $ntfc_gale_l ;}
        else                  { $txt1  =  $ntfc_strng_l;}
        $arr[]  = $txt1 .' <b class="yellow">'.$weather['wind_gust_speed'].'&nbsp;'.$weather['wind_units'].'</b>';}
#

Line 78 sets the message for the low-level wind_gust_speed
Line 79 sets the message for the higherlevel wind_gust_speed

# ----------------------------------------- WIND
$spd_kts        = $weather['wind_gust_speed'] * $toKnots;
if ($spd_kts >= 23
    {   if  ($spd_kts > 34)    { $txt1  =  $ntfc_gale_l ;}
        else                  { $txt1  =  $ntfc_strng_l;}
        $arr[]  = $txt1 .' <b class="yellow">'.$weather['wind_gust_speed'].'&nbsp;'.$weather['wind_units'].'</b>';}
#

Succes,
Wim

Thank you very much. then I got it fixed :slight_smile:

Can you add more notifications yourself, or is it locked to the 3 - lightning, UV and wind?

Hi Mark,

It is open code. You can add other notifications yourself.
I included those three (four) as they were in the original weather34 for WeatherDisplay version.

If you add others please post your script so others can benefit.

Succes,
Wim

Thank you.

Sincerely
Mark

Just a question on this.
what file does the following pick up from is it PWS_livedata.php?

$ntfc_uv_l = lang(‘High UV-Level’).‘
’.lang(‘Reduce Sun Exposure’);
$ntfc_heat_l = lang(‘Heat Index Caution’).‘
’.lang(‘Heat Exhaustion’);
$ntfc_gale_l = lang(‘Gale Force Wind Gusts’);
$ntfc_strng_l = lang(‘Strong Wind Gusts Caution!’);

Hi swright1957,

All scripts use the $weather array.
That data is loaded by calling PWS_livedata.php which loads, using multiple scripts, all current+high_low weather values in the units choosen by the visitor.

You can check what data for your setup is in the $weather-array
→ PWS_module_test.php
----> Second line right most button “Live data values”


In the notifications script there are 4 messages possible

For UV there are two possible values

  1. The latest UV measurement from the weather-station if any
  2. The WU forecast if it is available, we than use the expected high-UV

For temperature the current heat-index is used

For wind-warning the wind-speed is used as not all stations / weather-programs supply a correct wind-gust

For lightning the weather-station lighting sensor is used.
If if there is a Boltek lightning-sensor the uploaded boltek data is loaded as those values are not in the $weather array.


One can add notifications for any other exceptional value with the data in the $weather array.

Regards,
Wim

Thanks Wim for that info

Silly question:
Where do you activate the notifications?

They automatically show up when an event is triggered in the PWS Dashboard

It never appeared to me. Thank you