Author Topic: Help with wxTrends page  (Read 1988 times)

0 Members and 1 Guest are viewing this topic.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9011
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Help with wxTrends page
« Reply #25 on: July 05, 2023, 02:20:26 PM »
One more test to try on PRO systems (MB-trends-inc.php, MB-defs.php, MBtags-template.txt).  Upload to site, have Meteobridge reload the template for MBtags.php.

This uses -avg@hNN instead of -deltahNN values for h2,h3,h6,h12,h24 times.  I know it's averages, but that was what was used for the day2-7 versions currently in the display in wxtrends.php via MB-trends-inc.php V1.11

On non-PRO Meteobridge systems, the @avg selector is not available, so no displays beyond 60 minutes will be shown. (That's what happens on my non-PRO site.)

Edit: added MB-trends-inc.php V1.11 to this update test.
« Last Edit: July 05, 2023, 06:42:28 PM by saratogaWX »
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 powerline

  • Member
  • *
  • Posts: 32
    • Oak Ridge North Weather
Re: Help with wxTrends page
« Reply #26 on: July 05, 2023, 06:42:36 PM »
Ken,

Well darn!  The Temp and Dewpoint entries now show for 2 hours ago through 6 hours ago, but they are incorrect for those times.

Have not tried your newest MB-trends-inc.php file yet.
« Last Edit: July 05, 2023, 06:46:14 PM by powerline »
Ron

Davis Vantage Pro2.  Meteobridge Pro
CWOP:  CW2840
WU:  KTXOAKRI1
http://www.oakridgewx.net

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9011
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Help with wxTrends page
« Reply #27 on: July 05, 2023, 07:13:42 PM »
Sigh.  The entries for hour 2-24 displays use the same formulas as the day 2-7 entries and all use -avg@hNN format. They are 'averages'  but maybe what should be displayed is the actual (-val@hN), but the docs say
Quote
val will give same results as average and only makes sense on a per minute base, where data of that minute is reported. It can also be averaged, when more than one sensor reading has occurred during that minute.
so there isn't any difference in past -val or -avg apparently.

If the data is incorrect, then it likely should just be suppressed from display.  I'm kinda at a loss on how to proceed...
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 powerline

  • Member
  • *
  • Posts: 32
    • Oak Ridge North Weather
Re: Help with wxTrends page
« Reply #28 on: July 06, 2023, 01:05:03 PM »
I see what you are saying.  For now, I'll go back to the file versions that gave me the best results.  If you are able to resolve the issue, I'll certainly be willing to test your newest files.   Thank you for your work on this!
Ron

Davis Vantage Pro2.  Meteobridge Pro
CWOP:  CW2840
WU:  KTXOAKRI1
http://www.oakridgewx.net

Offline hymrog

  • Senior Member
  • **
  • Posts: 51
    • Gahanna Weather
Re: Help with wxTrends page
« Reply #29 on: July 06, 2023, 02:03:22 PM »
Hi -

Just ran a quick test with the template th0dew-avg@h2=F.1 (coverts C to F)  and the data appears to be correct.  Although it is an average it would be almost impossible to get the exact temperature from two hours ago unless you are updating your data every minute.  You can test the templates by using this format http://ip-of-meteobridge/cgi-bin/template.cgi?template=[th0dew-avg@h2]

Running the following:

Platform:     Raspberry Pi 3 Model B+ 
RAM:     941 MB total, 777 MB free (17% used)
Storage:     WD SLC, 29.3 GB total, 26.8 GB free (9% used, 1343.8 yrs)
SW Version:    Meteobridge 5.6 (Apr 30 2023, build 2753), FW 1.3



EDIT:  Just ran a test updating the MBtags-template.txt with the following:

wvar   th0dew-avg@h2   dewpoint 2hrs
wvar   th0dew-avg@h4    dewpoint 4hrs
wvar   th0dew-avg@h6    dewpoint 6hrs
wvar   th0dew-avg@h8    dewpoint 8hrs
wvar   th0dew-avg@h12    dewpoint 12hrs

reloaded the template to meteobridge and executed manually and after inspecting the MBtags.php it appears that I have the expected results for my rig:

th0dew-avg@h2|70.8|// dewpoint 2hrs:|:
th0dew-avg@h4|71.7|// dewpoint 4hrs:|:
th0dew-avg@h6|69.1|// dewpoint 6hrs:|:
th0dew-avg@h8|65.4|// dewpoint 8hrs:|:
th0dew-avg@h12|67.0|// dewpoint 12hrs:|:


Not sure if this info will be helpful but I thought I would throw it out there
g

« Last Edit: July 06, 2023, 02:18:30 PM by hymrog »

Offline zmarfak

  • Contributor
  • ***
  • Posts: 132
    • Matar
Re: Help with wxTrends page
« Reply #30 on: July 07, 2023, 12:08:46 PM »
Ken,
this looks like a nice page to me, to present data.
I have a Davis Vantage Pro2 and use Weatherlink to put data on my webpage.
The module on the Vantage is Meteobridge (5.6 build 4555 VOCORE2), however I would like to keep Weatherlink sending the data at the moment.
Can you give any tips to use partially the Meteobridge setup to build the wxtrendspage ?
Or is this to complicated ?
I can use a different subdirectory for the Meteobridge files, but I'm afraid I gonna mix things when using the same variables or overwrite them.
Anyhow your opinion, help is welcome.

Thanks
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9011
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Help with wxTrends page
« Reply #31 on: July 07, 2023, 12:28:54 PM »
The Saratoga templates are currently designed to use one type of weather software at a time, with the entries in Settings-weather.php controlling which weather-software specific software to load for the page (AJAX script, weather tags, realtime file).

If you have the MB plugin files installed on your site along with the WL plugin files, but rename the MB Settings-weather.php to Settings-weather-MB.php, then it would be possible on a page to add
Code: [Select]
$_REQUEST['wx']='MB'; before the include_once("Settings.php"); on that wx...php page and have just that page use Meteobridge for the weather display.  I use that 'hack' for testing the templates with multiple weather software.

Have Meteobridge upload MBtags.php and set up Meteobridge to use the conds.php HTTP upload for the realtime conditions and it should all work without interference with Weatherlink for the rest of the site pages.

Hope this helps...
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 zmarfak

  • Contributor
  • ***
  • Posts: 132
    • Matar
Re: Help with wxTrends page
« Reply #32 on: July 07, 2023, 05:41:54 PM »
Ken,
thank you very much.
This works, see https://www.matar.be/weather/wxtrends.php
The only problem I have is a function I use, it gives:

Deprecated: Function date_sunrise() is deprecated in /var/www/vhosts/matar.be/httpdocs/weather/menubar.php on line 98
Deprecated: Function date_sunset() is deprecated in /var/www/vhosts/matar.be/httpdocs/weather/menubar.php on line 99

Code: [Select]
<?php
$sunoffset 
= (date_offset_get(new DateTime)/3600);
$sunrise date_sunrise(time(), SUNFUNCS_RET_DOUBLE51.074.7096,$sunoffset);
$sunset date_sunset(time(), SUNFUNCS_RET_DOUBLE51.074.7096$sunoffset) ;
$now date("H") + date("i") / 60 date("s") / 3600;

if ((
$now $sunset) || ($now $sunrise))
 print 
"<b>Back at sunrise</b>";
 else 
print 
"<img src=&#39;./cache/wximage.jpg&#39; class=&#39;menub&#39; width=&#39;110&#39; height=&#39;62&#39; alt=&#39;weather_picture&#39; title=&#39;weather_picture&#39; />";  
?>


Very strange, because this error I don't get on other pages eg https://www.matar.be/weather/wxstatus.php

But I learned on https://www.php.net/manual/en/function.date-sunrise that this is deprecated on php  8.1 (I just switched from 8.0 to 8.2).
Guess I have to work out a solution with the new function https://www.php.net/manual/en/function.date-sun-info.php, date_sun_info

Kind regards
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9011
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Help with wxTrends page
« Reply #33 on: July 07, 2023, 11:06:40 PM »
You can try using
Code: [Select]
<?php
  $suninfo 
date_sun_info(time(),$SITE["latitude"],$SITE["longitude"]);
  
$sunup $suninfo["sunrise"];
  
$sundown $suninfo["sunset"];
  
$now time();
 if ((
$now $sunset) || ($now $sunrise))
 print 
"<b>Back at sunrise</b>";
 else 
print 
"<img src=\"./cache/wximage.jpg\" class=\"menub\" width=\"110\" height=\"62\" alt=\"weather_picture\" title=\"weather_picture\" />";  
?>

instead.
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 zmarfak

  • Contributor
  • ***
  • Posts: 132
    • Matar
Re: Help with wxTrends page
« Reply #34 on: July 08, 2023, 02:02:46 AM »
Ken,
thanks for the code.
I took the "civil_twilight_begin" and "civil_twilight_end" values of the array, because at that time there is enough light to have a picture.

Kind regards
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Offline zmarfak

  • Contributor
  • ***
  • Posts: 132
    • Matar
Re: Help with wxTrends page
« Reply #35 on: July 08, 2023, 11:42:32 AM »
Hi Ken,
I just noticed this in the results : please see attachments
I's about the rain, it's very dry here   :-), no rain

Any idea what I can do about it ?
Thanks
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Offline hymrog

  • Senior Member
  • **
  • Posts: 51
    • Gahanna Weather
Re: Help with wxTrends page
« Reply #36 on: July 08, 2023, 01:26:46 PM »
Hello

If the data is incorrect on your meteobridge I believe you can simply delete the errant data (read the meteobridge docs to see the procedure) However, I took a look at your NOOA reports and the yearly precip matches your meteobridge data.

PRECIPITATION (mm)

               DEP.   MAX        DAYS OF RAIN
               FROM   OBS.          OVER
 YR MO  TOTAL  NORM   DAY  DATE  .2   2   20
---------------------------------------------
 23  1  94.2   18.1  20.4   12   27   12    1
 23  2  13.0  -50.1   2.8    4   14    3    0
 23  3 102.4   32.4  13.0    7   24   13    0
 23  4  55.8    4.5  15.4   12   15    8    0
 23  5  41.8  -24.7  18.8    9    8    5    0
 23  6  30.8  -41.0  15.4   22    8    2    0
 23  7  19.4  -54.1  14.6    5    3    2    0
 23  8
 23  9
 23 10
 23 11
 23 12
---------------------------------------------
       357.3-115.0  20.4  JAN   99   45    1

Offline zmarfak

  • Contributor
  • ***
  • Posts: 132
    • Matar
Re: Help with wxTrends page
« Reply #37 on: July 08, 2023, 04:26:00 PM »
Hi,
thank you for your comment.
Maybe it's a misunderstanding of me.
I don't bring in discussion the value of 357.
I just thought that the value must be the rain in mm at that moment ? That is the way I look at the figures.
It's the first time I use that trendpage.
When I look at 5 min or 10 min,.. in the past I expect in the rain column the rain at that moment, like the temp.
But maybe that is how it's not done on the trend page ?

Kind regards.
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Offline hymrog

  • Senior Member
  • **
  • Posts: 51
    • Gahanna Weather
Re: Help with wxTrends page
« Reply #38 on: July 08, 2023, 05:17:43 PM »
Hi -

I understand now.  Sorry for the confusion.  Looked at your MBtags-template.txt page and it looks like you might be using the incorrect template to get your values:
Code: [Select]
wvar rain0total-act rain most recent
wvar rain0total-val5 rain value 5 minutes ago
wvar rain0total-val10 rain value 10 minutes ago
wvar rain0total-val15 rain value 15 minutes ago
wvar rain0total-val30 rain value 30 minutes ago
wvar rain0total-val60 rain value 60 minutes ago

You should be using the following template:
Code: [Select]
wvar rain0total-daysum rain most recent
wvar rain0total-sum5         rain value 5 minutes ago
wvar rain0total-sum10 rain value 10 minutes ago
wvar rain0total-sum15 rain value 15 minutes ago
wvar rain0total-sum30 rain value 30 minutes ago
wvar rain0total-sum60 rain value 60 minutes ago


In addition to making the changes to your MBtags-template.txt file I am assuming you will also need to make the necessary changes to your MB-defs.php file and your MB-trends-inc.php file as well.



As an FYI, you can run a quick test of the templates in your browser by entering the following in your search bar:

http://ip-of-meteobridge/cgi-bin/template.cgi?template=[rain0total-sum60] to confirm it returns the correct value, in your case it should read zero.

Hope this helps.

g

Offline zmarfak

  • Contributor
  • ***
  • Posts: 132
    • Matar
Re: Help with wxTrends page
« Reply #39 on: July 08, 2023, 06:15:25 PM »
Hi  hymrog,
thanks for the explanation , I will work on it after a good night sleep !

Kind regards
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Offline ed_heaton

  • Contributor
  • ***
  • Posts: 147
    • Atglen Borough Weather Observatory
Re: Help with wxTrends page
« Reply #40 on: September 01, 2023, 07:09:36 AM »
Good morning All,
I would greatly appreciate some help adding the 24 hour difference to my home page. I tried loading the the Jun 20th update but that gave me an incorrect value since I'm running a non-Pro meteobridge.  I did add Ken's adjusted files which seems to fix a lot of the incorrect trend values but the 24 hr difference didn't show up. I see that it is working on Ken's site and I think he said he's running a non-pro MB too.

Thanks in advance...

Offline hymrog

  • Senior Member
  • **
  • Posts: 51
    • Gahanna Weather
Re: Help with wxTrends page
« Reply #41 on: September 01, 2023, 09:19:40 AM »
Hi -

What platform are you using for the Meteobridge?  Is it the TL-MR3020 or a version running on an RPi?

g

Offline ed_heaton

  • Contributor
  • ***
  • Posts: 147
    • Atglen Borough Weather Observatory
Re: Help with wxTrends page
« Reply #42 on: September 01, 2023, 09:53:16 AM »
Good morning G,
I'm using the TL-MR3020...

Offline hymrog

  • Senior Member
  • **
  • Posts: 51
    • Gahanna Weather
Re: Help with wxTrends page
« Reply #43 on: September 03, 2023, 09:55:57 AM »
Hi

You should be able to use the template [th0temp-delta24h].  It is not the exact difference 24 hours ago to the minute but appears to use the average temp for that particular 24 hour period for the look back when reporting the difference. 

g

Offline ed_heaton

  • Contributor
  • ***
  • Posts: 147
    • Atglen Borough Weather Observatory
Re: Help with wxTrends page
« Reply #44 on: September 03, 2023, 12:05:42 PM »
Thank you g...  My apologies for being such a newb but I'm not sure if I need to add this somewhere or download it?  Sorry for being slow :-(

Offline K7RMK

  • Senior Member
  • **
  • Posts: 51
Re: Help with wxTrends page
« Reply #45 on: September 18, 2023, 02:57:33 PM »
I don't know if this has been discovered or talked about, but the delta outputs from Meteobridge when using Fahrenheit is wrong. Delta is the difference between two numbers. But when you send a command like th0temp-delta24h=F.1 to Meteobridge, you get a value 32 higher than it should be.

I suspect Meteobridge is converting to Fahrenheit after computing the delta in Celsius by using the standard ( C * 1.8 ) + 32 = F formula. But the +32 part needs to be omitted.
Ecowitt GW1000 + WeatherBridge (Meteobridge) WU: KWAYACOL47
Ecowitt HP2551-C Display Console
Ecowitt WH32-EP Outdoor Temp/Humidity Sensor + MeteoShield Professional Radiation Shield
Ecowitt WS68 Anemometer
Ecowitt WH40 Rain Gauge
Ecowitt WH57 Lightning Sensor
Ecowitt WH31 x4 Temp/Humidity Sensors
Ecowitt WH51 x2 Soil Moisture Sensors
Ecowitt WH41 Outdoor PM2.5 Air Quality Sensor
Ecowitt WH43 Indoor PM2.5 Air Quality Sensor

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9011
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Help with wxTrends page
« Reply #46 on: September 18, 2023, 05:18:09 PM »
You could try th0temp-delta24h=F.1-32 to remove the 32 degree bias in the C->F conversion for the delta.
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

 

anything