Author Topic: Adding stats to website  (Read 6321 times)

Alan Rowley

  • Strong Breeze
  • ***
  • Posts: 150
  • It is far better to wear out than to rust away.
    • D3696
    • INOTTING15
    • Selston Weather
  • Station Details: Weather station: Davis Vantage Pro2. Software: WeatherCat. Computer: Mac Mini, High Sierra OS
Re: Adding stats to website
« Reply #15 on: August 04, 2015, 11:16:24 AM »
Thanks guys for pointing me in the right direction. I've now got dozens of stats on my site - in fact, it's looking stat-tastic.

Click on my site and look under 'WeatherCat Stats'. If you spot anything that doesn't look right, please let me know.

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: Adding stats to website
« Reply #16 on: August 04, 2015, 01:50:24 PM »
Ahhh. WDTEXT$ is defined as "current", so you'd need to find a different tag. Not sure there is one...
If you find it, you be able to combine two STAT$ 'commands'. You already have the correct (I assume) degree. So adding "STAT$WINDDIRECTION:SomeTimeFrame:TheHistoricalDirectionTag" should work. I gotta eat some breakfast! ;)
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


Alan Rowley

  • Strong Breeze
  • ***
  • Posts: 150
  • It is far better to wear out than to rust away.
    • D3696
    • INOTTING15
    • Selston Weather
  • Station Details: Weather station: Davis Vantage Pro2. Software: WeatherCat. Computer: Mac Mini, High Sierra OS
Re: Adding stats to website
« Reply #17 on: August 04, 2015, 02:00:51 PM »
The current wind direction is correct, it's the 24 hours ago direction that generates a syntax error.

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: Adding stats to website
« Reply #18 on: August 04, 2015, 03:18:17 PM »
Uhmmm... I don't see any "syntax error" on the linked page. I assume(!) you mean one of the outputs is incorrect. Just to be clear, which "direction" is incorrect? The 'degrees' or the 'cardinal, textual' output (W, N, ENE, etc.)?

BTW, your site is looking great! [tup]
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


Alan Rowley

  • Strong Breeze
  • ***
  • Posts: 150
  • It is far better to wear out than to rust away.
    • D3696
    • INOTTING15
    • Selston Weather
  • Station Details: Weather station: Davis Vantage Pro2. Software: WeatherCat. Computer: Mac Mini, High Sierra OS
Re: Adding stats to website
« Reply #19 on: August 04, 2015, 03:28:58 PM »
At the moment, the 'yesterday' direction is correct, because the wind is blowing from the same direction as it was 24 hours ago, but the tag is actually the CURRENT wind direction not the 24HRSAGO tag. The 'yesterday' direction will always show the current direction.

I need something like (WDTEXT:24HRSAGO$) but I can't work out the correct format.

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: Adding stats to website
« Reply #20 on: August 04, 2015, 03:53:25 PM »
I agree, there doesn't seem to be a "windTEXT$" tag for anything other than "current". Probably because it isn't stored in the database.

It shouldn't be terribly hard to write a script that would convert the degree value into as many 'cardinal' directions as you want. You can insert a php script right in the middle of a line html. I think there are generally only 16 choices. Mainly a math problem and/or a bunch of case (15) statements. ;)
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


Alan Rowley

  • Strong Breeze
  • ***
  • Posts: 150
  • It is far better to wear out than to rust away.
    • D3696
    • INOTTING15
    • Selston Weather
  • Station Details: Weather station: Davis Vantage Pro2. Software: WeatherCat. Computer: Mac Mini, High Sierra OS
Re: Adding stats to website
« Reply #21 on: August 04, 2015, 03:56:32 PM »
I'm not an expert in php. Maybe some nice coder could help me out. Hint, hint ...

wvdkuil

  • Strong Breeze
  • ***
  • Posts: 151
    • DW8113 (D8113)
    • IVLAAMSG47
    • Weatherstation Wilsele/Leuven/Belgium
  • Station Details: VantagePro2+ UV,Solar - Macbook/Mini
Re: Adding stats to website
« Reply #22 on: August 04, 2015, 04:23:08 PM »
I'm not an expert in php. Maybe some nice coder could help me out. Hint, hint ...
Most functions are in wsFunctions.php
So try this after you put the field-name of the winddirection where it now reads $degrees.
Code: [Select]
<?php echo  wsConvertWinddir ($degrees); ?>
Support of Leuven-Template&Scripts: https://support.leuven-template.eu/
Support and demo for the PWS_Dashboard (also for WeatherCat)  https://pwsdashboard.com/ 
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: Adding stats to website
« Reply #23 on: August 04, 2015, 04:27:50 PM »
wvdkuil = Not only "nice" but fast! [tup]
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


Alan Rowley

  • Strong Breeze
  • ***
  • Posts: 150
  • It is far better to wear out than to rust away.
    • D3696
    • INOTTING15
    • Selston Weather
  • Station Details: Weather station: Davis Vantage Pro2. Software: WeatherCat. Computer: Mac Mini, High Sierra OS
Re: Adding stats to website
« Reply #24 on: August 04, 2015, 04:53:34 PM »
Fast, but much too fast for me. I did say I wasn't good with php. This is what I have for that line ...

Quote
<td>STAT$WINDDIRECTION:24HRSAGO$&deg; <?php echo  wsConvertWinddir ($degrees); ?></td>

The output I get is ...

Quote
252?
Notice: Undefined variable: degrees in /home/alanrowley3/public_html/weather27/uploadWC/wcs_recent.php on line 258
---

The 252?  is correct, but it seems that I need to declare the variable 'degrees' somewhere.

Help - ALAN

wvdkuil

  • Strong Breeze
  • ***
  • Posts: 151
    • DW8113 (D8113)
    • IVLAAMSG47
    • Weatherstation Wilsele/Leuven/Belgium
  • Station Details: VantagePro2+ UV,Solar - Macbook/Mini
Re: Adding stats to website
« Reply #25 on: August 04, 2015, 05:12:38 PM »
Fast, but much too fast for me. I did say I wasn't good with php. This is what I have for that line ...

Quote
<td>STAT$WINDDIRECTION:24HRSAGO$&deg; <?php echo  wsConvertWinddir ($degrees); ?></td>

The output I get is ...

Quote
252?
Notice: Undefined variable: degrees in /home/alanrowley3/public_html/weather27/uploadWC/wcs_recent.php on line 258
---

The 252?  is correct, but it seems that I need to declare the variable 'degrees' somewhere.

Help - ALAN

Code: [Select]
<td>STAT$WINDDIRECTION:24HRSAGO$&deg; <?php echo  wsConvertWinddir (STAT$WINDDIRECTION:24HRSAGO$); ?></td>If you want both degrees and cardinal in the same <td> and if the file is processed by WC and uploaded.
The uploaded file would look like:
 
Code: [Select]
<td>180&deg; <?php echo  wsConvertWinddir (180); ?></td>Wim
Support of Leuven-Template&Scripts: https://support.leuven-template.eu/
Support and demo for the PWS_Dashboard (also for WeatherCat)  https://pwsdashboard.com/ 
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Alan Rowley

  • Strong Breeze
  • ***
  • Posts: 150
  • It is far better to wear out than to rust away.
    • D3696
    • INOTTING15
    • Selston Weather
  • Station Details: Weather station: Davis Vantage Pro2. Software: WeatherCat. Computer: Mac Mini, High Sierra OS
Re: Adding stats to website
« Reply #26 on: August 04, 2015, 05:35:10 PM »
Works a treat, Wim. I've added the code to the 'average wind direction' table on the same page and it's looking great.

Thanks yet again.

ALAN.