Author Topic: Storm Rain Rate on VP2  (Read 1639 times)

0 Members and 1 Guest are viewing this topic.

Offline DW7240

  • Senior Contributor
  • ****
  • Posts: 214
    • The Vicarage Weather Feed
Storm Rain Rate on VP2
« on: January 11, 2017, 02:27:36 PM »
Hi,

Can someone tell me if the "Storm Rain" was ever implemented on the Ajax Dashboard, I'm asking because I have never seen it showing any figure on my dashboard, when checking the Ajax dashboard php file it quotes "Storm Rain is a Davis VP thing" and it never shows.

After a closing of a descent rain event last evening my VP2 console shows 15.4 mm as a Storm Rate, but that never gets to display on the Dashboard, I would expect a "00 mm" on the dashboard at all times, but even that never shows, unlike the "Rain rate /hr" which does show "00 mm" until rain falls, not sure what's going on.

Any advice would be warmly welcomed........Thanks.

Nick. dw7240.com
« Last Edit: January 11, 2017, 02:33:50 PM by DW7240 »


Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5299
    • KomokaWeather
Re: Storm Rain Rate on VP2
« Reply #1 on: January 11, 2017, 03:36:30 PM »

My storm rain is displayed http://www.komokaweather.ca/


But that could be because of an additional plugin by BCJKiwi that I have.


Enjoy,
Paul
Davis Vantage Pro 2 Plus 24-FARS Wireless - Komoka, ON Canada
Envoy/USB Logger/Cumulus v1.9.4  www.komokaweather.com  
WFL/CMX www.komokaweather.com/komokaweather-ca2/index.php
WLL/CMX www.komokaweather.com/cumulusmxwll/index.htm
WLL/CMX www.komokaweather.com/cumulusmxwll/index.html
WLL/CMX www.komokaweather.com/cumulusmxwll/index.php
Blitzortung Station #1076


Offline DW7240

  • Senior Contributor
  • ****
  • Posts: 214
    • The Vicarage Weather Feed
Re: Storm Rain Rate on VP2
« Reply #2 on: January 11, 2017, 04:28:47 PM »
Hi Paul,

I was wondering how that plug-in works, considering BCJKiwi doesn't use it, I'm sure others would be interested in it, also interesting that your storm rate appears the same as your total rainfall,  you got the same storm as me, but my totals are close - Storm Rain = 15.4mm, Total Rain = 14.4mm.

Thanks for the reply Paul.

Nick. dw7240.com
 


Offline BCJKiwi

  • Forecaster
  • *****
  • Posts: 302
    • Silver Acorn Weather - N.Z.
Re: Storm Rain Rate on VP2
« Reply #3 on: January 12, 2017, 02:46:16 PM »
No plugin required.
I do display storm rain but only when there is storm rain.
In ajaxdashboard;
               <?php if (isset($vpstormrain) && $vpstormrain > 0) { // Storm Rain is a Davis VP thing ?>

The standard code is;
        <?php if (isset($vpstormrain)) { // Storm Rain is a Davis VP thing ?>
               <tr>
                <td class="data1" nowrap="nowrap"><?php langtrans('Storm Rain'); ?>: </td>
                <td style="text-align: right;" class="data1">
                  <?php echo strip_units($vpstormrain).$uomRain; ?>
                </td>
              </tr>
        <?php } // end of DavisVP specific variable ?>

So what is actually required is to ensure that these items are included in Cumulus and are processed and sent to Saratoga and then processed by Saratoga into the variables used.

Add to the CUtags template that is processed by Cumulus
(Ken specifies this as CUtagsT.htm but it can be anything in the C:\Cumulus\web folder and processed and sent to the webserver as CUtags.php.)
Code: [Select]
vpstormrain|<#StormRain>:|:
vpstormrainstart|<#StormRainStart>:|:
CU-defs then processes it into php $vars
so you need to add these to CU-defs.php;
Code: [Select]
$vpstormrainstart = $WX['vpstormrainstart'];  //Davis VP Storm rain start date
$vpstormrain = $WX['vpstormrain']; //Davis VP Storm rain value
!!!!! These original details incorrect !!!!!
Add to the CUtags template that is processed by Cumulus;
$StormRain = '<#StormRain>';
$StormRainStart = '<#StormRainStart>';
$vpstormrain = '<#StormRain>';
$vpstormrainstart = '<#StormRainStart>';

add to CU-defs;
$vpstormrainstart = $WX['vpstormrainstart'];  //Davis VP Storm rain start date
$vpstormrain = $WX['vpstormrain']; //Davis VP Storm rain value
« Last Edit: January 13, 2017, 03:30:32 PM by BCJKiwi »

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5299
    • KomokaWeather
Re: Storm Rain Rate on VP2
« Reply #4 on: January 12, 2017, 03:07:32 PM »

Thanks for the clarification as I had forgotten the details of some of that work that you had done after Cumulus added storm rain in April 2014.


Enjoy,
Paul
Davis Vantage Pro 2 Plus 24-FARS Wireless - Komoka, ON Canada
Envoy/USB Logger/Cumulus v1.9.4  www.komokaweather.com  
WFL/CMX www.komokaweather.com/komokaweather-ca2/index.php
WLL/CMX www.komokaweather.com/cumulusmxwll/index.htm
WLL/CMX www.komokaweather.com/cumulusmxwll/index.html
WLL/CMX www.komokaweather.com/cumulusmxwll/index.php
Blitzortung Station #1076


Offline DW7240

  • Senior Contributor
  • ****
  • Posts: 214
    • The Vicarage Weather Feed
Re: Storm Rain Rate on VP2
« Reply #5 on: January 13, 2017, 09:02:45 AM »
Hi,

After unsuccessfully trying to do the above, it seems not that simple to achieve the correct result, the CUdefs complained about some syntax error, and my whole site went down !!  So deleted that and uploaded original version, now site is back up, yay !!

Also, where in CUtags does the additional script go, dumb question - but there is no other entries that start with the $ sign ?, and I'm assuming it's added to the CUtags.txt file, then converted by Cumulus into the php version.

Please can you make it a little clearer, I haven't had my morning coffee !!

Further forward, my site isn't updating since the file changes, even though I replaced the files, Cumulus weather data is not correct and shows last nights time and date.

OK, now site is back to working correctly, now just need to sort out this Storm rain, lol.  Now realise, and I think this has happened before -  BE CAREFUL WHEN EDITING THE CUTAGS FILE, have to laugh, can be fun - but can be a pain also !!


Hmm, further looking into this, should the following....

$StormRain = '<#StormRain>';
$StormRainStart = '<#StormRainStart>';
$vpstormrain = '<#StormRain>';
$vpstormrainstart = '<#StormRainStart>';

go in to the "cumuluswebtags.txt" ? which is then processed by Cumulus into "cumuluswebtags. php".


Thank you for your assistance.

Nick. dw7240.com
« Last Edit: January 13, 2017, 10:43:27 AM by DW7240 »


Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5299
    • KomokaWeather
Re: Storm Rain Rate on VP2
« Reply #6 on: January 13, 2017, 11:00:45 AM »
Hi Nick,
Brian will be better at explaining, but in my ajax-dashboard.php immediately after
Code: [Select]
<?php // end $yesterdayrain ?>I have
Code: [Select]
              <?php if (isset($vpstormrain) && $vpstormrain 0) { // Storm Rain is a Davis VP thing ?>
               <tr>
                <td class="data1" nowrap="nowrap"><?php langtrans('Storm Rain'); ?>: </td>
                <td style="text-align: right;" class="data1">
                  <?php echo strip_units($vpstormrain).$uomRain?>
                </td>
              </tr>
              <?php // end of DavisVP specific variable ?>

In CUtagsT.txt I have
Code: [Select]
StormRain|<#StormRain>:|:
StormRainStart|<#StormRainStart>:|:
vpstormrainstart|<#StormRainStart>:|:
vpstormrain|<#StormRain>:|:

In CU-defs.php
Code: [Select]
$vpstormrainstart = $WX['vpstormrainstart'];  //Davis VP Storm rain start date // added by BCJKiwi
$vpstormrain = $WX['vpstormrain']; //Davis VP Storm rain value // added by BCJKiwi

Hopefully I haven't missed something...

Enjoy,
Paul

Davis Vantage Pro 2 Plus 24-FARS Wireless - Komoka, ON Canada
Envoy/USB Logger/Cumulus v1.9.4  www.komokaweather.com  
WFL/CMX www.komokaweather.com/komokaweather-ca2/index.php
WLL/CMX www.komokaweather.com/cumulusmxwll/index.htm
WLL/CMX www.komokaweather.com/cumulusmxwll/index.html
WLL/CMX www.komokaweather.com/cumulusmxwll/index.php
Blitzortung Station #1076


Offline DW7240

  • Senior Contributor
  • ****
  • Posts: 214
    • The Vicarage Weather Feed
Re: Storm Rain Rate on VP2
« Reply #7 on: January 13, 2017, 11:12:05 AM »
Hi Paul,

Thank you for replying.....very interesting.....I don't use the CUtagsT file, at least not uploaded by CumulusMX, I have CUtags.txt which is uploaded as CUtags.php by CumulusMX, then I have cumuluswebtags.txt which is uploaded as cumuluswebtags.php by CumulusMX, along with the normal files realtime.txt etc etc.

I think the original CUtagsT.txt file was replaced by cumuluswebtags.txt, but I could be wrong, a lot of updates and changes in the last three years, so I'm not 100% sure. Will wait for BCJKiwi or Brian to chip in with clarification.

Thanks again Paul.

Nick. dw7240.com


Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5299
    • KomokaWeather
Re: Storm Rain Rate on VP2
« Reply #8 on: January 13, 2017, 11:40:00 AM »
Hi Nick,
I think CUtags.txt or CUtagsT.txt (the T version is most commonly used to identify as a "Template" , whether by Cumulus 1 or Cumulus MX, is processed and should be uploaded as CUtags.php for the Saratoga template.

I don't use CumulusMX full time but don't think anything has changed as far as Saratoga website CU-plugin uploads between Cumulus 1 and CumulusMX.  The only thing different in MX webtags is some of the date formatting code.

Enjoy,
Paul

Davis Vantage Pro 2 Plus 24-FARS Wireless - Komoka, ON Canada
Envoy/USB Logger/Cumulus v1.9.4  www.komokaweather.com  
WFL/CMX www.komokaweather.com/komokaweather-ca2/index.php
WLL/CMX www.komokaweather.com/cumulusmxwll/index.htm
WLL/CMX www.komokaweather.com/cumulusmxwll/index.html
WLL/CMX www.komokaweather.com/cumulusmxwll/index.php
Blitzortung Station #1076


Offline DW7240

  • Senior Contributor
  • ****
  • Posts: 214
    • The Vicarage Weather Feed
Re: Storm Rain Rate on VP2
« Reply #9 on: January 13, 2017, 02:39:43 PM »
Further examination...........

Adding those two extra lines in CU-defs.php causes the site to not load, just a white screen, no errors.

Adding the small script to ajaxdashboard.php in place of what's already there causes the script to stop past the ec radar image, meaning nothing else on the page, no footer, nothing.

Now I'm stuck - not changing nothing now, everything back to as it were, waiting further communications lol !!.

Nick. dw7240.com


Offline BCJKiwi

  • Forecaster
  • *****
  • Posts: 302
    • Silver Acorn Weather - N.Z.
Re: Storm Rain Rate on VP2
« Reply #10 on: January 13, 2017, 03:14:57 PM »
Hi,

Mea Culpa!!!
Provided the wrong info  :oops:
I use a different version of the CUtags file for my other non-Saratoga templates which directly generates the php $vars.
I inadvertently provided the wrong snippets.

For Saratoga:-
Add to the CUtags template that is processed by Cumulus
(Ken specifies this as CUtagsT.htm but it can be anything in the C:\Cumulus\web folder and processed and sent to the webserver as CUtags.php.)
Code: [Select]
vpstormrain|<#StormRain>:|:
vpstormrainstart|<#StormRainStart>:|:

CU-defs then processes it into php $vars
so you need to add these to CU-defs.php;
Code: [Select]
$vpstormrainstart = $WX['vpstormrainstart'];  //Davis VP Storm rain start date
$vpstormrain = $WX['vpstormrain']; //Davis VP Storm rain value
If you check back into the original release Cumulus Plugin from Ken, the CU-plugin folder you get when the CU-plugin.zip file is expanded contains;
CU-defs.php
CUtags.php
gen-CUtags.php

If you check those files they describe the process in detail.

Provided you have
ListWebTags=1
in the [Station] section of C:\cumulus\cumulus.ini (or wherever your Cumulus is running from)
Cumulus will generate a file C:\cumulus\WebTags.txt which contains a complete list of all the tags.
If ListWebTags=1 is not In Ccumulus.ini, stop Cumulus,  edit cumulus.ini, restart Cumulus and you should see WebTags.txt which is generated whenever Cumulus is restarted.
You may then use this info to add any additional tag you wish to the Saratoga template.
« Last Edit: January 13, 2017, 03:35:48 PM by BCJKiwi »

Offline DW7240

  • Senior Contributor
  • ****
  • Posts: 214
    • The Vicarage Weather Feed
Re: Storm Rain Rate on VP2
« Reply #11 on: January 13, 2017, 05:31:47 PM »
Hi,

So, everything done according to instructions, thank you BCJKiwi, the problem seems to lay with the CU-defs.php file, every time I include those two lines, the scripts stops everything - white screen - no errors, but interestingly I also have the Cumulus Banner script - http://dw7240.com/Base-Canada/banner.php running, when I try to load that it gives an error....

Parse error: syntax error, unexpected T_VARIABLE in /home/content/64/11561464/html/Base-Canada/CU-defs.php on line 293

On uploading the original CU-defs.php without the mentioned lines main website works fine, also banners works fine.

I have attached the file for your viewing.

Thanks again,

Nick. dw7240.com.
« Last Edit: January 13, 2017, 05:42:38 PM by DW7240 »


Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5299
    • KomokaWeather
Re: Storm Rain Rate on VP2
« Reply #12 on: January 13, 2017, 07:07:26 PM »
Hi Nick,
That link to your banner comes up ok for me.

I had a look at your attached CU-defs and compared to mine and there are quite a number of differences.  Likely from some additional scripts I have added over time.  I know very little code but great at cut and paste and pretty good at following instructions, and sorry, in this case I will have to leave it to Brian to give further suggestions.

Enjoy,
Paul
Davis Vantage Pro 2 Plus 24-FARS Wireless - Komoka, ON Canada
Envoy/USB Logger/Cumulus v1.9.4  www.komokaweather.com  
WFL/CMX www.komokaweather.com/komokaweather-ca2/index.php
WLL/CMX www.komokaweather.com/cumulusmxwll/index.htm
WLL/CMX www.komokaweather.com/cumulusmxwll/index.html
WLL/CMX www.komokaweather.com/cumulusmxwll/index.php
Blitzortung Station #1076


Offline DW7240

  • Senior Contributor
  • ****
  • Posts: 214
    • The Vicarage Weather Feed
Re: Storm Rain Rate on VP2
« Reply #13 on: January 13, 2017, 07:30:09 PM »
Hey Paul,

No need for apologies, you have been a great help, as you have in the past ! Thanks again for your time.  If I can't get the storm rain to work, then you know what, it's not the end of the world, but again it's the only feature that doesn't work, maybe Ken or Steve from Cumulus may chime in with something additional.

Like you I'm not a stupid person either, I usually go all out to make things work before asking for help, after all, that's how we all learn and keep our sites healthy.

Thanks again.

Nick. dw7240.com.


Offline BCJKiwi

  • Forecaster
  • *****
  • Posts: 302
    • Silver Acorn Weather - N.Z.
Re: Storm Rain Rate on VP2
« Reply #14 on: January 14, 2017, 04:47:35 PM »
OK, think I have found the problem.

I loaded the file you attached in notepad++.
Then copied/pasted your two lines replacing the same lines in my file.
The website bombed.

Then did a detailed compare with all characters displayed and found an odd blank here
Code: [Select]
$WX['vpstormrainstart'];  //Davis VP Storm rain start dateimmediately after the ;  ](*,)

Deleted that and everything worked.
So suggest you edit out the spaces and put one back, or, re-enter the whole line manually.

Trust this will sort the issue  ;)
 

Offline DW7240

  • Senior Contributor
  • ****
  • Posts: 214
    • The Vicarage Weather Feed
Re: Storm Rain Rate on VP2
« Reply #15 on: January 14, 2017, 06:57:20 PM »
Hi Brian,

Humble apologies, I should of spotted that, you were correct  =D&gt;, as soon as I removed the extra space the CUdef's loaded as normal, I added an "=" with the > sign in the Ajax Dashboard so that Storm Rain displays all the time with the "0.0mm" just to show with other varibles, "Rain Today, Rain Rate" etc etc.  Now I just have to wait for the next shower or two to see it work.

Thank you so much for that, that extra work you could of done without, so much for the obvious and I failed to see it !!

Thanks again Brian.  :grin: :grin:

Nick. dw7240.com


Offline BCJKiwi

  • Forecaster
  • *****
  • Posts: 302
    • Silver Acorn Weather - N.Z.
Re: Storm Rain Rate on VP2
« Reply #16 on: January 14, 2017, 08:59:04 PM »
Happy to help.

The offending character was not actually an extra space but a hex c2 or capital A with circumflex accent.
The CU-defs.php file has a header("Content-type: text/plain"); which means just the basic 128 ASCII character set http://www.w3schools.com/charsets/ref_html_ascii.asp which does NOT include accented characters.

 

anything