History and graphs data

EDIT by wvdkuil 2021-02-03 09:30 UTC: MOVED to a separate topic, is of interest to others also.

:wink: (Re)reading messages is useful for the learning curve.
But sometimes raises questions …
In Reply#30 of this thread you state

Your tempest, nor your 2 WU sites (IOVERIJS101 IHENGE37) use a weather-program, so (nearly) no history. When it would have had rain history it should be displayed.
. True that Tempest and IHENGE37 have an upload to WU only since November 2020, which limits the archive to just 2 months. Upload to WU for IHENGE37 is direct from Domoticz. Upload to WU for Tempest is by the Weatherflow-server, using their link-function. IOVERIJS101 is being uploaded since 2015, and at the website checking the WU-history for any date since 2015 gets display of practical data. That upload combines a data-stream from meteo-software WsWin with a datastream from Domoticz. Same datatream from Domoticz is also feeding MetOffice/WOW and PWSW. Therefore the short question ([i]for understanding[/i]): [i][b]why[/b][/i] your statement that no history is present at WU which is usable for PWS_Dashboard?

There are two different “historical” data sets, one for graphs and one for missing high-low values.

The graphs do not have a “realtime update”, those data lags behind as it is often calculated with a low frequency by the data-provider.
This data can not be used for realtime-high-lows, because of number of API-calls, caching by provider(6 hours for WU-daily history) a.o.

There are currently two sources for graphs data:
If you set to use the WU data for graphs AND your station XXXXXXXX uploads to WU
THEN the scripts will use that WU data (if the api-key is valid), the data is cached in pwsWD/chartswudata/ and pwsWD/wudata/
All graphs will be available for the periode the station was uploading to WU (start-date has to be set in seetings)

One can update/ remove errors in the local WU-data (pwsWD/wudata/ ) using pwsWD/_wu_upd.php?pw=12345

If you choose to NOT use WU-graphs data => you need to run a cron-job which
THEN will create the local data-files for the graphs , the data is cached in pwsWD/chartsmydata/
The graphs will be available for today/month/year periods.
Data is saved every cron-run for “today” and every 00:00 run for month and year.

“Real-time” history for high-lows:

The small history.txt file with a “high-low for day/yday/month/year” is used in some blocks and a pop-up
The file is important for those stations which only have realtime values, such as the weather-nets, ecowitt a.o.
That file is also updated by the cron-job.
The live-data script uses the history-txt plus the last-measurements to show “near realtime” high-lows.

One can generate a “start-history” using WU-data. => pwsWD/PWS_hist_recreate.php?pw=12345
One can update the history file if is has an error-value in it => PWS_hist_update.php?pw=12345

Trust this answers your question. No need to answer.


Graphs no problem, because I use setting WU_graphs, and WU_setting is valid.
History_low_high needs some work because of enabling cronjobs.
Useful hints for ‘flying start’ of history!
MVG, Anton

Only 1 cronjob at 5 minute interval is needed.

Provider-cron normally use an archaic interface xyz/abc/php7.7 /home/user/whatever/pwsWD/PWS_cron_stationcron.php
Most errors occur in setting the correct path and using the same PHP version as your website is using.
Also sometimes the owner of the cron-job is a different one as the owner of the website itself.
Nearly all external solutions are better than using the cron-server of your provider, who sometimes even charge for that “feature”.

External cron-servers use the wget/browser format such as “yourwebsite.com/pwsWD/PWS_cron_stationcron.php

Free external cron-jobs at:
https://www.cronjob.de/ in German
Free cronjobs - from minutely to once a year. - cron-job.org (Kostenlose Cronjobs - von minütlich bis einmal im Jahr. - cron-job.org in German)
Multiple others also when using Google-search

Multiple weather-programs (WD, Meteobridge) are able to schedule 5 min http request => identical to a cron.

Also https://pwsdashboard.com/documentation2012/11_cron.pdf

Interesting solution

Multiple weather-programs (WD, Meteobridge) are able to schedule 5 min http request => identical to a cron.

Also very easy job for Domoticz.
:wink: No need to activate ‘something else’, but just a few more scriptlines …

1 Like