cloudy cloudy

Author Topic: Customising w34WD  (Read 1020 times)

0 Members and 1 Guest are viewing this topic.

Offline bitsostring

  • Posts: 842
  • Oregon Scientific WMR200
  • Edinburgh, U.K.
  • OS/Browser:
  • Win NT 10.0
  • Chrome 64.0.3282.140
    • Home Weather Station
Re: Customising w34WD
« Reply #15 on: May 26, 2019, 04:13:44 PM »
Managed to get a small max-min extratemp block working, but I must be doing something wrong because it always shows C. . .  :(

Data needed is not in WD clientraw or clientrawextra, so I'm using a customtext file with only four tags  :)

UPDATE: Got it to work in C and F  :D
« Last Edit: May 26, 2019, 09:22:58 PM by bitsostring »
It's meant to be fun. . .

Offline bitsostring

  • Posts: 842
  • Oregon Scientific WMR200
  • Edinburgh, U.K.
  • OS/Browser:
  • Win NT 10.0
  • Chrome 64.0.3282.140
    • Home Weather Station
Re: Customising w34WD
« Reply #16 on: May 28, 2019, 10:10:34 AM »
Salutory lesson: fiddled with w34_livedata.php last night to sort rain rate units, but I wasn't working on the latest version of the script so the small extratemp block stopped working overnight  :roll:
It's meant to be fun. . .

Offline bitsostring

  • Posts: 842
  • Oregon Scientific WMR200
  • Edinburgh, U.K.
  • OS/Browser:
  • Win NT 10.0
  • Chrome 64.0.3282.140
    • Home Weather Station
Re: Customising w34WD
« Reply #17 on: June 03, 2019, 02:11:31 PM »
Recently noticed that my barometer block (original release) doesn't switch between UK and US units properly: the main pressure reading,  the max/min for the day and the trend change OK, but the dial limits and conversion at bottom left do not.

I had made a few changes to barometer_block.php, so I went back to the original (19/01 update) version and it still doesn't work. AFAIK I haven't made any changes to pressure values in w34_livedata.php. . .

EDIT: found the reason for that conversion problem was a small routine I added to lines 345-53 of w34_livedata.php to get max/min extratemps from a customtextout file. Now I need to understand why what I did there upset the temp_unit conditionals in barometer_block  :(

Can the fact that w34_livedata.php defines $weather["temp_units"] = "C" while the conditionals are if ($weather["temp_units"] == 'C') have anything to do with it. . .?
« Last Edit: June 03, 2019, 10:16:49 PM by bitsostring »
It's meant to be fun. . .

Offline niko

  • syzygy
  • Global Moderator
  • Posts: 28,041
  • Crystal Ball broken! Please post the URL.
  • Northern California, U.S.A.
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 74.0.3729.169
Re: Customising w34WD
« Reply #18 on: June 03, 2019, 02:59:28 PM »
Can the fact that w34_livedata.php defines $weather["temp_units"] = "C" while the conditionals are if ($weather["temp_units"] == 'C') have anything to do with it. . .?

Single vs. double quotes should make no difference when used like that with simple strings.

Offline bitsostring

  • Posts: 842
  • Oregon Scientific WMR200
  • Edinburgh, U.K.
  • OS/Browser:
  • Win NT 10.0
  • Chrome 64.0.3282.140
    • Home Weather Station
Re: Customising w34WD
« Reply #19 on: June 03, 2019, 03:08:45 PM »
Single vs. double quotes should make no difference when used like that with simple strings.

Thanks - I just tried it and came to the same conclusion! Back to square one.

P.S. I'm sure you've told me that before. . . I'll try to remember from now on  :wink:
« Last Edit: June 03, 2019, 03:43:45 PM by bitsostring »
It's meant to be fun. . .

Offline bitsostring

  • Posts: 842
  • Oregon Scientific WMR200
  • Edinburgh, U.K.
  • OS/Browser:
  • Win NT 10.0
  • Chrome 64.0.3282.140
    • Home Weather Station
Re: Customising w34WD
« Reply #20 on: June 03, 2019, 10:27:52 PM »
the reason for that conversion problem was a small routine I added to lines 345-53 of w34_livedata.php to get max/min extratemps from a customtextout file. Now I need to understand why what I did there upset the temp_unit conditionals in barometer_block  :(

Cracked it  :D

Instead of a stand-alone addition to get the extratemp data (with a re-definition of $weather["temp_units"] = "C") I integrated it with the main WD clientraw part of w34_livedata.php. So w34_livedata.php now "explodes" clientraw.txt and customtextout.txt into separate arrays before pulling out the individual data strings.
« Last Edit: June 04, 2019, 06:00:36 PM by bitsostring »
It's meant to be fun. . .

Offline bitsostring

  • Posts: 842
  • Oregon Scientific WMR200
  • Edinburgh, U.K.
  • OS/Browser:
  • Win NT 10.0
  • Chrome 64.0.3282.140
    • Home Weather Station
Re: Customising w34WD
« Reply #21 on: June 03, 2019, 11:26:17 PM »
Added max/min indoor temps. Now I know how to use the customtext file I might try to add max/min indoor temp times. . .

UPDATE: added, along with max UV  :)
« Last Edit: June 04, 2019, 05:59:14 PM by bitsostring »
It's meant to be fun. . .

Offline bitsostring

  • Posts: 842
  • Oregon Scientific WMR200
  • Edinburgh, U.K.
  • OS/Browser:
  • Win NT 10.0
  • Chrome 64.0.3282.140
    • Home Weather Station
Re: Customising w34WD
« Reply #22 on: June 06, 2019, 08:58:01 PM »
Having successfully added "Weather on Mars" to the Menu links back in February, it's taken me this long to realise that I can add my other weather pages too: WDL, FreshWDL and SS gauges.  #-o

« Last Edit: June 07, 2019, 09:47:37 AM by bitsostring »
It's meant to be fun. . .

Offline BfdWx

  • Posts: 1,607
  • Branford Connecticut
  • OS/Browser:
  • Mac OS X 10.14.5
  • Chrome 74.0.3729.169
    • Southern CT Weather
Re: Customising w34WD
« Reply #23 on: June 06, 2019, 11:32:14 PM »
Having successfully added "Weather on Mars" to the Menu links back in February, it's taken me this long to realise that I can add my other weather pages too: WDL, FreshWDL and SS gauges.  #-o

Enjoy!

Can you add a radar page like GRlevel3?

Offline bitsostring

  • Posts: 842
  • Oregon Scientific WMR200
  • Edinburgh, U.K.
  • OS/Browser:
  • Win NT 10.0
  • Chrome 64.0.3282.140
    • Home Weather Station
Re: Customising w34WD
« Reply #24 on: June 07, 2019, 09:46:38 AM »
Can you add a radar page like GRlevel3?

If you can get it into an iFrame you should be able to. See bottom of page 1, here.

EDIT: re iFrame or not, see here.

You will have realised that I'm no expert. . .  :)
« Last Edit: June 07, 2019, 09:57:36 AM by bitsostring »
It's meant to be fun. . .

Offline bitsostring

  • Posts: 842
  • Oregon Scientific WMR200
  • Edinburgh, U.K.
  • OS/Browser:
  • Win NT 10.0
  • Chrome 64.0.3282.140
    • Home Weather Station
Re: Customising w34WD
« Reply #25 on: June 10, 2019, 09:21:25 PM »
Re-organised the barometer block conversion and max/min items to give a more intuitive layout. . . I think.
It's meant to be fun. . .

Offline bitsostring

  • Posts: 842
  • Oregon Scientific WMR200
  • Edinburgh, U.K.
  • OS/Browser:
  • Win NT 10.0
  • Mozilla compatible
    • Home Weather Station
Re: Customising w34WD
« Reply #26 on: June 12, 2019, 11:37:20 PM »
Now using custom tag %rainlasthourmm% to give me "rain last hour", so I don't get negative "rain yesterday" just after midnight.

Tag %hourrn% (and presumably tag %hourrnusa%) also works over the midnight reset. It was a "good" day to check the tags: 32.6 mm rain and still going. . .

Added max/min baro times to barometer block, too.
« Last Edit: June 12, 2019, 11:41:11 PM by bitsostring »
It's meant to be fun. . .

Offline bitsostring

  • Posts: 842
  • Oregon Scientific WMR200
  • Edinburgh, U.K.
  • OS/Browser:
  • Win NT 10.0
  • Chrome 64.0.3282.140
    • Home Weather Station
Re: Customising w34WD
« Reply #27 on: June 13, 2019, 06:35:05 PM »
Added max/min baro times to barometer block, too.

Had a bit of bother with that, because customtextout.txt seems to end with an unwanted CR LF that is added to the last item in the explode() array in w34_livedata.php. . .

Quick and dirty fix was to add a dummy unused tag to the end of customtext.txt, but niko pointed me in another direction: trim() the string definition in w34_livedata.php

Code: [Select]
$weather["barometer_trend"]     = convert_baro ($wd[50],$from,$to);
$weather["lowbarotime"]         = $customtext[9];   # tag %lowbarot%
$weather["highbarotime"] = rtrim($customtext[10]);   # tag %highbarot%

Thanks, pal!
« Last Edit: June 13, 2019, 06:37:36 PM by bitsostring »
It's meant to be fun. . .

Offline niko

  • syzygy
  • Global Moderator
  • Posts: 28,041
  • Crystal Ball broken! Please post the URL.
  • Northern California, U.S.A.
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 74.0.3729.169
Re: Customising w34WD
« Reply #28 on: June 13, 2019, 07:00:15 PM »
I'm not totally convinced of the cause of the trailing space, but since you have one then trim() is your friend  :wink: