***closed*** weather34 for WeatherDisplay (clientraw and WDapi)

But there is no link to that page. Not in the Avatar not in the post.
As I am not clairvoyant, there is nothing i can do.
Wim


Sorry: http://swanston.maui.co.uk/pws/

You are using clientraw.txt for your “livedata”.
The http://swanston.maui.co.uk/clientraw.txt has 10 fields for rain-hour, they all contain 0.3 mm
The clientrawextra.txt has 24 fields for rain-hour, the first 9 contain zero , other 15 contain0.3 mm

Seems Brian, as the programmer of WD, has to tell me how I should calculate rain-last hour.
Probably I have to subtract the tenth = last hour value from the ninth one to get the last hour rain.
Wim

That would explain it! I did check that WD was showing “rain last hour” correctly, and SSGauges is showing “time of last rain” correctly, before I posted. . . but didn’t think to check the values in clientraw.txt.

Wim, does it use clientrawhour.txt ? The last 60 mins rain is in there by minute starting at #361 if that helps.

http://swanston.maui.co.uk/clientrawhour.txt Those 60 fields also contain 0.3 mm
361 rain total last 60 min for min 01 M 0.3 mm ( = 0.012 in )
362 rain total last 60 min for min 02 M 0.3 mm ( = 0.012 in )
363 rain total last 60 min for min 03 M 0.3 mm ( = 0.012 in )

It seems that all those “rain-minute” “rain-hour” fields all contain cumulative values, but Brian has to confirm that.
Wim

Wim’s quicker than I am with the parser! But I agree they all contain 0.3 mm. . .

[A single tip from my modified raingauge is actually 0.25 mm = 0.01 in, but WD doesn’t do mm to 2 d.p.]

:frowning:

To get the graphs to work using WU where do I set the API key, Do I place it in the dark weather section?
I see the station name for WU not a spot to add my API key.
Also moon rise moon set does not match WD using same lat/long

IMPORTANT

  • You do not need an WU API-key. Your own data was always available without any key, your station ID is the only id needed.
  • The current WU-API-key was/is used to load the WU forecast for your area. That is now the DarkSky forecast with the DarkSky API-key.
    [li]On February 15th
  • all “rules of the game” will change[/li][li]WU will switch to new API-keys for all access including our own station data.[/li][li] But at this moment there is no documentation or description how we can load our stations data over a longer period then 7 days.

[/li]
[/ol]
So for now and at least until Feb 15, all graphs should work with your WU-station data. Just set the correct station-key usinge easyweather.
Wim

To check this out, I need the URL of your pwsWD/ folder.
And can you please post your latitude / longitude as you set in WD and in Easyweather? I con not check these myself as settings are protected from spying eyes.

Be aware that WeatherDisplay uses a minus for latitude east of Greenwich (f.i. Europe).
Other programs use the standard minus for west of Greenwich (f.i. the USA).

Wim

Also be aware that moon data can be confusing since the rise and set seen on one calendar day may be from two different moon cycles, see this recent thread.

its daily rain total
as per the clientrawdescription.txt
i.e so its the daily rain total 60 minutes ago
then the daily rain total 59 minutes ago
etc

clientraw.txt does have
100-109 array of last rain last hour (10 positions)
and that too is daily rain total at those times

My AQI is reading “offline”. Is this normal between data updates?


Capture.PNG

The date-time seemed to be in “UTC” for other test-sites. Now it is in local as far as i can see.
Try this script for a few days, I changed only line 93 from gmdate() to date()
As the time difference here in wester Europe between UTC and local is small, this error was not found when testing.

PM or mail me if there are still problems.
Wim

P.S. better version attached at 15:21 UTC


gov_aqi_block.php.zip (3.09 KB)

Thanks, also for the mail.
The array [100] → [109] covers only 1 hour divided in 10 data points.
“total rain of the last hour” = latest data point [100] minus oldest point [109];
w34_livedata.php line 132 is changed from

	$weather["rain_lasthour"]       = convert_precip ($wd[100],$from,$to);

to

	$value                          = (float) $wd[100] - (float) $wd[109];  # 2019-01-14
	$weather["rain_lasthour"]       = convert_precip ($value ,$from,$to);   # 2019-01-14

Wim


w34_livedata.php.zip (5.4 KB)

Hi,

I have had this version up and running for the last few days now, however I can’t seem to get the graphs working. I have set up the WD API and tested with success and I have set up the SQL table and I can see the data arriving every minute, however I can’t seem to generate the graphs. The ‘Today’ graph seems to be populated with some demo data and does not seem to change. Am I missing something?

I can switch the source of the graph data from WU and that works fine.

Is there any ideas what I am doing wrong?

The link to my site is,

http://micklehamweather.com/pwsWD/

Thanks,
Neil

I can not check your settings, so I attach a screenshot. How did you set these two settings?
It works like this:
If all database settings are OK:
WDapi or the stationcron will store 1 record in the database

If charts are set to Database
=> stationcron will store one line in results.csv

In hindsight, it is more logical to let WD-api add the lines to the .csv when it is loading the DB-record.
But that file can grow very rapidly when the upload interval is set to frequently.

Just before and after midnight the two other cron-scripts will add 1 line to year and monh csv files and clean todays data from the database.
The result.csv (= this days data) is then cleared also.

===
As far as I can see, based on the file-contents, you set WDapi to upload to the database, but are not running a cron-job.

Wim

P.S. I added another post below about the sun-block


I do not understand the sun block on your site.
These should be the settings (for Melbourne) in pwsWD/w34_settings1.php. Could you check them?

                   $TZ = "Australia/Melbourne";
                  $lat = (float) "-37.813611";
                  $lon = (float) "144.963056";

I attach the latest version of the script, for easier reference it displays the hours around the 24-hr clock.
You have to add the azimuth script also.
At noon there should be sun, at midnight it should be dark.

Wim


sun_block.php.zip (2.94 KB)

azimuth.php.zip (3.64 KB)

Azimuth/elevation not working in new Sun block here - http://swanston.maui.co.uk/pws/