HWS-template (WD34) July version available

Can’t seem to get Weather Display Live from the Menu on your page. . . perhaps that’s because w34_frames.php is still pointing to my page :slight_smile:

I did ask you to delete all my extras. . .

:wink: rest assured it was working to change the links ! Ok it’s done !!

Bien fait! (again) :smiley:

Wim,
I’m testing the beta at https://www.shermanctweather.org/pws09/index.php
I’m using the WeatherFlow API for data.
I think the API is in C but no conversion.
I hope you understand.
Tom

Why is there no orange wind direction arrow on the compass when the wind is due North?

Is it the conditional “if ($dir <> ‘n/a’ . . .” again?


NorthWind.png

Same with me, temps in Celsius and barometer is not correct not showing inHg. Also in the advice block it says Dew Point is below freezing and in Celsius, but says it is F

http://scannorthcounty.net/pws09/index.php

John

:oops: re_ my .txt files do not “update” while the corresponding crons tasks are ok ?


Capture.PNG

The returned data list the [station_units] as F, mph as imperial
The observation data [obs][0] is in metric, without any indication of which units are used for wind where metric should be m/s

This will only show when there is testdata from imperial users. Thanks for testing. :smiley:
I will change changed the script to not use the units from [‘station_units’]

http://scannorthcounty.net/pws09/w34_module_test.php
=> left bottom selector, choose “./jsondata/weatherflow.txt” and click “list contents”
Large bottom area information shows Filetime (UTC): 2019-09-04T06:24:08+00:00 which an age of 0 hrs 00 min 55 seconds
Click on expand as json

Array
(
    [station_id] => 4918
    [station_name] => Village at Old Mill - Westminster, Massachusetts USA
    [public_name] => Village at Old Mill - Westminster, Massachusetts USA
    [latitude] => 42.55623
    [longitude] => -71.88211
    [timezone] => America/New_York
    [elevation] => 268.31265258789
    [is_public] => 1
    [status] => Array
        (   [status_code] => 0
            [status_message] => SUCCESS )

    [station_units] => Array
        (  [units_temp] => f
            [units_wind] => mph
            [units_precip] => in
            [units_pressure] => inhg
            [units_distance] => mi
            [units_direction] => cardinal
            [units_other] => imperial  )
 . .  shortened documentation . . . 
    [obs] => Array   [0] => Array  (
                    [timestamp] => 1567578239
                    [air_temperature] => 17.4
                    [barometric_pressure] => 983.7
                    [station_pressure] => 983.7
                    [sea_level_pressure] => 1015.9
                    [relative_humidity] => 86
                    [precip] => 0
                    [precip_accum_last_1hr] => 0
                    [precip_accum_local_day] => 0
                    [precip_accum_local_yesterday] => 0
                    [precip_accum_local_yesterday_final] => 0
                    [precip_minutes_local_day] => 0
                    [precip_minutes_local_yesterday] => 0
                    [precip_minutes_local_yesterday_final] => 0
                    [precip_analysis_type_yesterday] => 1
                    [wind_avg] => 0
                    [wind_direction] => 0
                    [wind_gust] => 0
                    [wind_lull] => 0
                    [solar_radiation] => 0
                    [uv] => 0
                    [brightness] => 0
                    [lightning_strike_last_epoch] => 1567510487
                    [lightning_strike_last_distance] => 20
                    [lightning_strike_count] => 0
                    [lightning_strike_count_last_3hr] => 0
                    [feels_like] => 17.4
                    [heat_index] => 17.4
                    [wind_chill] => 17.4
                    [dew_point] => 15
                    [wet_bulb_temperature] => 15.9
                    [delta_t] => 1.5
                    [air_density] => 1.17943      ) ))

Wim


w34_livedata.php.zip (9.62 KB)

  1. Maybe: The permissions for those files are strange: 750 ? => probably not the problem, see point 2
  2. Maybe: Caching for the text files as they seem to be updated at 3 september 23:55 => the file-timess were modified at the correct time ?
  3. Maybe: Wrong time for w34_cron_empty.php ? that one should run at ten minutes after midnight
  4. Maybe: It is not a problem as the data for 3 september 23:55 is in the file?

Also when I run the cron (w34_cron_addtoyear.php) in a browser, a new line is added to the text files .

contents of "./chartsmydata/2019_09.txt", processed as filetype "text file"
Filetime (UTC): 2019-09-04T07:47:34+00:00 which an age of 0 hrs 00 min 12 seconds

date,MAX_outsideTemp,MIN_outsideTemp,MAX_dewpoint,MIN_dewpoint,MAX_raintoday,MAX_windGust,MAX_windSpeed,MAX_radiation,MAX_barometer,MIN_barometer,SUM_lightning,MAX_UV,
2019-09-01 23:55:00,70,56.8,65.3,46.8,0,17,15,n/a,30.08,29.8,n/a,n/a,
2019-09-02 23:55:00,72.1,50.5,49.6,41.9,0,14,12,n/a,30.24,30.08,n/a,n/a,
2019-09-03 23:55:00,73.9,49.3,53.8,44.2,0,16,16.1,n/a,30.27,30.17,n/a,n/a,
2019-09-04 09:42:20,62.3,62.3,55.0,55.0,0.0000,7.0,3.0,165,30.064,30.064,0,0,
2019-09-04 09:47:34,63.2,63.2,55.0,55.0,0.0000,7.0,3.0,390,30.063,30.063,0,1,

How are you running those crons?
Do you have a log-file or a last message?

Wim

@Wim

for cron spots i use “cron-job.org” …
the “Last execution” do not send me any errors!
cf. screnn attacment for “Execution history” for (w34_cron_addtoyear.php) ??
thnx

ps_
meanwhile I had launched a script execution :oops:
/_cvt_wu_csv.php


Wim,
I changed the w34_livedata.php file.
It fixed the temps.
On top row min temp says 32, no wind or rain totals.
Baro not inhg

https://www.shermanctweather.org/pws09/index.php

Tom

Yes as there is no min temp available it has 0 in C for temp

no wind or rain totals.
Baro not inhg
Yes a type from me :oops: I attach an update
https://www.shermanctweather.org/pws09/index.php
Tom

Also check the demo for weatherflow Leuven Home Weather Station (wf version)
The data coming from WeatherFlow for stations in your area had only wind values of 0 (zero). Now theres seems to be some wind.
To have the min max values for all weather items you need to run the crons.
But it seems that the station-cron is not updating correctly, I have to setup a imperial testsite to test what is wrong,
Wim


w34_livedata.php.zip (9.62 KB)

I ran a test with your latitude/longitude, units, WF-ID on a fresh download , with the correct livedata scripts.
Every 5 minutes I ran w34_cron_stationcron in the browser.
It updated correctly the history file, so the min-max values are updated. See attached screenshot.

At your site, the cron sas it is updating the history, success files loaded + history recalculated but it seems that the file is not . The file is empty, only n/a values
https://www.shermanctweather.org/pws09/w34_listfile.php?file=./chartsmydata/history.txt&type=arr

Probably there is a problem with the permissions/ownership of the ./chartsmydata/history.txt file

I added more debug messages in the script, please unzip and upload the attached script

Wim


w34_cron_stationcron.php.zip (2.95 KB)

Wim,
I have downloaded the script.
I now have the crons setup.
I noticed wind max changed from 9 to 2?
On top row no times on wind.
Rain has zero for Sept. but we have had .80 in.

Tom

Could you also update the livedata script from HWS-template (WD34) July version available - #336 by pwsdashboard - PWS Dashboard 2012 - Weather-Watch Forum

I tested your site again and the history file is not updated with new contents.
I ran out of ideas for now, I must rethink and try to add extra debug messages.

Thanks for testing so far,

Wim

Wim,
I had downloaded that w34_livedata.php file which did correct the temps. I will download it again.
I also changed permissions on the chartsmydata file to 775.

Thank you for all your work.
Tom

Thanks, but I really do like these problems. Thank you for beta-testing the scripts so others can use them also.

I attach a new version of station-cron, I think it will clear the errors from the history file.
If not we have to remove the history.txt and let the script generate a new one.

=== For your information:
The weatherFlow-api only delivers current values for the weather-items. So the highest and lowest values for today and other periods have to come from the history file.

That file is generated and kept correct by the station-cron.
That script can not look back in time, from today the history starts with today’s values.

When the history is correct for a couple of days, we will run a script to load all history values from your WeatherUnderground data.
But first the updating of the history should function correctly.

Wim


w34_cron_stationcron.php.zip (3.02 KB)

Looks like it. . . I commented out the conditionals (for direction and average) and got the arrow back. I presume the fact that the arrow is not quite at “12 o’clock” is a rounding artefact?

Could we start a new topic for the new beta version, so July version problems don’t get swamped?


NorthWind2.png

I updated the livedata script and that corrected the temp readings, so they are all imperial now.

Barometer block is not following the “inHG” format even though it says it is.

Also, not sure I understand the Top Wind block. Is that for just the last few minutes or another time frame? I thought it was for the top gust for the day, if so it does not match the weatherflow data. Nor does the history pop-up show the correct data. w34_cron_stationcron is updating every 5 minutes. The main wind block does not have the proper gust either. I also downloaded the newest stationcron.php mentioned in message #341.

John

http://scannorthcounty.net/pws09/index.php

Hi Wim
I use WD to trigger the cron jobs so the station cron is done every 10 min the addtoyear cron is done at 23:58 but the empty cron is run at midnight and I do not see a way to change it to 00:10
will the history still work not using WU
http://ballaugh.no-ip.biz:2082/pws09/index.php is my test link on my local server