Author Topic: wxwuhistory.php error  (Read 806 times)

0 Members and 1 Guest are viewing this topic.

Offline Conchobair

  • Member
  • *
  • Posts: 17
  • www.midkerry-weather.com
    • MidKerry Weather
wxwuhistory.php error
« on: July 07, 2023, 07:24:18 AM »
I noticed fairly recently that my monthly reports were throwing an error.. Specifically if i selected Monthly data or yesterdays data

Thought it might be due to the normal hit and miss Wunderground, but looking at a few other sites using the same template all appear to be ok ..

 [ You are not allowed to view attachments ]

 [ You are not allowed to view attachments ]

http://www.midkerry-weather.com/wxwuhistory.php

« Last Edit: July 07, 2023, 07:25:56 AM by Conchobair »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9015
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxwuhistory.php error
« Reply #1 on: July 07, 2023, 11:29:26 AM »
The WU-History-inc.php script likely needs updating - 3.4h March 21,2021 is currently working on PHP 8+

Download from https://saratoga-weather.org/WU-History-inc.php?sce=view
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Conchobair

  • Member
  • *
  • Posts: 17
  • www.midkerry-weather.com
    • MidKerry Weather
Re: wxwuhistory.php error
« Reply #2 on: July 07, 2023, 11:56:44 AM »
The WU-History-inc.php script likely needs updating - 3.4h March 21,2021 is currently working on PHP 8+

Download from https://saratoga-weather.org/WU-History-inc.php?sce=view

Perfect ... looks like that solved the issue ... Many thanks again Ken for the super support

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2611
    • East Mesa Weather
Re: wxwuhistory.php error
« Reply #3 on: July 12, 2023, 10:38:56 PM »
Where can I find the full package for this script?

Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9015
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxwuhistory.php error
« Reply #4 on: July 12, 2023, 10:42:28 PM »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2611
    • East Mesa Weather
Re: wxwuhistory.php error
« Reply #5 on: July 12, 2023, 10:55:42 PM »
Thank you, Sir!


Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 406
    • Gobles Weather Page
Re: wxwuhistory.php error
« Reply #6 on: July 31, 2023, 02:33:42 PM »
I am having a bit of issues with the script. I am running the latest version. Not displaying on the page but when click on comma delimited File you can see the data.

https://www.goblesweather.com/wxwuhistory.php

Chuck

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9015
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxwuhistory.php error
« Reply #7 on: July 31, 2023, 02:51:11 PM »
It looks like your PHP server instance isn't setting up the usual stuff to indicate https, so a routine in WU-History-inc.php is trying to use http to get WXDailyHistory.php info and gets a 301 redirect instead.

Change WU-History-inc.php from
Code: [Select]
$url  = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $port == 443) ? "https://" : "http://"; to
Code: [Select]
$url  = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $port == 443) ? "https://" : "https://"; to make it work on your site.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 406
    • Gobles Weather Page
Re: wxwuhistory.php error
« Reply #8 on: July 31, 2023, 03:33:15 PM »
Thank you Ken it is working correctly.

Chuck

Offline Conchobair

  • Member
  • *
  • Posts: 17
  • www.midkerry-weather.com
    • MidKerry Weather
Re: wxwuhistory.php error
« Reply #9 on: August 01, 2023, 01:59:47 AM »
I have just noticed an additional issue on my site (and i did think it was down to the usual issues with Wunderground) but i don't seem to have any daily reports showing.
No doubt i have something simple going on but i can't seem to pinpoint the issue..

 [ You are not allowed to view attachments ]

http://www.midkerry-weather.com/wxwuhistory.php

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9015
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxwuhistory.php error
« Reply #10 on: August 01, 2023, 10:53:33 AM »
It seems to be working for August 1, 2023 -- just not for the last few days of July, 2023.
I suspect that was caused by WU changes and not anything you could change.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Conchobair

  • Member
  • *
  • Posts: 17
  • www.midkerry-weather.com
    • MidKerry Weather
Re: wxwuhistory.php error
« Reply #11 on: August 02, 2023, 01:45:08 AM »
It seems to be working for August 1, 2023 -- just not for the last few days of July, 2023.
I suspect that was caused by WU changes and not anything you could change.

I was looking further into this and although i can see the data for today, yesterday disappears ... so when you checked August 1st it was there ... but if you check it now then there is no data.
So todays data is visible
 [ You are not allowed to view attachments ]


but if you now checked the data for August 1st .. it is no longer visible.
 [ You are not allowed to view attachments ]

I have checked back and all daily data is gone upto April16th this year

Strange one

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9015
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxwuhistory.php error
« Reply #12 on: August 02, 2023, 10:42:15 AM »
I can't tell if you're running WXDailyHistory.php V1.33 or not .. download and install https://saratoga-weather.org/WXDailyHistory.php?sce=view

Looking at your JSON cache files, it appears that your prior day file is being replaced by a day-summary file instead of the detailed day file and since it only contains one summary observation, your prior day details do not appear.

Update WXDailyHistory.php and see if that fixes the issue tomorrow.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Conchobair

  • Member
  • *
  • Posts: 17
  • www.midkerry-weather.com
    • MidKerry Weather
Re: wxwuhistory.php error
« Reply #13 on: August 02, 2023, 10:52:35 AM »
I can't tell if you're running WXDailyHistory.php V1.33 or not .. download and install https://saratoga-weather.org/WXDailyHistory.php?sce=view

Looking at your JSON cache files, it appears that your prior day file is being replaced by a day-summary file instead of the detailed day file and since it only contains one summary observation, your prior day details do not appear.

Update WXDailyHistory.php and see if that fixes the issue tomorrow.

I was using version 1.32.. so have updated with the latest version and will see if that fixes the issue ... Thanks again for your help and assistance

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9015
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxwuhistory.php error
« Reply #14 on: August 02, 2023, 11:28:52 AM »
I've done some more testing with the API calls using your station id ICOKERRY3 and your and my API keys, and found that it is the API itself that is returning the summary instead of the detail data for the day using

https://api.weather.com/v2/pws/history/all?stationId=ICOKERRY3&format=json&units=m&date=20230731&apiKey=<apikey>&numericPrecision=decimal

using my API key or your's results in a summary JSON file
Code: [Select]
{
  "observations": [
    {
      "stationID": "ICOKERRY3",
      "tz": "Europe/Dublin",
      "obsTimeUtc": "2023-07-30T23:29:14Z",
      "obsTimeLocal": "2023-07-31 00:03:53",
      "epoch": 1690759754,
      "lat": 52.10387,
      "lon": -9.891839,
      "solarRadiationHigh": null,
      "uvHigh": null,
      "winddirAvg": 240,
      "humidityHigh": 95,
      "humidityLow": 95,
      "humidityAvg": 95,
      "qcStatus": -1,
      "imperial": {
        "tempHigh": 60.6,
        "tempLow": 60.6,
        "tempAvg": 60.6,
        "windspeedHigh": 10.1,
        "windspeedLow": 10.1,
        "windspeedAvg": 10.1,
        "windgustHigh": 14,
        "windgustLow": 14,
        "windgustAvg": 14,
        "dewptHigh": 59.2,
        "dewptLow": 59.2,
        "dewptAvg": 59.2,
        "windchillHigh": 60.6,
        "windchillLow": 60.6,
        "windchillAvg": 60.6,
        "heatindexHigh": 60.6,
        "heatindexLow": 60.6,
        "heatindexAvg": 60.6,
        "pressureMax": 29.67,
        "pressureMin": 29.67,
        "pressureTrend": null,
        "precipRate": 0,
        "precipTotal": 0
      }
    }
  ]
}
  Using my KCASARAT1 station ID returns the expected 288 observations for the day.  So, the update to V1.33 of WXDailyHistory.php won't fix the issue (but will avoid some Notice errata for missing wind speed/direction indications).

I fear this may be a question for WeatherUnderground tech support to address as the API itself seems to be not returning the expected data.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Conchobair

  • Member
  • *
  • Posts: 17
  • www.midkerry-weather.com
    • MidKerry Weather
Re: wxwuhistory.php error
« Reply #15 on: August 03, 2023, 01:50:03 AM »
I've done some more testing with the API calls using your station id ICOKERRY3 and your and my API keys, and found that it is the API itself that is returning the summary instead of the detail data for the day using

https://api.weather.com/v2/pws/history/all?stationId=ICOKERRY3&format=json&units=m&date=20230731&apiKey=<apikey>&numericPrecision=decimal

using my API key or your's results in a summary JSON file
Code: [Select]
{
  "observations": [
    {
      "stationID": "ICOKERRY3",
      "tz": "Europe/Dublin",
      "obsTimeUtc": "2023-07-30T23:29:14Z",
      "obsTimeLocal": "2023-07-31 00:03:53",
      "epoch": 1690759754,
      "lat": 52.10387,
      "lon": -9.891839,
      "solarRadiationHigh": null,
      "uvHigh": null,
      "winddirAvg": 240,
      "humidityHigh": 95,
      "humidityLow": 95,
      "humidityAvg": 95,
      "qcStatus": -1,
      "imperial": {
        "tempHigh": 60.6,
        "tempLow": 60.6,
        "tempAvg": 60.6,
        "windspeedHigh": 10.1,
        "windspeedLow": 10.1,
        "windspeedAvg": 10.1,
        "windgustHigh": 14,
        "windgustLow": 14,
        "windgustAvg": 14,
        "dewptHigh": 59.2,
        "dewptLow": 59.2,
        "dewptAvg": 59.2,
        "windchillHigh": 60.6,
        "windchillLow": 60.6,
        "windchillAvg": 60.6,
        "heatindexHigh": 60.6,
        "heatindexLow": 60.6,
        "heatindexAvg": 60.6,
        "pressureMax": 29.67,
        "pressureMin": 29.67,
        "pressureTrend": null,
        "precipRate": 0,
        "precipTotal": 0
      }
    }
  ]
}
  Using my KCASARAT1 station ID returns the expected 288 observations for the day.  So, the update to V1.33 of WXDailyHistory.php won't fix the issue (but will avoid some Notice errata for missing wind speed/direction indications).

I fear this may be a question for WeatherUnderground tech support to address as the API itself seems to be not returning the expected data.

Thanks for this .. makes sense
I see that Wunderground have completed their maintenance so will look to see if it changes anything, then take it up with them.

Thanks again for your support, it really is much appreciated.

*I have emailed Wunderground support with the issue, so will update if anything comes out of it
« Last Edit: August 03, 2023, 06:00:51 AM by Conchobair »