Author Topic: Weather34 template  (Read 1488 times)

saratogaWX

  • Strong Breeze
  • ***
  • Posts: 135
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
Re: Weather34 template
« Reply #15 on: February 11, 2019, 06:22:05 PM »
I used the new txt file and no changes at all.
So I tested using F instead of C, that did capture the temperatures, but
completely mucked up the Barometric pressures and UV/Solar, Rainfall and Temperatures Max/Min.
So, I will sit back and see if there is another fix from WouterK who is the original creator of the text file.

Many thanks for your kind effort! [cheers1]

It really requires two changes.  One to WCT_Realtime.txt (for TEMPUNITS$) and one to livedata.php (to handle the WeatherCat format and remove the UTF-8 degree sign before the C or F.  I've amended the posting above with both fixes.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

jennajon

  • Gentle Breeze
  • **
  • Posts: 71
    • FW2882
    • Hallbrook Estates Personal Weather Station
  • Station Details: Davis Vantage Pro2 Plus With FARS, Solar and UV sensors, MAC 27 in. Retina, WeatherCat vers. 3.04 build 91
Re: Weather34 template
« Reply #16 on: February 11, 2019, 06:47:16 PM »
 [woohoo] [woohoo]

ITS ALIVE!!!! AND WORKING!!!!

You Sir, are the best ever. Many thanks for your help... [headbang]

Jenna

wurzelmac

  • Storm
  • *****
  • Posts: 1208
    • ITIROLPR2
    • Wetterstation Prägraten am Großvenediger
  • Station Details: Davis Vantage PRO2 Plus (24h fan aspirated, wireless) with UV/Solar | Weather Envoy Data Logger | Mac mini Mid 2011 2,7 GHz Intel Core i7 with 12 GB of RAM | 2x Canon EOS 1100D | macOS 10.13.6 HighSierra
Re: Weather34 template
« Reply #17 on: February 12, 2019, 08:39:27 PM »
So, ....

I tried it - I liked it - and finally I used it.

Another nice addition for the live areas of my weathersite. Thanks to all people making this possible.

Cheers,
Reinhard


Tman

  • Calm
  • *
  • Posts: 6
    • DW2819
    • IETELSUO12
  • Station Details: Davis Vantage Pro2
Re: Weather34 template
« Reply #18 on: February 12, 2019, 08:40:34 PM »
I changed WCT_realtime and livedata.php as advised but still same issue remains. In WCT_realtime temperature is correct but wrongly displayed. Files/snapshot appended. Wonder what am I missing here...

Thanks.

https://veikkola-weather.com/weather34/

-Timo

wurzelmac

  • Storm
  • *****
  • Posts: 1208
    • ITIROLPR2
    • Wetterstation Prägraten am Großvenediger
  • Station Details: Davis Vantage PRO2 Plus (24h fan aspirated, wireless) with UV/Solar | Weather Envoy Data Logger | Mac mini Mid 2011 2,7 GHz Intel Core i7 with 12 GB of RAM | 2x Canon EOS 1100D | macOS 10.13.6 HighSierra
Re: Weather34 template
« Reply #19 on: February 12, 2019, 08:47:21 PM »
I changed WCT_realtime and livedata.php as advised but still same issue remains. In WCT_realtime temperature is correct but wrongly displayed. Files/snapshot appended. Wonder what am I missing here...

I am experiencing the same issue. Temp after comma is not displayed correctly.
Reinhard


saratogaWX

  • Strong Breeze
  • ***
  • Posts: 135
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
Re: Weather34 template
« Reply #20 on: February 12, 2019, 08:53:07 PM »
It appears that your WCT_Realtime.txt is using comma-decimal and not period-decimal numbers.

Code: [Select]
12/02/19 22:45:37 -4,7 92 -5,8 0,0 0 331 0,0 0,0 1011,5 331 0 m/s °C hPa mm 102435,00 0,4 52,8 119,8 3,2 21,2 33 -4,7 -1,4 0,7 01:00 -4,8 22:45 2,68 11:12 8 04:46 1011,5 22:41 994,9 00:02 0 0 1 -4,7 -8.1 0,0 0 0 331 0,0 0 0 0 331 134 Metres -7.4 0 0 0
When Brian (weather34) built the template, I don't think he anticipated comma-decimal formats in the raw-data files, so the livedata.php script doesn't currently handle that.  Some of the displays just use the values in the realtime file .. others are processed by PHP and/or JavaScript to do calculations, and AFAIK, the default is to process numbers only with period-decimal notation.

I'll have to look at the scripts to see if there's an easy fix to allow comma-decimal notation to be used throughout the HWS.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Tman

  • Calm
  • *
  • Posts: 6
    • DW2819
    • IETELSUO12
  • Station Details: Davis Vantage Pro2
Re: Weather34 template
« Reply #21 on: February 12, 2019, 08:58:16 PM »
ooo, Finnish number notation with comma. I'll check fast easy fix with Mac terminal.

Thanks !

EDIT: solved, changed terminal separator from , to .

-Timo

PS. I'll provide Finnish translation a bit later, being translated.

saratogaWX

  • Strong Breeze
  • ***
  • Posts: 135
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
Re: Weather34 template
« Reply #22 on: February 12, 2019, 09:13:48 PM »
I have a fix I'd like you to try to livedata.php

Change
Code: [Select]
if (
($livedataFormat == 'cumulus' ||
$livedataFormat == 'meteobridge' ||
$livedataFormat == 'weewx' ||
$livedataFormat == 'weathercat') && $livedata) {
$file_live = file_get_contents($livedata);
$cumulus = explode(" ", $file_live);
to
Code: [Select]
if (
($livedataFormat == 'cumulus' ||
$livedataFormat == 'meteobridge' ||
$livedataFormat == 'weewx' ||
$livedataFormat == 'weathercat') && $livedata) {
$file_live = file_get_contents($livedata);
if(preg_match('| \d+,\d+ |',$file_live) ) {
// found decimal commas.. replace with decimal periods for math
$file_live = preg_replace('| ([-\+\d]+),(\d+)|is'," $1.$2",$file_live);
}
$cumulus = explode(" ", $file_live);
This is just a cheap way of decimalizing the numbers .. it doesn't address representing the numbers on the page with comma-decimal format (which is a much bigger task).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Tman

  • Calm
  • *
  • Posts: 6
    • DW2819
    • IETELSUO12
  • Station Details: Davis Vantage Pro2
Re: Weather34 template
« Reply #23 on: February 12, 2019, 09:26:16 PM »
 [woohoo]

Works like a charm.

-Timo

saratogaWX

  • Strong Breeze
  • ***
  • Posts: 135
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
Re: Weather34 template
« Reply #24 on: February 12, 2019, 09:44:43 PM »
Great!  I'll push that to the master distribution.  I'll also add in an enhancement request for comma-decimal presentation display formatting to the to-do list.   Please do send along your Suomi translation update :)
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Tman

  • Calm
  • *
  • Posts: 6
    • DW2819
    • IETELSUO12
  • Station Details: Davis Vantage Pro2
Re: Weather34 template
« Reply #25 on: February 12, 2019, 09:55:53 PM »
Here you go - not perfect but pretty good start. (BTW, in temperature.php windchill, wetbulb and trend are not translated even they have $lang['XXX'] syntax)

-Timo

saratogaWX

  • Strong Breeze
  • ***
  • Posts: 135
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
Re: Weather34 template
« Reply #26 on: February 12, 2019, 10:17:57 PM »
Thanks!

A slightly longer-term project is to replace the translation structure with one like I use in the Saratoga templates (and Wim uses in the WD-HWS template) -- thats a lot of changes, but I think worth it in the long run.  Much easier to add/change translations as they come along.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

nowait

  • Strong Breeze
  • ***
  • Posts: 132
  • Station Details: Davis Vantage Pro 2 Wireless (Heated) on a Snow Leopard Mac Mini
Re: Weather34 template - the storm hits...
« Reply #27 on: February 13, 2019, 02:42:19 AM »
So as I was working to get the cumulus template info into place... I hear a ticka ticka ticka.... crap that's from my hard drive! I quick start a copy of my weather cat drive to my external drive.  Whew!  Unfortunately, I must not have gotten it all....  Looks like I'm missing some of the forecasting info on my site.  I am using the SaratogaWX templates... I think I got most if not all the data copied to my website but evidently not everything as you can see...  http://nowaitweather.com

Suggestions of what is missing/messed up would be a great help.

Next adventure will be to get the Cumulus software installed as a secondary (or primary) page.  One thing at a time.

Thanks in advance for any ideas.

NoWait

wurzelmac

  • Storm
  • *****
  • Posts: 1208
    • ITIROLPR2
    • Wetterstation Prägraten am Großvenediger
  • Station Details: Davis Vantage PRO2 Plus (24h fan aspirated, wireless) with UV/Solar | Weather Envoy Data Logger | Mac mini Mid 2011 2,7 GHz Intel Core i7 with 12 GB of RAM | 2x Canon EOS 1100D | macOS 10.13.6 HighSierra
Re: Weather34 template
« Reply #28 on: February 13, 2019, 07:05:32 AM »
I have a fix I'd like you to try to livedata.php

Working - thanks a lot!
Reinhard


saratogaWX

  • Strong Breeze
  • ***
  • Posts: 135
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
Re: Weather34 template - the storm hits...
« Reply #29 on: February 13, 2019, 04:37:32 PM »
So as I was working to get the cumulus template info into place... I hear a ticka ticka ticka.... crap that's from my hard drive! I quick start a copy of my weather cat drive to my external drive.  Whew!  Unfortunately, I must not have gotten it all....  Looks like I'm missing some of the forecasting info on my site.  I am using the SaratogaWX templates... I think I got most if not all the data copied to my website but evidently not everything as you can see...  http://nowaitweather.com

Suggestions of what is missing/messed up would be a great help.

Next adventure will be to get the Cumulus software installed as a secondary (or primary) page.  One thing at a time.

Thanks in advance for any ideas.

NoWait
Looks like the majority of the Saratoga template is there and operational.  Use http://nowaitweather.com/check-fetch-times.php?show=versions to show what updates are needed to fix remaining issues.

You can always save off copies of Settings.php and flyout-menu.xml, download the Base-USA, WCT-plugin distributions, upload them, then put back the saved copies of Settings.php and flyout-menu.xml and your site will be 'refreshed'.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP