Author Topic: Alternative Dashboard WU Issue (Resolved by the beteljuice)  (Read 2639 times)

0 Members and 1 Guest are viewing this topic.

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2228
    • SouthEast Lincoln, NE Weather
Re: Alternative Dashboard WU Issue
« Reply #25 on: June 09, 2019, 08:11:56 PM »
Thanks! Iím pretty much set with my local values for the average high and low as well as the record high and low with dates for each day. Others who are also using Scottís alternate dashboard need to be able to display their local averages and records as well. The graphic just illustrates how I display them. A general solution that uses a variable for the locale and then scrapes those values with the dates for the records would be very useful. :-) A cron job or curl could run the script once a day at the appropriate time.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline the beteljuice

  • the beteljuice
  • Senior Contributor
  • ****
  • Posts: 183
    • test site
Re: Alternative Dashboard WU Issue
« Reply #26 on: June 09, 2019, 09:27:36 PM »
Quote from: Jerry
A general solution that uses a variable for the locale and then scrapes those values with the dates for the records would be very useful. :-) A cron job or curl could run the script once a day at the appropriate time.
Let's be clear about requirements ....

Yesterday High / Low with time - handled by other code / station data

This Day (regional) record High / Low with year [$theHigh, $highDate /  $theLow, $lowDate]
This Day (regional) Average High / Low [$avgHigh / $avgLow]

... and those six values are the only info you require ?
Unit conversion I can do from inspecting $uomTemp

Cron not necessary, simple date check and cache file.

How would the data get displayed if you aren't using WU ? - I'm thinking of the "if ($useWU)" statement. - is WU data used elsewhere ?, otherwise how would someone stop the WU grab routine ? - is that standard code or one of your mods ?

If ($useWU) is false is there an existing alternative or can this 'block' be an "} else {" for ease of implementation ?
Imagine what you will KNOW tomorrow !

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2228
    • SouthEast Lincoln, NE Weather
Re: Alternative Dashboard WU Issue
« Reply #27 on: June 09, 2019, 10:02:35 PM »
...
Let's be clear about requirements ....

Yesterday High / Low with time - handled by other code / station data

This Day (regional) record High / Low with year [$theHigh, $highDate /  $theLow, $lowDate]
This Day (regional) Average High / Low [$avgHigh / $avgLow]

... and those six values are the only info you require ?
Unit conversion I can do from inspecting $uomTemp
Yes.  Remember, though, that the records may have occurred  in more than one past year.

Quote
Cron not necessary, simple date check and cache file.
That would work, too.
Quote
How would the data get displayed if you aren't using WU ? - I'm thinking of the "if ($useWU)" statement. - is WU data used elsewhere ?, otherwise how would someone stop the WU grab routine ? - is that standard code or one of your mods ?
The '$useWU' switch only occurs once in the original ajax-dashboard6.php, and it is set in the 'AltAjaxDashboardConfig6.php'.  I just didn't bother changing the switch's name for my purposes.  WU now has nothing to do with my ajax-dashboard6.
Quote
If ($useWU) is false is there an existing alternative or can this 'block' be an "} else {" for ease of implementation ?
No.  People can get creative if they want to use the space for something else.

Here is John Gillett's example of an obviously erroneous Record Hi/Lo set because WU no longer provides them.  He has contributed to this thread.

The Average Hi and Average Lo Temps were added to my dashboard in order to provide some historical perspective.  They weren't in Scott's original script.

If you want to examine Scott's ajax-dashboard6 script set, Ken True has kindly undertaken to update it and host it on his SaratogaWx site.
« Last Edit: June 09, 2019, 10:09:37 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline the beteljuice

  • the beteljuice
  • Senior Contributor
  • ****
  • Posts: 183
    • test site
Re: Alternative Dashboard WU Issue
« Reply #28 on: June 09, 2019, 10:17:43 PM »
Quote
The '$useWU' switch only occurs once in the original ajax-dashboard6.php,
It must occur again in order to execute the 'grab' routine and call any unit conversion surely ?
Quote
Remember, though, that the records may have occurred  in more than one past year.
My intention would be to only show the earliest year.
Quote
The Average Hi and Average Lo Temps were added to my dashboard in order to provide some historical perspective.  They weren't in Scott's original script.
Hmm ... whether to add the html / php code or not - probably 'break' peoples existing layout.

Might need a 'vote' on that.

Thoughts please dear readers .....
Imagine what you will KNOW tomorrow !

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1186
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Alternative Dashboard WU Issue
« Reply #29 on: June 09, 2019, 11:26:34 PM »
Here is John Gillett's example of an obviously erroneous Record Hi/Lo set because WU no longer provides them.  He has contributed to this thread.

I did finally manage to turn off the $useORHL   = false; item in the config file (otherwise the ORH image would have shown for today), but because of problems with my hands I am not yet ready to mess with the dashboard .js file to comment out the bad 'Records from WUnderground' data. For me (and others I think), the only thing I need is record high and low for today's date. Scott's (now Ken's) script will still do the compare if the data is saved with the same var name as it was from WU.
John
W7JKG

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2228
    • SouthEast Lincoln, NE Weather
Re: Alternative Dashboard WU Issue
« Reply #30 on: June 09, 2019, 11:37:13 PM »
Here is John Gillett's example of an obviously erroneous Record Hi/Lo set because WU no longer provides them.  He has contributed to this thread.

I did finally manage to turn off the $useORHL   = false; item in the config file (otherwise the ORH image would have shown for today), but because of problems with my hands I am not yet ready to mess with the dashboard .js file to comment out the bad 'Records from WUnderground' data. For me (and others I think), the only thing I need is record high and low for today's date. Scott's (now Ken's) script will still do the compare if the data is saved with the same var name as it was from WU.
Just change '$useWU = true;' to '$useWU = false;' in 'AltAjaxDashboardConfig6.php', John.  Best leave the .js file alone.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2228
    • SouthEast Lincoln, NE Weather
Re: Alternative Dashboard WU Issue
« Reply #31 on: June 09, 2019, 11:47:50 PM »
Quote
The '$useWU' switch only occurs once in the original ajax-dashboard6.php,
Quote
It must occur again in order to execute the 'grab' routine and call any unit conversion surely ?
No.  Thinking about this problem, since grabbing the 'latest' gives tomorrow's results after 5pm, you can't leave it to chance as to when the 'grab' occurs.  It must be initiated at a specific time and in a specific way if the results are to be valid.  Also, since this is the US NWS all units will be Imperial, not Metric.  Any UOM conversions will be handled automatically by the ajaxWDwx3.js script.
 Click on the blue IMPERIAL at the top of my dashboard to see this in action.
Quote
Quote
Remember, though, that the records may have occurred  in more than one past year.
Quote
My intention would be to only show the earliest year.
The data is there.  Why not use all of it?
Quote
Quote
The Average Hi and Average Lo Temps were added to my dashboard in order to provide some historical perspective.  They weren't in Scott's original script.
Quote
Hmm ... whether to add the html / php code or not - probably 'break' peoples existing layout.
The code should just follow the pattern in my dashboard as in the snippet I posted earlier.  No need to 'reinvent the wheel'.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1186
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Alternative Dashboard WU Issue
« Reply #32 on: June 10, 2019, 12:12:03 AM »
Just change '$useWU = true;' to '$useWU = false;' in 'AltAjaxDashboardConfig6.php', John.  Best leave the .js file alone.

Heh - perfect, Jerry. Right in front of my eyes (which is why I missed it  :!: ).

Thank you.

This should also fix Stan.
« Last Edit: June 10, 2019, 12:16:23 AM by jgillett »
John
W7JKG

Offline Silversword

  • --Stan Y.
  • Forecaster
  • *****
  • Posts: 457
    • Up Country Maui Weather
Re: Alternative Dashboard WU Issue
« Reply #33 on: June 10, 2019, 01:22:40 AM »
Hi All,

I turned off my WU part of my High and Low records from my Dashboard for now.  Thanks Jerry for where to do that editing.  Hope that one of these days it will come to show the "Official" temperature records.

Regards,

--Stan Y.
  Maui, Hawaii


Stan Y. - KH6HHG - Maui, Hawaii --- Blitzortung ID: 993 --- FlightRadar24 ID: F-PHOG1
Weather Display 10.37s Build 70
WDL 6.05
MS Windows 7 Pro
Dell Optiplex GX280-Intel Pentium 4 CPU 3.00GHz, 4 GB RAM
Davis Vantage Pro 2+ Wireless
1-Wire Lighting
Webcam: Axis 211

Offline the beteljuice

  • the beteljuice
  • Senior Contributor
  • ****
  • Posts: 183
    • test site
Re: Alternative Dashboard WU Issue
« Reply #34 on: June 10, 2019, 09:36:50 AM »
OK

Got something that should work (Using WU vars is actually set-up within WD - the dashboard script itself does NOT call WU, just 'reads' what WD has put out. So you may want to turn that off).

Here is my effort running in debug (forces a fresh grab from NOAA amongst other things)

EDIT: Redundant material removed ... post for historic information only

I want to keep an eye on it for a day or two to see what Jerry is talking about 'rollover' time, plus of course I'm caching in a different timezone, so need to confirm that works alright.

Looking at the original scripts, it should allow unit change and use of 'new record' graphic option.
« Last Edit: June 14, 2019, 08:36:44 PM by the beteljuice »
Imagine what you will KNOW tomorrow !

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2228
    • SouthEast Lincoln, NE Weather
Re: Alternative Dashboard WU Issue
« Reply #35 on: June 10, 2019, 09:49:29 AM »
Looks good! [tup]  Interestingly the values from NOWData are rounded to whole numbers, whereas my local sources include decimal tenths.

I think Stan in HI, John in CA, and John in AZ (all contributors to this thread) should be your real test targets because they have no local sources such as mine.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1186
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Alternative Dashboard WU Issue
« Reply #36 on: June 10, 2019, 11:01:47 AM »
I'd be happy to try it. Note that at least 95% of AZ does NOT observe DST (hooray!), so my NWS office (PSR) is always -0700 GMT. Thinking maybe 0030 MST or 0100 MST might be a good time for it to run once/day as Jerry suggested.
John
W7JKG

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 825
  • BismarckWeather.net
    • BismarckWeather.net
Re: Alternative Dashboard WU Issue
« Reply #37 on: June 10, 2019, 11:14:59 AM »
If it is confirmed working, I'd be interested in the PHP file if I can get it incorporated into the standard dashboard.
https://www.BismarckWeather.net
Davis VP2, Cumulus, Blitzortung, Bloomsky, Saratoga Scripts

Offline K3JAE

  • Contributor
  • ***
  • Posts: 129
  • Davis VP2 Wireless
    • K3JAE's Weather Station
Re: Alternative Dashboard WU Issue
« Reply #38 on: June 10, 2019, 11:31:31 AM »
Am I then to understand based on a very quick scanning of this thread,  that if the record high/lows can be located, that I now need to somehow create an Excel file to import into the dashboard?

I'll read this thread through a but closer in a few hours (work taking my time at moment) and digest what I read a little longer.


73's de K3JAE

John
K3JAE Weather Station

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 825
  • BismarckWeather.net
    • BismarckWeather.net
Re: Alternative Dashboard WU Issue
« Reply #39 on: June 10, 2019, 11:37:26 AM »
I had created a method using an Excel sheet.

Beteljuice's method will scrape the data from the NWS NOW data section to be posted on your site.  So there are 2 different methods.

But if Betel's method will work for the standard dashboard, I'll probably switch my 4 temp records over to his method.  That way I won't have to keep up my database as much.
https://www.BismarckWeather.net
Davis VP2, Cumulus, Blitzortung, Bloomsky, Saratoga Scripts

Offline K3JAE

  • Contributor
  • ***
  • Posts: 129
  • Davis VP2 Wireless
    • K3JAE's Weather Station
Re: Alternative Dashboard WU Issue
« Reply #40 on: June 10, 2019, 11:44:23 AM »
Yeah, I prefer an auto scrape as I guarantee I will forget to update over many days and get it called into question.  :lol: Gotta love Weather.com - that company is as worthless as a ...........

Where is the USE WU switch located at?  I can at least disable that part for now until a more permanent resolution is found.


73's de K3JAE

John
K3JAE Weather Station

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1186
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Alternative Dashboard WU Issue
« Reply #41 on: June 10, 2019, 12:21:48 PM »
Where is the USE WU switch located at?  I can at least disable that part for now until a more permanent resolution is found.

John, it's in the AltAjaxDashboardConfig6.php file, line 129 in mine.
John
W7JKG

Offline K3JAE

  • Contributor
  • ***
  • Posts: 129
  • Davis VP2 Wireless
    • K3JAE's Weather Station
Re: Alternative Dashboard WU Issue
« Reply #42 on: June 10, 2019, 12:24:27 PM »
OK, Yeah, I'm not using the ALT dashboard.  But I'll sniff it out. LOL


73's de K3JAE

John
K3JAE Weather Station

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1186
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Alternative Dashboard WU Issue
« Reply #43 on: June 10, 2019, 12:28:17 PM »
OK, Yeah, I'm not using the ALT dashboard.  But I'll sniff it out. LOL

Sorry, I should have checked your site. Scott put in a very nice routine to hide the ORHL and bad record data by simply going to false.
John
W7JKG

Offline the beteljuice

  • the beteljuice
  • Senior Contributor
  • ****
  • Posts: 183
    • test site
Re: Alternative Dashboard WU Issue
« Reply #44 on: June 10, 2019, 05:52:39 PM »
@all

The beteljuice 'scraper' is a simple php 'include' file. It gleans the values requested as php variables with which you can do whatever you like.

ie. It can be used as a 'stand alone' - It has no dependency on any other code or resource.

In the Alt dashboard template there are two adjacent well described areas to replace, but that is only because of the WU 'switch' (Now redundant), accreditation change, and I have created different variable names. As stated above there will be an additional option of 'This Day' Norm (Averages), and the  ORHL should work if wanted.

Still to check what 'Time' the noaa donor page rolls over (Fixed TZ, UTC, Locale requested TZ ?)
... and how that affects the grab file / cache file routine on (your) local server - maybe some extra setting up to do.

ATM the only set-up info required is wfo and sid - instructions in the file ...
Code: [Select]
// get this days record max / min temps with year and this days max / min avg temps
// wfo= location in lower_case, sid= location in UPPER_CASE as per https://w2.weather.gov/climate/
// click on map, next screen pick (2) nearest location click (4) Go - pop-up screen
// view source and look at wfo (lowercase) and sid (UPPERCASE) values in <input> section  ;-)

$wfo = "oax";
$sid = "LNK";

// only need info every new day so use a cachefile

Edit:

Arrgh ...
Now I see what Jerry was saying.

EDIT: Redundant material removed ... post for historic information only


@ 16:00 10th June locale TZ by report but now 17:00 (UTC -5) - and their query is 10th 21:00

Yesterday values block have become Today,
... and ..
Today values block have become Tomorrow

More importantly when do they 'flip' back again ?

There's going to have to be some serious logic checking on which area of data to scrape when.

... there's going to some delays guys  #-o
« Last Edit: June 14, 2019, 08:39:15 PM by the beteljuice »
Imagine what you will KNOW tomorrow !

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2228
    • SouthEast Lincoln, NE Weather
Re: Alternative Dashboard WU Issue
« Reply #45 on: June 10, 2019, 06:13:51 PM »
 [tup] beteljuice :!:

Anxious to see it whenever you're ready. :-)

Edit:  I understand the problems, so take whatever time you need.

I think (hope) they flip back around midnight after having been 'tomorrow' from 1700 to 2400?
« Last Edit: June 10, 2019, 06:19:02 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1186
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Alternative Dashboard WU Issue
« Reply #46 on: June 10, 2019, 06:19:08 PM »
... there's going to some delays guys  #-o

Not a problem here.

Thanks for your efforts.
John
W7JKG

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1186
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Alternative Dashboard WU Issue
« Reply #47 on: June 10, 2019, 07:43:38 PM »
Got an SRH Mon afternoon on my site. At least that still works. Nice.   :grin:
John
W7JKG

Offline the beteljuice

  • the beteljuice
  • Senior Contributor
  • ****
  • Posts: 183
    • test site
Re: Alternative Dashboard WU Issue
« Reply #48 on: June 10, 2019, 08:13:57 PM »
beteljuice fuzzy logic may yet prevail  ;)

Edit:
New Day on the test page ...

... By George I think I've Got It  :lol:

Anyone want to play ????
« Last Edit: June 11, 2019, 05:33:08 AM by the beteljuice »
Imagine what you will KNOW tomorrow !

Offline the beteljuice

  • the beteljuice
  • Senior Contributor
  • ****
  • Posts: 183
    • test site
Re: Alternative Dashboard replace WU - Test Pilot Wanted
« Reply #49 on: June 11, 2019, 07:58:24 AM »
Test Pilot wanted ....

Must be able to feed-back problems with instructions, html layout, actual functionality ..

(Keep an eye on data to see if it 'rolls over' at an acceptable time)

NB: This can be used as a 'stand-alone', no dependencies on other scripts - data available for US only !

 EDIT: Redundant material removed ... post for historic information only
« Last Edit: June 14, 2019, 08:40:28 PM by the beteljuice »
Imagine what you will KNOW tomorrow !