check-fetch-times.php Version 1.59 - 21-May-2025

Website PHP information

Running on webhost 'www.rogerscityweather.com' @ IP='109.106.250.144' (reverse IP Name='cpl91.hosting24.com')
Webserver OS: Linux cpl91.hosting24.com 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
PHP Version: 7.2.34 built for Linux
PHP cmd location: /opt/alt/php72/usr/bin/php
Document root: /home/rogersci/public_html
Template root: /home/rogersci/public_html
allow_url_fopen = ON
allow_url_include = off
request_order = GP
Stream support for http is available
Stream support for https is available
Streams supported: compress.bzip2, compress.zlib, data, file, ftp, ftps, glob, http, https, phar, php, zip
Socket transports: ssl, sslv3, tcp, tls, tlsv1.0, tlsv1.1, tlsv1.2, udg, udp, unix

Contents of Weather Data files

Settings-weather.php permissions=-rwxr-xr-x [0755]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82

<?php
############################################################################
# A Project of TNET Services, Inc. and Saratoga-Weather.org (World-ML template set)
############################################################################
#
#    Project:    Sample Included Website Design
#    Module:        Settings-weather.php
#    Purpose:    Provides the Site Settings Used Throughout the Site
#     Authors:    Kevin W. Reed <kreed@tnet.com>
#                TNET Services, Inc.
#               Ken True <webmaster@saratoga-weather.org>
#               Saratoga-Weather.org
#
#     Copyright:    (c) 1992-2007 Copyright TNET Services, Inc.
############################################################################
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
############################################################################
#    This document uses Tab 4 Settings
############################################################################
// Version 1.01 - 28-Sep-2011 - added $SITE['yesterdayData'] to settings
// Version 1.02 - 31-Mar-2012 - added $SITE['overrideRain'] to settings
// Version 1.03 - 08-Mar-2013 - adapted for Meteobridge
global $SITE;
#---------------------------------------------------------------------------
#  required settings for Meteobridge software
#---------------------------------------------------------------------------
$SITE['WXtags']        = './MBtags.php';  // for weather variables
$SITE['ajaxScript']    = 'ajaxMBwx.js'// for AJAX enabled display
$SITE['clientrawfile']    = './clientraw.txt'// location of clientraw.txt
// relative directory and name of Meteobridge MBrealtime.txt file uploaded via HTTP Push
// to conds.php script on your weather website
$SITE['realtimefile'] = './MBrealtime.txt';
#
//$SITE['conditionsMETAR'] = 'KSJC';  // set to nearby METAR for current conditions icon/text
$SITE['conditionsMETAR'] = 'KPZQ'// dist=01 mi (01 km), dir=SSW, Rogers City, Michigan, dated=30-APR-13
// $SITE['conditionsMETAR'] = 'KDTW'; // dist=13 mi (21 km), dir=SSE, Detroit/Wayne, Michigan, USA elev=195, dated=30-APR-13
// $SITE['conditionsMETAR'] = 'KVLL'; // dist=14 mi (23 km), dir=NE, Troy/Oakland, Michigan, USA elev=222, dated=30-APR-13
// $SITE['conditionsMETAR'] = 'KYIP'; // dist=14 mi (23 km), dir=SSW, Detroit/Willow, Michigan, USA elev=215, dated=30-APR-13
// $SITE['conditionsMETAR'] = 'KPTK'; // dist=17 mi (28 km), dir=N, Pontiac, Michigan, USA elev=299, dated=30-APR-13
// $SITE['conditionsMETAR'] = 'KDET'; // dist=20 mi (32 km), dir=E, Detroit/City Air, Michigan, USA elev=190, dated=30-APR-13
// $SITE['conditionsMETAR'] = 'KARB'; // dist=22 mi (35 km), dir=SW, Ann Arbor, Michigan, USA elev=251, dated=30-APR-13
// $SITE['conditionsMETAR'] = 'CYQG'; // dist=24 mi (39 km), dir=ESE, Windsor Airport, Ontario, Canada elev=190, dated=30-APR-13
// $SITE['conditionsMETAR'] = 'KONZ'; // dist=25 mi (41 km), dir=SSE, Detroit/Grosse I, Michigan, USA elev=180, dated=30-APR-13
// $SITE['conditionsMETAR'] = 'KOZW'; // dist=32 mi (52 km), dir=WNW, Howell, Michigan, USA elev=293, dated=30-APR-13
// $SITE['conditionsMETAR'] = 'KMTC'; // dist=33 mi (53 km), dir=ENE, Selfridge Angb, Michigan, USA elev=177, dated=30-APR-13
// $SITE['conditionsMETAR'] = 'KTTF'; // dist=33 mi (54 km), dir=S, Monroe, Michigan, USA elev=188, dated=30-APR-13
// $SITE['conditionsMETAR'] = 'CXHA'; // dist=37 mi (59 km), dir=SE, Harrow Cda, Ontario, Canada elev=191, dated=30-APR-13
// $SITE['conditionsMETAR'] = 'KFNT'; // dist=42 mi (68 km), dir=NNW, Flint, Michigan, USA elev=233, dated=30-APR-13
// $SITE['conditionsMETAR'] = 'KD95'; // dist=45 mi (73 km), dir=N, Lapeer, Michigan, USA elev=255, dated=30-APR-13
// $SITE['conditionsMETAR'] = 'KDUH'; // dist=49 mi (79 km), dir=SSW, Lambertville, Michigan, USA elev=204, dated=30-APR-13

//  comment out conditionsMETAR if no nearby METAR.. conditions icon/text will not be displayed
$SITE['overrideRain']   = true// =true then rain rate will set rain words instead of METAR rain words
#                               // =false - no change to METAR rain words (station rain rate not used)
$SITE['DavisVP']  = true;  // set to false if not a Davis VP weather station
$SITE['UV']       = true;  // set to false if no UV sensor
$SITE['SOLAR']    = true;  // set to false if no Solar sensor
##########################################################################
# end of configurable settings
#
// default settings needed for various pages when the weather software plugin is not installed.
// do not change these
$SITE['WXsoftware']     = 'MB';  // 'WD' for Weather-Display, 'CU' for Virtual Weather Station,
                                 // 'CU' for Cumulus, 'CU' for Cumulus, 'WXS' for WXSolution
                                 // 'MH' for Meteohub
$SITE['WXsoftwareURL'] = 'http://www.meteobridge.com/wiki/index.php/Main_Page';
$SITE['WXsoftwareLongName'] = 'Meteobridge';
$SITE['ajaxDashboard'] = './ajax-dashboard.php';
$SITE['trendsPage']     = 'MB-trends-inc.php'// CU-specific trends page
?>

./MBtags.php permissions=-rw-r--r-- [0644]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730

<?php
/*
 File: MBtags.php

 Purpose: load Meteobridge variables into a $WX[] array for use with the Canada/World/USA template sets
 NOTE: this file must be processed by Meteobridge as a template file and uploaded to the website
   as MBtags.php using the Meteobridge extended Push Services configuration.

 Author: Ken True - webmaster@saratoga-weather.org

 (created by gen-MBtags.php - V1.05 - 20-Jun-2023)

 These tags generated on 2025-06-21 17:06:16 GMT
   From MBtags-template.txt updated 2025-06-06 18:06:41 GMT

*/
// --------------------------------------------------------------------------

// allow viewing of generated source

if (isset($_REQUEST["sce"]) and strtolower($_REQUEST["sce"]) == "view" ) {
//--self downloader --
   
$filenameReal __FILE__;
   
$download_size filesize($filenameReal);
   
$lmod filemtime(__FILE__);
   
header("Last-modified: ".gmdate(DATE_RFC822,$lmod));
   
header("Pragma: public");
   
header("Cache-Control: private");
   
header("Cache-Control: no-cache, must-revalidate");
   
header("Content-type: text/plain");
   
header("Accept-Ranges: bytes");
   
header("Content-Length: $download_size");
   
header("Connection: close");
   
   
readfile($filenameReal);
   exit;
}
$WXsoftware 'MB';  
$defsFile 'MB-defs.php';  // filename with $varnames = $WX['MB-varnames']; equivalents
 
$rawdatalines '
date|2025-07-13|// local date:|:
time|13:41:03|// local time:|:
dateUTC|2025-07-13|// UTC date:|:
timeUTC|17:41:03|// UTCtime:|:
uomTemp|&deg;F|// UOM temperature:|:
uomWind| mph|// UOM wind:|:
uomBaro| inHg|// UOM barometer:|:
uomRain| in|// UOM rain:|:
mbsystem-swversion|6.0|// Meteobridge version string (example: "1.1"):|:
mbsystem-buildnum|15434|// build number as integer (example: 1673):|:
mbsystem-platform|CARAMBOLA2|// string that specifies hw platform (example: "TL-MR3020"):|:
mbsystem-station|Meteostick-Vantage|// string that specifies selected weather station (expample: "WMR-200"):|:
mbsystem-language|English|// language used on Meteobridge web interface (example: "English"):|:
mbsystem-timezone|America/Detroit|// defined timezone (example: "Europe/Berlin"):|:
mbsystem-latitude|45.417427|// latitude as float (example: 53.875120):|:
mbsystem-longitude|-83.810616|// longitude as float (example: 9.885357):|:
mbsystem-lastgooddata|0|// seconds passed since last piece of meaningfull sensor data recorded, returns -1 if no sensor data recorded so far:|:
mbsystem-uptime|1901306|// uptime of Meteobridge in seconds:|:
mbsystem-cpuload1m|0.4|// shows average cpu load during last 1 minute:|:
mbsystem-cpuload5m|0.4|// shows average cpu load during last 5 minutes:|:
mbsystem-cpuload15m|0.5|// shows average cpu load during last 15 minutes:|:
mbsystem-lunarage|17|// days passes since new moon as integer (example: 28):|:
mbsystem-lunarpercent|91.1|// lunarphase given as percentage from 0% (new moon) to 100% (full moon):|:
mbsystem-lunarsegment|5|// lunarphase segment as integer (0 = new moon, 1-3 = growing moon: quarter, half, three quarters, 4 = full moon, 5-7 = shrinking moon: three quarter, half, quarter):|:
mbsystem-daylength|15:22|// length of day (example: "11:28"):|:
mbsystem-civildaylength|16:35|// alternative method for daylength computation (example: "12:38"):|:
mbsystem-nauticaldaylength|18:10|// alternative method for daylength computation (example: "14:00"):|:
mbsystem-sunrise|06:00|// time of sunrise in local time. Can be converted to UTC by applying "=utc" to the variable (example: "06:47", resp. "05:47"):|:
mbsystem-sunset|21:22|// time of sunset in local time. Can be converted to UTC by applying "=utc" to the variable (example: "18:15", resp. "17:15"):|:
mbsystem-civilsunrise|05:24|// alternative computation for sunrise.:|:
mbsystem-civilsunset|21:58|// alternative computation for sunset.:|:
mbsystem-nauticalsunrise|04:36|// alternative computation for sunrise.:|:
mbsystem-nauticalsunset|22:46|// alternative alternative computation for sunset..:|:
mbsystem-daynightflag|D|// returns "D" when there is daylight, otherwise "N".:|:
mbsystem-moonrise|23:16|// time of moonrise in local time. Please notice that not every day has a moonrise time, therefore, variable can be non-existent on certain days (example: "05:46", resp. "04:46"):|:
mbsystem-moonset|08:49|// time of moonset in local time. Please notice that not every day has a moonset time, therefore, variable can be non-existent on certain days.:|:
mbsystem-solarmax|985|// maximum possible solar radiation on that day at that point of the earth. Needs latitude and longitude set and pressure data available.:|:
forecast-rule|-1|// Davis forecast rule number:|:
forecast-text||// Davis forecast reports in English:|:
forecast-texteshtml||// Davis forecast reports in Spanish:|:
th0temp-act|79.2|// outdoor temperature most recent:|:
th0temp-val5|79.2|// outdoor temperature value 5 minutes ago:|:
th0temp-val10|78.4|// outdoor temperature value 10 minutes ago:|:
th0temp-val15|78.4|// outdoor temperature value 15 minutes ago:|:
th0temp-val30|79.5|// outdoor temperature value 30 minutes ago:|:
th0temp-val60|77.5|// outdoor temperature value 60 minutes ago:|:
th0temp-delta2h|34.0|// outdoor temperature delta 2 hours ago:|:
th0temp-delta3h|36.1|// outdoor temperature delta 3 hours ago:|:
th0temp-delta6h|44.6|// outdoor temperature delta 6 hours ago:|:
th0temp-delta12h|42.8|// outdoor temperature delta 12 hours ago:|:
th0temp-delta24h|29.2|// outdoor temperature delta 24 hours ago:|:
th0temp-avg@h48|73.7|// outdoor temperature avg 48 hours ago:|:
th0temp-avg@h72|69.2|// outdoor temperature avg 72 hours ago:|:
th0temp-avg@h96|68.3|// outdoor temperature avg 96 hours ago:|:
th0temp-avg@h120|70.0|// outdoor temperature avg 120 hours ago:|:
th0temp-avg@h144|67.4|// outdoor temperature avg 144 hours ago:|:
th0temp-avg@h168|66.0|// outdoor temperature avg 168 hours ago:|:
th0temp-hmin|78.4|// outdoor temperature min of this hour:|:
th0temp-hmintime|20250713133000|// outdoor temperature timestamp min of this hour:|:
th0temp-hmax|80.1|// outdoor temperature max of this hour:|:
th0temp-hmaxtime|20250713130600|// outdoor temperature timestamp max of this hour:|:
th0temp-dmin|66.0|// outdoor temperature min of today:|:
th0temp-dmintime|20250713040730|// outdoor temperature timestamp min of today:|:
th0temp-dmax|80.1|// outdoor temperature max of today:|:
th0temp-dmaxtime|20250713130600|// outdoor temperature timestamp max of today:|:
th0temp-ydmin|67.5|// outdoor temperature min of yesterday:|:
th0temp-ydmintime|20250712063503|// outdoor temperature timestamp min of yesterday:|:
th0temp-ydmax|83.1|// outdoor temperature max of yesterday:|:
th0temp-ydmaxtime|20250712162903|// outdoor temperature timestamp max of yesterday:|:
th0temp-mmin|53.1|// outdoor temperature min of this month:|:
th0temp-mmintime|20250704042805|// outdoor temperature timestamp min of this month:|:
th0temp-mmax|93.4|// outdoor temperature max of this month:|:
th0temp-mmaxtime|20250705155109|// outdoor temperature timestamp max of this month:|:
th0temp-ymin|-1.7|// outdoor temperature min of this year:|:
th0temp-ymintime|20250121233210|// outdoor temperature timestamp min of this year:|:
th0temp-ymax|97.5|// outdoor temperature max of this year:|:
th0temp-ymaxtime|20250623162610|// outdoor temperature timestamp max of this year:|:
th0temp-amin|-1.7|// outdoor temperature min of all time:|:
th0temp-amintime|20250121233210|// outdoor temperature timestamp min of all time:|:
th0temp-amax|97.5|// outdoor temperature max of all time:|:
th0temp-amaxtime|20250623162610|// outdoor temperature timestamp max of all time:|:
th0temp-starttime|20220428151508|// outdoor temperature timestamp of first recorded data:|:
th0hum-act|63|// outdoor humidity most recent:|:
th0hum-val5|64|// outdoor humidity value 5 minutes ago:|:
th0hum-val10|62|// outdoor humidity value 10 minutes ago:|:
th0hum-val15|62|// outdoor humidity value 15 minutes ago:|:
th0hum-val30|62|// outdoor humidity value 30 minutes ago:|:
th0hum-val60|66|// outdoor humidity value 60 minutes ago:|:
th0hum-delta2h|-4|// outdoor humidity delta 2 hours ago:|:
th0hum-delta3h|-10|// outdoor humidity delta 3 hours ago:|:
th0hum-delta6h|-31|// outdoor humidity delta 6 hours ago:|:
th0hum-delta12h|-30|// outdoor humidity delta 12 hours ago:|:
th0hum-delta24h|-20|// outdoor humidity delta 24 hours ago:|:
th0hum-avg@h48|84|// outdoor humidity avg 48 hours ago:|:
th0hum-avg@h72|84|// outdoor humidity avg 72 hours ago:|:
th0hum-avg@h96|88|// outdoor humidity avg 96 hours ago:|:
th0hum-avg@h120|75|// outdoor humidity avg 120 hours ago:|:
th0hum-avg@h144|74|// outdoor humidity avg 144 hours ago:|:
th0hum-avg@h168|97|// outdoor humidity avg 168 hours ago:|:
th0hum-hmin|60|// outdoor humidity min of this hour:|:
th0hum-hmintime|20250713132507|// outdoor humidity timestamp min of this hour:|:
th0hum-hmax|65|// outdoor humidity max of this hour:|:
th0hum-hmaxtime|20250713130130|// outdoor humidity timestamp max of this hour:|:
th0hum-dmin|60|// outdoor humidity min of today:|:
th0hum-dmintime|20250713132507|// outdoor humidity timestamp min of today:|:
th0hum-dmax|96|// outdoor humidity max of today:|:
th0hum-dmaxtime|20250713045207|// outdoor humidity timestamp max of today:|:
th0hum-ydmin|68|// outdoor humidity min of yesterday:|:
th0hum-ydmintime|20250712185603|// outdoor humidity timestamp min of yesterday:|:
th0hum-ydmax|97|// outdoor humidity max of yesterday:|:
th0hum-ydmaxtime|20250712145207|// outdoor humidity timestamp max of yesterday:|:
th0hum-mmin|43|// outdoor humidity min of this month:|:
th0hum-mmintime|20250705155313|// outdoor humidity timestamp min of this month:|:
th0hum-mmax|98|// outdoor humidity max of this month:|:
th0hum-mmaxtime|20250707012602|// outdoor humidity timestamp max of this month:|:
th0hum-ymin|14|// outdoor humidity min of this year:|:
th0hum-ymintime|20250512192706|// outdoor humidity timestamp min of this year:|:
th0hum-ymax|99|// outdoor humidity max of this year:|:
th0hum-ymaxtime|20250627113822|// outdoor humidity timestamp max of this year:|:
th0hum-amin|14|// outdoor humidity min of all time:|:
th0hum-amintime|20250512192706|// outdoor humidity timestamp min of all time:|:
th0hum-amax|100|// outdoor humidity max of all time:|:
th0hum-amaxtime|20231229001359|// outdoor humidity timestamp max of all time:|:
th0hum-starttime|20220428155032|// outdoor humidity timestamp of first recorded data:|:
th0dew-act|65.5|// outdoor dewpoint most recent:|:
th0dew-val5|65.8|// outdoor dewpoint value 5 minutes ago:|:
th0dew-val10|64.4|// outdoor dewpoint value 10 minutes ago:|:
th0dew-val15|64.4|// outdoor dewpoint value 15 minutes ago:|:
th0dew-val30|65.3|// outdoor dewpoint value 30 minutes ago:|:
th0dew-val60|65.3|// outdoor dewpoint value 60 minutes ago:|:
th0dew-delta2h|32.2|// outdoor dewpoint delta 2 hours ago:|:
th0dew-delta3h|31.6|// outdoor dewpoint delta 3 hours ago:|:
th0dew-delta6h|32.7|// outdoor dewpoint delta 6 hours ago:|:
th0dew-delta12h|31.3|// outdoor dewpoint delta 12 hours ago:|:
th0dew-delta24h|21.3|// outdoor dewpoint delta 24 hours ago:|:
th0dew-avg@h48|68.4|// outdoor dewpoint avg 48 hours ago:|:
th0dew-avg@h72|64.3|// outdoor dewpoint avg 72 hours ago:|:
th0dew-avg@h96|64.6|// outdoor dewpoint avg 96 hours ago:|:
th0dew-avg@h120|61.9|// outdoor dewpoint avg 120 hours ago:|:
th0dew-avg@h144|58.9|// outdoor dewpoint avg 144 hours ago:|:
th0dew-avg@h168|65.1|// outdoor dewpoint avg 168 hours ago:|:
th0dew-hmin|63.3|// outdoor dewpoint min of this hour:|:
th0dew-hmintime|20250713132507|// outdoor dewpoint timestamp min of this hour:|:
th0dew-hmax|66.9|// outdoor dewpoint max of this hour:|:
th0dew-hmaxtime|20250713130130|// outdoor dewpoint timestamp max of this hour:|:
th0dew-dmin|63.3|// outdoor dewpoint min of today:|:
th0dew-dmintime|20250713132507|// outdoor dewpoint timestamp min of today:|:
th0dew-dmax|68.9|// outdoor dewpoint max of today:|:
th0dew-dmaxtime|20250713001307|// outdoor dewpoint timestamp max of today:|:
th0dew-ydmin|65.8|// outdoor dewpoint min of yesterday:|:
th0dew-ydmintime|20250712054607|// outdoor dewpoint timestamp min of yesterday:|:
th0dew-ydmax|78.8|// outdoor dewpoint max of yesterday:|:
th0dew-ydmaxtime|20250712131018|// outdoor dewpoint timestamp max of yesterday:|:
th0dew-mmin|49.8|// outdoor dewpoint min of this month:|:
th0dew-mmintime|20250704041209|// outdoor dewpoint timestamp min of this month:|:
th0dew-mmax|78.8|// outdoor dewpoint max of this month:|:
th0dew-mmaxtime|20250712131018|// outdoor dewpoint timestamp max of this month:|:
th0dew-ymin|-8.5|// outdoor dewpoint min of this year:|:
th0dew-ymintime|20250121223102|// outdoor dewpoint timestamp min of this year:|:
th0dew-ymax|78.8|// outdoor dewpoint max of this year:|:
th0dew-ymaxtime|20250712131018|// outdoor dewpoint timestamp max of this year:|:
th0dew-amin|-8.5|// outdoor dewpoint min of all time:|:
th0dew-amintime|20250121223102|// outdoor dewpoint timestamp min of all time:|:
th0dew-amax|78.8|// outdoor dewpoint max of all time:|:
th0dew-amaxtime|20250712131018|// outdoor dewpoint timestamp max of all time:|:
th0dew-starttime|20220428155032|// outdoor dewpoint timestamp of first recorded data:|:
thb0temp-act|70.0|// indoor temperature most recent:|:
thb0temp-val5|69.8|// indoor temperature value 5 minutes ago:|:
thb0temp-val10|69.8|// indoor temperature value 10 minutes ago:|:
thb0temp-val15|70.2|// indoor temperature value 15 minutes ago:|:
thb0temp-val30|70.3|// indoor temperature value 30 minutes ago:|:
thb0temp-val60|70.7|// indoor temperature value 60 minutes ago:|:
thb0temp-hmin|69.8|// indoor temperature min of this hour:|:
thb0temp-hmintime|20250713133749|// indoor temperature timestamp min of this hour:|:
thb0temp-hmax|70.5|// indoor temperature max of this hour:|:
thb0temp-hmaxtime|20250713131948|// indoor temperature timestamp max of this hour:|:
thb0temp-dmin|69.8|// indoor temperature min of today:|:
thb0temp-dmintime|20250713133749|// indoor temperature timestamp min of today:|:
thb0temp-dmax|71.4|// indoor temperature max of today:|:
thb0temp-dmaxtime|20250713120346|// indoor temperature timestamp max of today:|:
thb0temp-ydmin|68.7|// indoor temperature min of yesterday:|:
thb0temp-ydmintime|20250712193817|// indoor temperature timestamp min of yesterday:|:
thb0temp-ydmax|72.0|// indoor temperature max of yesterday:|:
thb0temp-ydmaxtime|20250712114403|// indoor temperature timestamp max of yesterday:|:
thb0temp-mmin|67.6|// indoor temperature min of this month:|:
thb0temp-mmintime|20250711124423|// indoor temperature timestamp min of this month:|:
thb0temp-mmax|72.3|// indoor temperature max of this month:|:
thb0temp-mmaxtime|20250711190234|// indoor temperature timestamp max of this month:|:
thb0temp-ymin|17.4|// indoor temperature min of this year:|:
thb0temp-ymintime|20250330154837|// indoor temperature timestamp min of this year:|:
thb0temp-ymax|72.9|// indoor temperature max of this year:|:
thb0temp-ymaxtime|20250623160555|// indoor temperature timestamp max of this year:|:
thb0temp-amin|17.4|// indoor temperature min of all time:|:
thb0temp-amintime|20250330154837|// indoor temperature timestamp min of all time:|:
thb0temp-amax|73.4|// indoor temperature max of all time:|:
thb0temp-amaxtime|20240827170359|// indoor temperature timestamp max of all time:|:
thb0temp-starttime|20220428152617|// indoor temperature timestamp of first recorded data:|:
thb0hum-act|17|// indoor humidity most recent:|:
thb0hum-val5|17|// indoor humidity value 5 minutes ago:|:
thb0hum-val10|17|// indoor humidity value 10 minutes ago:|:
thb0hum-val15|17|// indoor humidity value 15 minutes ago:|:
thb0hum-val30|17|// indoor humidity value 30 minutes ago:|:
thb0hum-val60|17|// indoor humidity value 60 minutes ago:|:
thb0hum-hmin|17|// indoor humidity min of this hour:|:
thb0hum-hmintime|20250713133949|// indoor humidity timestamp min of this hour:|:
thb0hum-hmax|17|// indoor humidity max of this hour:|:
thb0hum-hmaxtime|20250713133949|// indoor humidity timestamp max of this hour:|:
thb0hum-dmin|16|// indoor humidity min of today:|:
thb0hum-dmintime|20250713120647|// indoor humidity timestamp min of today:|:
thb0hum-dmax|17|// indoor humidity max of today:|:
thb0hum-dmaxtime|20250713133949|// indoor humidity timestamp max of today:|:
thb0hum-ydmin|16|// indoor humidity min of yesterday:|:
thb0hum-ydmintime|20250712225323|// indoor humidity timestamp min of yesterday:|:
thb0hum-ydmax|18|// indoor humidity max of yesterday:|:
thb0hum-ydmaxtime|20250712102101|// indoor humidity timestamp max of yesterday:|:
thb0hum-mmin|14|// indoor humidity min of this month:|:
thb0hum-mmintime|20250701070212|// indoor humidity timestamp min of this month:|:
thb0hum-mmax|20|// indoor humidity max of this month:|:
thb0hum-mmaxtime|20250710170057|// indoor humidity timestamp max of this month:|:
thb0hum-ymin|0|// indoor humidity min of this year:|:
thb0hum-ymintime|20250122101500|// indoor humidity timestamp min of this year:|:
thb0hum-ymax|66|// indoor humidity max of this year:|:
thb0hum-ymaxtime|20250603133737|// indoor humidity timestamp max of this year:|:
thb0hum-amin|0|// indoor humidity min of all time:|:
thb0hum-amintime|20250122101500|// indoor humidity timestamp min of all time:|:
thb0hum-amax|66|// indoor humidity max of all time:|:
thb0hum-amaxtime|20250603133737|// indoor humidity timestamp max of all time:|:
thb0hum-starttime|20220428155919|// indoor humidity timestamp of first recorded data:|:
thb0dew-act|55.6|// indoor dewpoint most recent:|:
thb0dew-val5|55.4|// indoor dewpoint value 5 minutes ago:|:
thb0dew-val10|55.4|// indoor dewpoint value 10 minutes ago:|:
thb0dew-val15|55.8|// indoor dewpoint value 15 minutes ago:|:
thb0dew-val30|55.9|// indoor dewpoint value 30 minutes ago:|:
thb0dew-val60|56.1|// indoor dewpoint value 60 minutes ago:|:
thb0dew-hmin|55.4|// indoor dewpoint min of this hour:|:
thb0dew-hmintime|20250713133749|// indoor dewpoint timestamp min of this hour:|:
thb0dew-hmax|56.1|// indoor dewpoint max of this hour:|:
thb0dew-hmaxtime|20250713131948|// indoor dewpoint timestamp max of this hour:|:
thb0dew-dmin|54.1|// indoor dewpoint min of today:|:
thb0dew-dmintime|20250713065837|// indoor dewpoint timestamp min of today:|:
thb0dew-dmax|56.8|// indoor dewpoint max of today:|:
thb0dew-dmaxtime|20250713120346|// indoor dewpoint timestamp max of today:|:
thb0dew-ydmin|52.9|// indoor dewpoint min of yesterday:|:
thb0dew-ydmintime|20250712193817|// indoor dewpoint timestamp min of yesterday:|:
thb0dew-ydmax|58.6|// indoor dewpoint max of yesterday:|:
thb0dew-ydmaxtime|20250712102101|// indoor dewpoint timestamp max of yesterday:|:
thb0dew-mmin|50.9|// indoor dewpoint min of this month:|:
thb0dew-mmintime|20250701070212|// indoor dewpoint timestamp min of this month:|:
thb0dew-mmax|60.4|// indoor dewpoint max of this month:|:
thb0dew-mmaxtime|20250705220528|// indoor dewpoint timestamp max of this month:|:
thb0dew-ymin|-20.0|// indoor dewpoint min of this year:|:
thb0dew-ymintime|20250414052329|// indoor dewpoint timestamp min of this year:|:
thb0dew-ymax|92.8|// indoor dewpoint max of this year:|:
thb0dew-ymaxtime|20250605183910|// indoor dewpoint timestamp max of this year:|:
thb0dew-amin|-20.0|// indoor dewpoint min of all time:|:
thb0dew-amintime|20250414052329|// indoor dewpoint timestamp min of all time:|:
thb0dew-amax|92.8|// indoor dewpoint max of all time:|:
thb0dew-amaxtime|20250605183910|// indoor dewpoint timestamp max of all time:|:
thb0dew-starttime|20220428152617|// indoor dewpoint timestamp of first recorded data:|:
thb0press-act|29.27|// station pressure most recent:|:
thb0press-val5|29.27|// station pressure value 5 minutes ago:|:
thb0press-val10|29.26|// station pressure value 10 minutes ago:|:
thb0press-val15|29.27|// station pressure value 15 minutes ago:|:
thb0press-val30|29.27|// station pressure value 30 minutes ago:|:
thb0press-val60|29.28|// station pressure value 60 minutes ago:|:
thb0press-hmin|29.26|// station pressure min of this hour:|:
thb0press-hmintime|20250713133348|// station pressure timestamp min of this hour:|:
thb0press-hmax|29.27|// station pressure max of this hour:|:
thb0press-hmaxtime|20250713133849|// station pressure timestamp max of this hour:|:
thb0press-dmin|29.16|// station pressure min of today:|:
thb0press-dmintime|20250713002626|// station pressure timestamp min of today:|:
thb0press-dmax|29.28|// station pressure max of today:|:
thb0press-dmaxtime|20250713124947|// station pressure timestamp max of today:|:
thb0press-ydmin|29.06|// station pressure min of yesterday:|:
thb0press-ydmintime|20250712132906|// station pressure timestamp min of yesterday:|:
thb0press-ydmax|29.24|// station pressure max of yesterday:|:
thb0press-ydmaxtime|20250712002444|// station pressure timestamp max of yesterday:|:
thb0press-mmin|29.06|// station pressure min of this month:|:
thb0press-mmintime|20250712132906|// station pressure timestamp min of this month:|:
thb0press-mmax|29.43|// station pressure max of this month:|:
thb0press-mmaxtime|20250704084523|// station pressure timestamp max of this month:|:
thb0press-ymin|28.32|// station pressure min of this year:|:
thb0press-ymintime|20250305155618|// station pressure timestamp min of this year:|:
thb0press-ymax|29.85|// station pressure max of this year:|:
thb0press-ymaxtime|20250214122937|// station pressure timestamp max of this year:|:
thb0press-amin|28.31|// station pressure min of all time:|:
thb0press-amintime|20240110012433|// station pressure timestamp min of all time:|:
thb0press-amax|30.15|// station pressure max of all time:|:
thb0press-amaxtime|20221108105747|// station pressure timestamp max of all time:|:
thb0press-starttime|20220428155919|// station pressure timestamp of first recorded data:|:
thb0seapress-act|29.90|// sealevel pressure most recent:|:
thb0seapress-val5|29.90|// sealevel pressure value 5 minutes ago:|:
thb0seapress-val10|29.90|// sealevel pressure value 10 minutes ago:|:
thb0seapress-val15|29.90|// sealevel pressure value 15 minutes ago:|:
thb0seapress-val30|29.90|// sealevel pressure value 30 minutes ago:|:
thb0seapress-val60|29.91|// sealevel pressure value 60 minutes ago:|:
thb0seapress-delta2h|-0.01|// sealevel pressure delta 2 hours ago:|:
thb0seapress-delta3h|0.01|// sealevel pressure delta 3 hours ago:|:
thb0seapress-delta6h|0.03|// sealevel pressure delta 6 hours ago:|:
thb0seapress-delta12h|0.11|// sealevel pressure delta 12 hours ago:|:
thb0seapress-delta24h|0.20|// sealevel pressure delta 24 hours ago:|:
thb0seapress-avg@h48|29.88|// sealevel pressure avg 48 hours ago:|:
thb0seapress-avg@h72|29.95|// sealevel pressure avg 72 hours ago:|:
thb0seapress-avg@h96|29.97|// sealevel pressure avg 96 hours ago:|:
thb0seapress-avg@h120|30.04|// sealevel pressure avg 120 hours ago:|:
thb0seapress-avg@h144|29.98|// sealevel pressure avg 144 hours ago:|:
thb0seapress-avg@h168|29.80|// sealevel pressure avg 168 hours ago:|:
thb0seapress-hmin|29.90|// sealevel pressure min of this hour:|:
thb0seapress-hmintime|20250713133348|// sealevel pressure timestamp min of this hour:|:
thb0seapress-hmax|29.90|// sealevel pressure max of this hour:|:
thb0seapress-hmaxtime|20250713133849|// sealevel pressure timestamp max of this hour:|:
thb0seapress-dmin|29.78|// sealevel pressure min of today:|:
thb0seapress-dmintime|20250713002626|// sealevel pressure timestamp min of today:|:
thb0seapress-dmax|29.91|// sealevel pressure max of today:|:
thb0seapress-dmaxtime|20250713124947|// sealevel pressure timestamp max of today:|:
thb0seapress-ydmin|29.69|// sealevel pressure min of yesterday:|:
thb0seapress-ydmintime|20250712132906|// sealevel pressure timestamp min of yesterday:|:
thb0seapress-ydmax|29.86|// sealevel pressure max of yesterday:|:
thb0seapress-ydmaxtime|20250712002444|// sealevel pressure timestamp max of yesterday:|:
thb0seapress-mmin|29.69|// sealevel pressure min of this month:|:
thb0seapress-mmintime|20250712132906|// sealevel pressure timestamp min of this month:|:
thb0seapress-mmax|30.08|// sealevel pressure max of this month:|:
thb0seapress-mmaxtime|20250704084523|// sealevel pressure timestamp max of this month:|:
thb0seapress-ymin|28.97|// sealevel pressure min of this year:|:
thb0seapress-ymintime|20250305155618|// sealevel pressure timestamp min of this year:|:
thb0seapress-ymax|30.57|// sealevel pressure max of this year:|:
thb0seapress-ymaxtime|20250214122937|// sealevel pressure timestamp max of this year:|:
thb0seapress-amin|28.96|// sealevel pressure min of all time:|:
thb0seapress-amintime|20240110011724|// sealevel pressure timestamp min of all time:|:
thb0seapress-amax|30.85|// sealevel pressure max of all time:|:
thb0seapress-amaxtime|20241214045548|// sealevel pressure timestamp max of all time:|:
thb0seapress-starttime|20220428155919|// sealevel pressure timestamp of first recorded data:|:
wind0wind-act|1.1|// windspeed most recent:|:
wind0wind-val5|1.1|// windspeed value 5 minutes ago:|:
wind0wind-val10|6.3|// windspeed value 10 minutes ago:|:
wind0wind-val15|7.4|// windspeed value 15 minutes ago:|:
wind0wind-val30|5.4|// windspeed value 30 minutes ago:|:
wind0wind-val60|3.1|// windspeed value 60 minutes ago:|:
wind0wind-hmin|0.0|// windspeed min of this hour:|:
wind0wind-hmintime|20250713133909|// windspeed timestamp min of this hour:|:
wind0wind-hmax|12.8|// windspeed max of this hour:|:
wind0wind-hmaxtime|20250713133749|// windspeed timestamp max of this hour:|:
wind0wind-dmin|0.0|// windspeed min of today:|:
wind0wind-dmintime|20250713133909|// windspeed timestamp min of today:|:
wind0wind-dmax|13.9|// windspeed max of today:|:
wind0wind-dmaxtime|20250713125425|// windspeed timestamp max of today:|:
wind0wind-ydmin|0.0|// windspeed min of yesterday:|:
wind0wind-ydmintime|20250712235811|// windspeed timestamp min of yesterday:|:
wind0wind-ydmax|32.9|// windspeed max of yesterday:|:
wind0wind-ydmaxtime|20250712135447|// windspeed timestamp max of yesterday:|:
wind0wind-mmin|0.0|// windspeed min of this month:|:
wind0wind-mmintime|20250713133909|// windspeed timestamp min of this month:|:
wind0wind-mmax|32.9|// windspeed max of this month:|:
wind0wind-mmaxtime|20250712135447|// windspeed timestamp max of this month:|:
wind0wind-ymin|0.0|// windspeed min of this year:|:
wind0wind-ymintime|20250713133909|// windspeed timestamp min of this year:|:
wind0wind-ymax|47.9|// windspeed max of this year:|:
wind0wind-ymaxtime|20250429133413|// windspeed timestamp max of this year:|:
wind0wind-amin|0.0|// windspeed min of all time:|:
wind0wind-amintime|20250713133909|// windspeed timestamp min of all time:|:
wind0wind-amax|47.9|// windspeed max of all time:|:
wind0wind-amaxtime|20250429133413|// windspeed timestamp max of all time:|:
wind0wind-starttime|20220428155513|// windspeed timestamp of first recorded data:|:
wind0avgwind-act|2.7|// average windspeed most recent:|:
wind0avgwind-val5|3.8|// average windspeed value 5 minutes ago:|:
wind0avgwind-val10|7.8|// average windspeed value 10 minutes ago:|:
wind0avgwind-val15|6.5|// average windspeed value 15 minutes ago:|:
wind0avgwind-val30|6.7|// average windspeed value 30 minutes ago:|:
wind0avgwind-val60|6.9|// average windspeed value 60 minutes ago:|:
wind0avgwind-delta2h|0.4|// average windspeed delta 2 hours ago:|:
wind0avgwind-delta3h|-0.3|// average windspeed delta 3 hours ago:|:
wind0avgwind-delta6h|-2.3|// average windspeed delta 6 hours ago:|:
wind0avgwind-delta12h|2.7|// average windspeed delta 12 hours ago:|:
wind0avgwind-delta24h|-0.4|// average windspeed delta 24 hours ago:|:
wind0avgwind-avg@h48|2.5|// average windspeed avg 48 hours ago:|:
wind0avgwind-avg@h72|3.5|// average windspeed avg 72 hours ago:|:
wind0avgwind-avg@h96|3.1|// average windspeed avg 96 hours ago:|:
wind0avgwind-avg@h120|4.3|// average windspeed avg 120 hours ago:|:
wind0avgwind-avg@h144|1.9|// average windspeed avg 144 hours ago:|:
wind0avgwind-avg@h168|2.9|// average windspeed avg 168 hours ago:|:
wind0avgwind-hmin|2.5|// average windspeed min of this hour:|:
wind0avgwind-hmintime|20250713133711|// average windspeed timestamp min of this hour:|:
wind0avgwind-hmax|8.3|// average windspeed max of this hour:|:
wind0avgwind-hmaxtime|20250713133119|// average windspeed timestamp max of this hour:|:
wind0avgwind-dmin|0.0|// average windspeed min of today:|:
wind0avgwind-dmintime|20250713035203|// average windspeed timestamp min of today:|:
wind0avgwind-dmax|8.7|// average windspeed max of today:|:
wind0avgwind-dmaxtime|20250713125609|// average windspeed timestamp max of today:|:
wind0avgwind-ydmin|0.0|// average windspeed min of yesterday:|:
wind0avgwind-ydmintime|20250712225002|// average windspeed timestamp min of yesterday:|:
wind0avgwind-ydmax|18.8|// average windspeed max of yesterday:|:
wind0avgwind-ydmaxtime|20250712135501|// average windspeed timestamp max of yesterday:|:
wind0avgwind-mmin|0.0|// average windspeed min of this month:|:
wind0avgwind-mmintime|20250713035203|// average windspeed timestamp min of this month:|:
wind0avgwind-mmax|18.8|// average windspeed max of this month:|:
wind0avgwind-mmaxtime|20250712135501|// average windspeed timestamp max of this month:|:
wind0avgwind-ymin|0.0|// average windspeed min of this year:|:
wind0avgwind-ymintime|20250713035203|// average windspeed timestamp min of this year:|:
wind0avgwind-ymax|28.2|// average windspeed max of this year:|:
wind0avgwind-ymaxtime|20250429124114|// average windspeed timestamp max of this year:|:
wind0avgwind-amin|0.0|// average windspeed min of all time:|:
wind0avgwind-amintime|20250713035203|// average windspeed timestamp min of all time:|:
wind0avgwind-amax|28.2|// average windspeed max of all time:|:
wind0avgwind-amaxtime|20250429124114|// average windspeed timestamp max of all time:|:
wind0avgwind-starttime|20220428155919|// average windspeed timestamp of first recorded data:|:
wind0dir-act|358|// wind direction most recent:|:
wind0dir-val5|65|// wind direction value 5 minutes ago:|:
wind0dir-val10|293|// wind direction value 10 minutes ago:|:
wind0dir-val15|264|// wind direction value 15 minutes ago:|:
wind0dir-val30|281|// wind direction value 30 minutes ago:|:
wind0dir-val60|312|// wind direction value 60 minutes ago:|:
wind0dir-delta2h|0|// wind direction delta 2 hours ago:|:
wind0dir-delta3h|0|// wind direction delta 3 hours ago:|:
wind0dir-delta6h|0|// wind direction delta 6 hours ago:|:
wind0dir-delta12h|0|// wind direction delta 12 hours ago:|:
wind0dir-delta24h|0|// wind direction delta 24 hours ago:|:
wind0dir-avg@h48|18|// wind direction avg 48 hours ago:|:
wind0dir-avg@h72|27|// wind direction avg 72 hours ago:|:
wind0dir-avg@h96|28|// wind direction avg 96 hours ago:|:
wind0dir-avg@h120|66|// wind direction avg 120 hours ago:|:
wind0dir-avg@h144|344|// wind direction avg 144 hours ago:|:
wind0dir-avg@h168|22|// wind direction avg 168 hours ago:|:
wind0dir-avg10|288|// wind direction average 10 minutes:|:
wind0dir-havg|270|// wind direction average of this hour:|:
wind0dir-davg|275|// wind direction average of today:|:
wind0dir-ydavg|207|// wind direction average of yesterday:|:
wind0dir-mavg|316|// wind direction average of this month:|:
wind0dir-yavg|300|// wind direction average of this year:|:
wind0dir-aavg|290|// wind direction average of all time:|:
wind0dir-starttime|--|// wind direction timestamp of first recorded data:|:
wind0chill-act|79.2|// outdoor wind chill temperature most recent:|:
wind0chill-val5|79.2|// outdoor wind chill temperature value 5 minutes ago:|:
wind0chill-val10|78.4|// outdoor wind chill temperature value 10 minutes ago:|:
wind0chill-val15|78.4|// outdoor wind chill temperature value 15 minutes ago:|:
wind0chill-val30|79.5|// outdoor wind chill temperature value 30 minutes ago:|:
wind0chill-val60|77.5|// outdoor wind chill temperature value 60 minutes ago:|:
wind0chill-hmin|78.4|// outdoor wind chill temperature min of this hour:|:
wind0chill-hmintime|20250713133105|// outdoor wind chill temperature timestamp min of this hour:|:
wind0chill-hmax|80.1|// outdoor wind chill temperature max of this hour:|:
wind0chill-hmaxtime|20250713130601|// outdoor wind chill temperature timestamp max of this hour:|:
wind0chill-dmin|66.0|// outdoor wind chill temperature min of today:|:
wind0chill-dmintime|20250713070931|// outdoor wind chill temperature timestamp min of today:|:
wind0chill-dmax|80.1|// outdoor wind chill temperature max of today:|:
wind0chill-dmaxtime|20250713130601|// outdoor wind chill temperature timestamp max of today:|:
wind0chill-ydmin|67.5|// outdoor wind chill temperature min of yesterday:|:
wind0chill-ydmintime|20250712063501|// outdoor wind chill temperature timestamp min of yesterday:|:
wind0chill-ydmax|83.1|// outdoor wind chill temperature max of yesterday:|:
wind0chill-ydmaxtime|20250712162901|// outdoor wind chill temperature timestamp max of yesterday:|:
wind0chill-mmin|51.1|// outdoor wind chill temperature min of this month:|:
wind0chill-mmintime|20250704042754|// outdoor wind chill temperature timestamp min of this month:|:
wind0chill-mmax|93.4|// outdoor wind chill temperature max of this month:|:
wind0chill-mmaxtime|20250705155200|// outdoor wind chill temperature timestamp max of this month:|:
wind0chill-ymin|-22.9|// outdoor wind chill temperature min of this year:|:
wind0chill-ymintime|20250122005704|// outdoor wind chill temperature timestamp min of this year:|:
wind0chill-ymax|97.5|// outdoor wind chill temperature max of this year:|:
wind0chill-ymaxtime|20250623162600|// outdoor wind chill temperature timestamp max of this year:|:
wind0chill-amin|-22.9|// outdoor wind chill temperature min of all time:|:
wind0chill-amintime|20250122005704|// outdoor wind chill temperature timestamp min of all time:|:
wind0chill-amax|97.5|// outdoor wind chill temperature max of all time:|:
wind0chill-amaxtime|20250623162600|// outdoor wind chill temperature timestamp max of all time:|:
wind0chill-starttime|20220428151402|// outdoor wind chill temperature timestamp of first recorded data:|:
rain0rate-act|0.00|// rain rate most recent:|:
rain0rate-val5|0.00|// rain rate value 5 minutes ago:|:
rain0rate-val10|0.00|// rain rate value 10 minutes ago:|:
rain0rate-val15|0.00|// rain rate value 15 minutes ago:|:
rain0rate-val30|0.00|// rain rate value 30 minutes ago:|:
rain0rate-val60|0.00|// rain rate value 60 minutes ago:|:
rain0rate-delta2h|0.00|// rain rate delta 2 hours ago:|:
rain0rate-delta3h|0.00|// rain rate  delta 3 hours ago:|:
rain0rate-delta6h|0.00|// rain rate delta 6 hours ago:|:
rain0rate-delta12h|0.00|// rain rate delta 12 hours ago:|:
rain0rate-delta24h|0.00|// rain rate delta 24 hours ago:|:
rain0rate-avg@h48|0.00|// rain rate avg 48 hours ago:|:
rain0rate-avg@h72|0.00|// rain rate avg 72 hours ago:|:
rain0rate-avg@h96|0.00|// rain rate avg 96 hours ago:|:
rain0rate-avg@h120|0.00|// rain rate avg 120 hours ago:|:
rain0rate-avg@h144|0.00|// rain rate avg 144 hours ago:|:
rain0rate-avg@h168|0.04|// rain rate avg 168 hours ago:|:
rain0rate-hmin|0.00|// rain rate min of this hour:|:
rain0rate-hmintime|20250713133914|// rain rate timestamp min of this hour:|:
rain0rate-hmax|0.00|// rain rate max of this hour:|:
rain0rate-hmaxtime|20250713133914|// rain rate timestamp max of this hour:|:
rain0rate-dmin|0.00|// rain rate min of today:|:
rain0rate-dmintime|20250713133914|// rain rate timestamp min of today:|:
rain0rate-dmax|0.00|// rain rate max of today:|:
rain0rate-dmaxtime|20250713133914|// rain rate timestamp max of today:|:
rain0rate-ydmin|0.00|// rain rate min of yesterday:|:
rain0rate-ydmintime|20250712235908|// rain rate timestamp min of yesterday:|:
rain0rate-ydmax|6.26|// rain rate max of yesterday:|:
rain0rate-ydmaxtime|20250712140228|// rain rate timestamp max of yesterday:|:
rain0rate-mmin|0.00|// rain rate min of this month:|:
rain0rate-mmintime|20250713133914|// rain rate timestamp min of this month:|:
rain0rate-mmax|6.26|// rain rate max of this month:|:
rain0rate-mmaxtime|20250712140228|// rain rate timestamp max of this month:|:
rain0rate-ymin|0.00|// rain rate min of this year:|:
rain0rate-ymintime|20250713133914|// rain rate timestamp min of this year:|:
rain0rate-ymax|6.26|// rain rate max of this year:|:
rain0rate-ymaxtime|20250712140228|// rain rate timestamp max of this year:|:
rain0rate-amin|0.00|// rain rate min of all time:|:
rain0rate-amintime|20250713133914|// rain rate timestamp min of all time:|:
rain0rate-amax|82.29|// rain rate max of all time:|:
rain0rate-amaxtime|20241101162520|// rain rate timestamp max of all time:|:
rain0rate-starttime|20220428155919|// rain rate timestamp of first recorded data:|:
rain0total-act|3.38|// rain most recent:|:
rain0total-val5|3.38|// rain value 5 minutes ago:|:
rain0total-val10|3.38|// rain value 10 minutes ago:|:
rain0total-val15|3.38|// rain value 15 minutes ago:|:
rain0total-val30|3.38|// rain value 30 minutes ago:|:
rain0total-val60|3.38|// rain value 60 minutes ago:|:
rain0total-delta2h|0.00|// rain delta 2 hours ago:|:
rain0total-delta3h|0.00|// rain delta 3 hours ago:|:
rain0total-delta6h|0.00|// rain delta 6 hours ago:|:
rain0total-delta12h|3.38|// rain delta 12 hours ago:|:
rain0total-delta24h|3.38|// rain delta 24 hours ago:|:
rain0total-avg@h48|0.00|// rain avg 48 hours ago:|:
rain0total-avg@h72|0.00|// rain avg 72 hours ago:|:
rain0total-avg@h96|0.00|// rain avg 96 hours ago:|:
rain0total-avg@h120|0.00|// rain avg 120 hours ago:|:
rain0total-avg@h144|0.00|// rain avg 144 hours ago:|:
rain0total-avg@h168|0.04|// rain avg 168 hours ago:|:
rain0total-hmin|0.00|// rain min of this hour:|:
rain0total-hmintime|20250713130002|// rain timestamp min of this hour:|:
rain0total-hmax|0.00|// rain max of this hour:|:
rain0total-hmaxtime|20250713133914|// rain timestamp max of this hour:|:
rain0total-dmin|0.00|// rain min of today:|:
rain0total-dmintime|20250713000038|// rain timestamp min of today:|:
rain0total-dmax|0.00|// rain max of today:|:
rain0total-dmaxtime|20250713133914|// rain timestamp max of today:|:
rain0total-ydmin|0.04|// rain min of yesterday:|:
rain0total-ydmintime|20250712143302|// rain timestamp min of yesterday:|:
rain0total-ydmax|1.04|// rain max of yesterday:|:
rain0total-ydmaxtime|20250712140240|// rain timestamp max of yesterday:|:
rain0total-mmin|0.16|// rain min of this month:|:
rain0total-mmintime|20250712143302|// rain timestamp min of this month:|:
rain0total-mmax|1.64|// rain max of this month:|:
rain0total-mmaxtime|20250712140240|// rain timestamp max of this month:|:
rain0total-ymin|3.07|// rain min of this year:|:
rain0total-ymintime|20250712143302|// rain timestamp min of this year:|:
rain0total-ymax|16.18|// rain max of this year:|:
rain0total-ymaxtime|20250712140240|// rain timestamp max of this year:|:
rain0total-amin|6.97|// rain min of all time:|:
rain0total-amintime|20250712143302|// rain timestamp min of all time:|:
rain0total-amax|93.84|// rain max of all time:|:
rain0total-amaxtime|20220711202142|// rain timestamp max of all time:|:
rain0total-starttime|20220428155919|// rain timestamp of first recorded data:|:
uv0index-act|5.5|// uv index most recent:|:
uv0index-val5|5.3|// uv index value 5 minutes ago:|:
uv0index-val10|4.5|// uv index value 10 minutes ago:|:
uv0index-val15|3.9|// uv index value 15 minutes ago:|:
uv0index-val30|4.2|// uv index value 30 minutes ago:|:
uv0index-val60|4.2|// uv index value 60 minutes ago:|:
uv0index-hmin|3.7|// uv index min of this hour:|:
uv0index-hmintime|20250713132634|// uv index timestamp min of this hour:|:
uv0index-hmax|6.0|// uv index max of this hour:|:
uv0index-hmaxtime|20250713130030|// uv index timestamp max of this hour:|:
uv0index-dmin|0.0|// uv index min of today:|:
uv0index-dmintime|20250713070308|// uv index timestamp min of today:|:
uv0index-dmax|6.0|// uv index max of today:|:
uv0index-dmaxtime|20250713130030|// uv index timestamp max of today:|:
uv0index-ydmin|0.0|// uv index min of yesterday:|:
uv0index-ydmintime|20250712235923|// uv index timestamp min of yesterday:|:
uv0index-ydmax|7.7|// uv index max of yesterday:|:
uv0index-ydmaxtime|20250712130943|// uv index timestamp max of yesterday:|:
uv0index-mmin|0.0|// uv index min of this month:|:
uv0index-mmintime|20250713070308|// uv index timestamp min of this month:|:
uv0index-mmax|8.5|// uv index max of this month:|:
uv0index-mmaxtime|20250705133017|// uv index timestamp max of this month:|:
uv0index-ymin|0.0|// uv index min of this year:|:
uv0index-ymintime|20250713070308|// uv index timestamp min of this year:|:
uv0index-ymax|8.6|// uv index max of this year:|:
uv0index-ymaxtime|20250627130457|// uv index timestamp max of this year:|:
uv0index-amin|0.0|// uv index min of all time:|:
uv0index-amintime|20250713070308|// uv index timestamp min of all time:|:
uv0index-amax|8.7|// uv index max of all time:|:
uv0index-amaxtime|20240629132412|// uv index timestamp max of all time:|:
uv0index-starttime|20220428155919|// uv index timestamp of first recorded data:|:
sol0rad-act|805|// solar rad most recent:|:
sol0rad-val5|761|// solar rad value 5 minutes ago:|:
sol0rad-val10|535|// solar rad value 10 minutes ago:|:
sol0rad-val15|524|// solar rad value 15 minutes ago:|:
sol0rad-val30|615|// solar rad value 30 minutes ago:|:
sol0rad-val60|601|// solar rad value 60 minutes ago:|:
sol0rad-hmin|473|// solar rad min of this hour:|:
sol0rad-hmintime|20250713132719|// solar rad timestamp min of this hour:|:
sol0rad-hmax|969|// solar rad max of this hour:|:
sol0rad-hmaxtime|20250713130029|// solar rad timestamp max of this hour:|:
sol0rad-dmin|0|// solar rad min of today:|:
sol0rad-dmintime|20250713060008|// solar rad timestamp min of today:|:
sol0rad-dmax|979|// solar rad max of today:|:
sol0rad-dmaxtime|20250713125623|// solar rad timestamp max of today:|:
sol0rad-ydmin|0|// solar rad min of yesterday:|:
sol0rad-ydmintime|20250712235912|// solar rad timestamp min of yesterday:|:
sol0rad-ydmax|1136|// solar rad max of yesterday:|:
sol0rad-ydmaxtime|20250712133834|// solar rad timestamp max of yesterday:|:
sol0rad-mmin|0|// solar rad min of this month:|:
sol0rad-mmintime|20250713060008|// solar rad timestamp min of this month:|:
sol0rad-mmax|1143|// solar rad max of this month:|:
sol0rad-mmaxtime|20250705133102|// solar rad timestamp max of this month:|:
sol0rad-ymin|0|// solar rad min of this year:|:
sol0rad-ymintime|20250713060008|// solar rad timestamp min of this year:|:
sol0rad-ymax|1433|// solar rad max of this year:|:
sol0rad-ymaxtime|20250514141152|// solar rad timestamp max of this year:|:
sol0rad-amin|0|// solar rad min of all time:|:
sol0rad-amintime|20250713060008|// solar rad timestamp min of all time:|:
sol0rad-amax|1456|// solar rad max of all time:|:
sol0rad-amaxtime|20240630140805|// solar rad timestamp max of all time:|:
sol0rad-starttime|20220428155731|// solar rad timestamp of first recorded data:|:
rain0total-daysum|0.00|// rain total today:|:
rain0total-monthsum|1.64|// rain total this month:|:
rain0total-yearsum|16.18|// rain total this year:|:
rain0total-ydaysum|1.04|// rain total yesterday:|:
rain0total-sum60|0.00|// rain total last 60 minutes:|:
sol0evo-daysum|--|// solar evo total today:|:
sol0evo-monthsum|--|// solar evo total this month:|:
sol0evo-yearsum|--|// solar evo total this year:|:
sol0evo-ydaysum|--|// solar evo total yesterday:|:
sol0evo-sum60|--|// solar evo total last 60 minutes:|:
sol0evo-sum24h|--|// solar evo total last 24 hours:|:
sol0evo-allsum|--|// solar evo total all time:|:
th0heatindex-act|26.2|// outdoor heat index most recent:|:
th0heatindex-val5|26.2|// outdoor heat index value 5 minutes ago:|:
th0heatindex-val10|25.8|// outdoor heat index value 10 minutes ago:|:
th0heatindex-val15|25.8|// outdoor heat index value 15 minutes ago:|:
th0heatindex-val30|26.4|// outdoor heat index value 30 minutes ago:|:
th0heatindex-val60|25.3|// outdoor heat index value 60 minutes ago:|:
th0heatindex-hmin|25.8|// outdoor heat index min of this hour:|:
th0heatindex-hmintime|20250713133000|// outdoor heat index timestamp min of this hour:|:
th0heatindex-hmax|27.9|// outdoor heat index max of this hour:|:
th0heatindex-hmaxtime|20250713130503|// outdoor heat index timestamp max of this hour:|:
th0heatindex-dmin|18.9|// outdoor heat index min of today:|:
th0heatindex-dmintime|20250713040730|// outdoor heat index timestamp min of today:|:
th0heatindex-dmax|27.9|// outdoor heat index max of today:|:
th0heatindex-dmaxtime|20250713130503|// outdoor heat index timestamp max of today:|:
th0heatindex-ydmin|19.7|// outdoor heat index min of yesterday:|:
th0heatindex-ydmintime|20250712063503|// outdoor heat index timestamp min of yesterday:|:
th0heatindex-ydmax|33.9|// outdoor heat index max of yesterday:|:
th0heatindex-ydmaxtime|20250712133707|// outdoor heat index timestamp max of yesterday:|:
th0heatindex-mmin|11.7|// outdoor heat index min of this month:|:
th0heatindex-mmintime|20250704042805|// outdoor heat index timestamp min of this month:|:
th0heatindex-mmax|37.0|// outdoor heat index max of this month:|:
th0heatindex-mmaxtime|20250705154905|// outdoor heat index timestamp max of this month:|:
th0heatindex-ymin|-18.7|// outdoor heat index min of this year:|:
th0heatindex-ymintime|20250121233210|// outdoor heat index timestamp min of this year:|:
th0heatindex-ymax|43.9|// outdoor heat index max of this year:|:
th0heatindex-ymaxtime|20250623162309|// outdoor heat index timestamp max of this year:|:
th0heatindex-amin|-18.7|// outdoor heat index min of all time:|:
th0heatindex-amintime|20250121233210|// outdoor heat index timestamp min of all time:|:
th0heatindex-amax|43.9|// outdoor heat index max of all time:|:
th0heatindex-amaxtime|20250623162309|// outdoor heat index timestamp max of all time:|:
th0heatindex-starttime|20220428151508|// outdoor heat index timestamp of first recorded data:|:
wind0dir-min10|59|// wind direction min 10 minutes:|:
wind0dir-max10|358|// wind direction max 10 minutes:|:
'
// END_OF_RAW_DATA_LINES;

// end of generation script

// put data in  array
//
$WX = array();
global 
$WX;
$WXComment = array();
$data explode(":|:",$rawdatalines);
$nscanned 0;
foreach (
$data as $v => $line) {
  list(
$vname,$vval,$vcomment) = explode("|",trim($line).'|||');
  if (
$vname <> "" and strpos($vval,'$') === false) {
    
$WX[$vname] = trim($vval);
    if(
$vcomment <> "") { $WXComment[$vname] = trim($vcomment); }
  }
  
$nscanned++;
}
if(isset(
$_REQUEST['debug'])) {
  print 
"<!-- loaded $nscanned $WXsoftware \$WX[] entries -->\n";
}

if (isset(
$_REQUEST["sce"]) and strtolower($_REQUEST["sce"]) == "dump" ) {

  print 
"<pre>\n";
  print 
"// \$WX[] array size = $nscanned entries.\n";
  foreach (
$WX as $key => $val) {
      
$t =  "\$WX['$key'] = '$val';";
      if(isset(
$WXComment[$key])) {$t .=  $WXComment[$key]"; }
      print 
"$t\n";
  }
  print 
"</pre>\n";

}
if(
file_exists("MB-defs.php")) { include_once("MB-defs.php"); }
?>

./MB-defs.php permissions=-rwxr-xr-x [0755]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157

<?php
/*
 File: MB-defs.php

 Purpose: provide a bridge to naming of weather variables from the native Meteobridge software package to
          Weather-Display names used in common scripts like ajax-dashboard.php and ajax-gizmo.php

 
 Author: Ken True - webmaster@saratoga-weather.org

 (created by gen-defs.php - V1.09 - 02-Mar-2013)
 Generated on 2013-03-02 11:03:58 PST

//Version MB-defs.php - V1.00 - 08-Mar-2013
//Version MB-defs.php - V1.01 - 09-Mar-2013 - fixes for stations w/o solar and/or UV sensors
//Version MB-defs.php - V1.02 - 17-Mar-2013 - added processing for new Meteobridge system variables
//Version MB-defs.php - V1.03 - 19-Aug-2013 - added Davis forecast text support Meteobridge 1.8(2198)+
//Version MB-defs.php - V1.04 - 08-Feb-2014 - corrected $yearrn to use rain0rain-yearsum variable
//Version MB-defs.php - V1.05 - 28-May-2020 - fix multiple Notice errata for missing data
//Version MB-defs.php - V1.06 - 26-Jan-2022 - fixes for PHP 8.1
//Version MB-defs.php - V1.07 - 20-Jun-2023 - additional variables added by meteoalmendralejo.es for MB-trends-inc
*/
// --------------------------------------------------------------------------

// allow viewing of generated source

if (isset($_REQUEST["sce"]) and strtolower($_REQUEST["sce"]) == "view" ) {
//--self downloader --
   
$filenameReal __FILE__;
   
$download_size filesize($filenameReal);
   
header("Pragma: public");
   
header("Cache-Control: private");
   
header("Cache-Control: no-cache, must-revalidate");
   
header("Content-type: text/plain");
   
header("Accept-Ranges: bytes");
   
header("Content-Length: $download_size");
   
header("Connection: close");
   
   
readfile($filenameReal);
   exit;
}
error_reporting(E_ALL);
ini_set('display_errors','1');
$WXsoftware 'MB';  
// this has WD $varnames = $WX['MB-varnames']; equivalents
 
$uomtemp $WX['uomTemp'];
$uombaro $WX['uomBaro'];
$uomwind $WX['uomWind'];
$uomrain $WX['uomRain'];
$time $WX['time'];
$date $WX['date'];
$temperature $WX['th0temp-act'];
$tempnodp  round($temperature,0); // calculated value
$humidity $WX['th0hum-act'];
$dewpt $WX['th0dew-act'];
$maxtemp $WX['th0temp-dmax'];
$mintemp $WX['th0temp-dmin'];
$maxhum $WX['th0hum-dmax']; // Añadido por AGallardo
$minhum $WX['th0hum-dmin']; // Añadido por AGallardo
$windch $WX['wind0chill-act'];
$heatindexact = isset($WX['th0heatindex-act'])?$WX['th0heatindex-act']:'--'// Añadido por AGallardo
$windchnodp  round($windch,0); // calculated value
$maxtempyest $WX['th0temp-ydmax'];
$mintempyest $WX['th0temp-ydmin'];
$maxhumyest $WX['th0hum-ydmax']; // Añadido por AGallardo
$minhumyest $WX['th0hum-ydmin']; // Añadido por AGallardo
$actspd $WX['wind0wind-act']; // Añadido por AGallardo
$avgspd $WX['wind0avgwind-act'];
$gstspd $WX['wind0wind-hmax'];
$maxgst $WX['wind0wind-dmax'];
$maxgstye $WX['wind0wind-ydmax']; // Añadido por AGallardo
$maxgsthr $WX['wind0wind-hmax'];
$maxavgspdhr $WX['wind0avgwind-hmax']; // Añadido por AGallardo
$maxavgspddy $WX['wind0avgwind-dmax']; // Añadido por AGallardo
$maxavgspdye $WX['wind0avgwind-ydmax']; // Añadido por AGallardo
$dirdeg $WX['wind0dir-act'];
$dirlabel  MB_deg2dir($dirdeg); // calculated value
$baro $WX['thb0seapress-act'];
$dayrn $WX['rain0total-daysum'];
$monthrn $WX['rain0total-monthsum'];
$yearrn $WX['rain0total-yearsum'];
$currentrainratehr $WX['rain0rate-act'];
$maxrainrate $WX['rain0rate-dmax'];
$maxrainratehr $WX['rain0rate-hmax'];
$maxrainrateyest $WX['rain0rate-ydmax']; // Añadido por AGallardo
$yesterdayrain $WX['rain0total-ydaysum'];
$mrecordwindgust $WX['wind0wind-mmax'];
$highbaro $WX['thb0seapress-dmax'];
$hourrn $WX['rain0total-sum60'];
$minchillyest $WX['wind0chill-ydmin'];
$minwindch $WX['wind0chill-dmin'];
$maxheatindexyest = isset($WX['th0heatindex-ydmax'])?$WX['th0heatindex-ydmax']:'--'// Añadido por AGallardo
$maxheatindex = isset($WX['th0heatindex-dmax'])?$WX['th0heatindex-dmax']:'--'// Añadido por AGallardo
$minbaroyest $WX['thb0seapress-ydmin']; // Añadido por AGallardo
$maxbaroyest $WX['thb0seapress-ydmax']; // Añadido por AGallardo

// end of generation script

// manual adds

if(MB_isData('mbsystem-swversion')) {
  
$wdversiononly $WX['mbsystem-swversion'];
  
$wdbuild = (MB_isData('mbsystem-buildnum'))?$WX['mbsystem-buildnum']:'n/a';
  
$wdplatform = (MB_isData('mbsystem-platform'))?$WX['mbsystem-platform']:'';
  
$wdversion $WX['mbsystem-swversion'] . ' build '.$wdbuild' '$wdplatform;
  
$wduptime $WX['mbsystem-uptime']; // Añadido por AGallardo
  
if ($wduptime >0$wduptimetext floor($wduptime 86400)." d ".floor(($wduptime 86400) / 3600)." h ".floor(($wduptime 3600) / 60)." m"// Añadido por AGallardo
  
$wdlastgooddata = isset($WX['mbsystem-lastgooddata'])?$WX['mbsystem-lastgooddata']:''// Añadido por AGallardo
  
$wdsolarmax = isset($WX['mbsystem-solarmax'])?$WX['mbsystem-solarmax']:'--'// Añadido por AGallardo
  
$Startimedate $WX['wind0wind-starttime']; // Añadido por AGallardo
  
$timeStartimedate MB_timeOnly($Startimedate); // Añadido por AGallardo
  
$dayStartimedate substr($Startimedate,6,2); // Añadido por AGallardo
  
$monthStartimedate substr($Startimedate,4,2); // Añadido por AGallardo
  
$yearStartimedate substr($Startimedate,0,4); // Añadido por AGallardo
}

$heatidx MB_calcHeatIndex($temperature,$humidity,$uomtemp);

if(
MB_isData('sol0rad-act')) { 
 
$VPsolar $WX['sol0rad-act'];
 if (
$wdsolarmax>0$currentsolarpercent round(($VPsolar $wdsolarmax) * 100); // Añadido por AGallardo
 
$highsolaryest $WX['sol0rad-ydmax'];
 
$highsolar $WX['sol0rad-dmax']; // fix this one! max instead of min
 
if ($wdsolarmax>0$highsolarpercent round(($highsolar $wdsolarmax) * 100); // Añadido por AGallardo
 
$dayevo = isset($WX['sol0evo-daysum'])?$WX['sol0evo-daysum']:'--'// Añadido por AGallardo
 
$yesterdayevo = isset($WX['sol0evo-ydaysum'])?$WX['sol0evo-ydaysum']:'--'// Añadido por AGallardo
 
$hourevo = isset($WX['sol0evo-sum60'])?$WX['sol0evo-sum60']:'--'// Añadido por AGallardo
 
$monthevo = isset($WX['sol0evo-monthsum'])?$WX['sol0evo-monthsum']:'--'// Añadido por AGallardo
 
$yearevo = isset($WX['sol0evo-yearsum'])?$WX['sol0evo-yearsum']:'--'// Añadido por AGallardo
 
}
if(
MB_isData('sol0rad-dmaxtime')) {$highsolartime MB_timeOnly($WX['sol0rad-dmaxtime']);} 
if(
MB_isData('sol0rad-ydmaxtime')) {$highsolaryesttime MB_timeOnly($WX['sol0rad-ydmaxtime']);}

if(
MB_isData('uv0index-act')) {
  
$VPuv $WX['uv0index-act'];
  
$highuv $WX['uv0index-dmax'];
  
$highuvyest $WX['uv0index-ydmax'];
}
if(
MB_isData('uv0index-dmaxtime')) {$highuvtime MB_timeOnly($WX['uv0index-dmaxtime']);}
if(
MB_isData('uv0index-ydmaxtime')) {$highuvyesttime MB_timeOnly($WX['uv0index-ydmaxtime']);}

if(
MB_isData('rain0rate-hmaxtime')) {$highrrhtime MB_timeOnly($WX['rain0rate-hmaxtime']);} // Añadido por AGallardo
if(MB_isData('rain0rate-dmaxtime')) {$highrrtime MB_timeOnly($WX['rain0rate-dmaxtime']);} // Añadido por AGallardo
if(MB_isData('rain0rate-ydmaxtime')) {$highrryesttime MB_timeOnly($WX['rain0rate-ydmaxtime']);} // Añadido por AGallardo

if(MB_isData('th0hum-dmaxtime')) {$maxhumt MB_timeOnly($WX['th0hum-dmaxtime']);} // Añadido por AGallardo
if(MB_isData('th0hum-dmintime')) {$minhumt MB_timeOnly($WX['th0hum-dmintime']);} // Añadido por AGallardo
if(MB_isData('th0hum-ydmaxtime')) {$maxhumyestt MB_timeOnly($WX['th0hum-ydmaxtime']);} // Añadido por AGallardo
if(MB_isData('th0hum-ydmintime')) {$minhumyestt MB_timeOnly($WX['th0hum-ydmintime']);} // Añadido por AGallardo

if(MB_isData('th0temp-dmaxtime')) {$maxtempt MB_timeOnly($WX['th0temp-dmaxtime']);}
if(
MB_isData('th0temp-dmintime')) {$mintempt MB_timeOnly($WX['th0temp-dmintime']);}
if(
MB_isData('th0temp-ydmaxtime')) {$maxtempyestt MB_timeOnly($WX['th0temp-ydmaxtime']);}
if(
MB_isData('th0temp-ydmintime')) {$mintempyestt MB_timeOnly($WX['th0temp-ydmintime']);}
if(
MB_isData('wind0chill-dmintime')) {$minwindcht MB_timeOnly($WX['wind0chill-dmintime']);}
if(
MB_isData('wind0chill-ydmintime')) {$minchillyestt MB_timeOnly($WX['wind0chill-ydmintime']);} // Añadido por AGallardo
if(MB_isData('th0heatindex-dmaxtime')) {$maxheatindext MB_timeOnly($WX['th0heatindex-dmaxtime']);} // Añadido por AGallardo
if(MB_isData('th0heatindex-ydmaxtime')) {$maxheatindexyestt MB_timeOnly($WX['th0heatindex-ydmaxtime']);} // Añadido por AGallardo


if(MB_isData('wind0wind-mmaxtime')) {$mrecordwindgustt MB_timeOnly($WX['wind0wind-mmaxtime']);}
if(
MB_isData('wind0wind-hmaxtime')) {$hrecordwindgustt MB_timeOnly($WX['wind0wind-hmaxtime']);} // Añadido por AGallardo
if(MB_isData('wind0wind-ydmaxtime')) {$yestrecordwindgustt MB_timeOnly($WX['wind0wind-ydmaxtime']);} // Añadido por AGallardo

if(MB_isData('wind0avgwind-hmaxtime')) {$hrecordavgwindt MB_timeOnly($WX['wind0avgwind-hmaxtime']);} // Añadido por AGallardo
if(MB_isData('wind0avgwind-dmaxtime')) {$drecordavgwindt MB_timeOnly($WX['wind0avgwind-dmaxtime']);} // Añadido por AGallardo
if(MB_isData('wind0avgwind-ydmaxtime')) {$yestrecordavgwindt MB_timeOnly($WX['wind0avgwind-ydmaxtime']);} // Añadido por AGallardo

if(MB_isData('thb0seapress-dmaxtime')) {$highbarot MB_timeOnly($WX['thb0seapress-dmaxtime']);}
if(
MB_isData('thb0seapress-ydmaxtime')) {$maxbaroyestt MB_timeOnly($WX['thb0seapress-ydmaxtime']);} // Añadido por AGallardo
if(MB_isData('thb0seapress-ydmintime')) {$minbaroyestt MB_timeOnly($WX['thb0seapress-ydmintime']);} // Añadido por AGallardo

// change last hour

if(MB_isData('th0temp-val60')) {
    
$tempchangehour $WX['th0temp-act']-$WX['th0temp-val60'];
}

if(
MB_isData('th0hum-val60')) {
    
$humchangelasthour $WX['th0hum-act']-$WX['th0hum-val60'];
}

if(
MB_isData('th0dew-val60')) {
    
$dewchangelasthour $WX['th0dew-act']-$WX['th0dew-val60'];
}

if(
MB_isData('thb0seapress-val60')) {
    
$trend $WX['thb0seapress-act']-$WX['thb0seapress-val60'];
    
$pressuretrendname MB_get_barotrend_text($trend,$uombaro);
} else {
    
$pressuretrendname '--';
}

$lowbaro $WX['thb0seapress-dmin'];
$lowbarot MB_timeOnly($WX['thb0seapress-dmintime']);
$maxgstdirectionletter ' '// not collected data
$maxgstt MB_timeOnly($WX['wind0wind-dmaxtime']);

// trends info
$temp0minuteago $WX['th0temp-act'];
$wind0minuteago $WX['wind0avgwind-act'];
$dir0minuteagodeg $WX['wind0dir-act']; // Añadido por AGallardo
$dir0minuteago =  MB_deg2dir($dir0minuteagodeg); // Modificado por AGallardo
$hum0minuteago =  $WX['th0hum-act'];
$dew0minuteago =  $WX['th0dew-act'];
$baro0minuteago $WX['thb0seapress-act'];
$rain0minuteago $WX['rain0total-daysum'];
$rainDP = ( preg_match('|mm|i',$uomrain) )?'%01.1F':'%01.2F';
$rainrate0minuteago $WX['rain0rate-act']; // Añadido por AGallardo

if ( MB_isdata('th0temp-val5') ) { // only set if the variable has valid data
  
$temp5minuteago $WX['th0temp-val5'];
  
$wind5minuteago $WX['wind0avgwind-val5'];
  
$dir5minuteagodeg $WX['wind0dir-val5']; // Añadido por AGallardo
  
$dir5minuteago =  MB_deg2dir($dir5minuteagodeg); // Modificado por AGallardo
  
$hum5minuteago =  $WX['th0hum-val5'];
  
$dew5minuteago =  $WX['th0dew-val5'];
  
$baro5minuteago $WX['thb0seapress-val5'];
  
$rain5minuteago sprintf($rainDP,$WX['rain0total-val5']-$WX['rain0total-ydmin']); // should be dmax!
  
$rainrate5minuteago $WX['rain0rate-val5']; // Añadido por AGallardo
}

if ( 
MB_isdata('th0temp-val10') ) { // only set if the variable has valid data
  
$temp10minuteago $WX['th0temp-val10'];
  
$wind10minuteago $WX['wind0avgwind-val10'];
  
$dir10minuteagodeg $WX['wind0dir-val10']; // Añadido por AGallardo
  
$dir10minuteago =  MB_deg2dir($dir5minuteagodeg); // Modificado por AGallardo
  
$hum10minuteago =  $WX['th0hum-val10'];
  
$dew10minuteago =  $WX['th0dew-val10'];
  
$baro10minuteago $WX['thb0seapress-val10'];
  
$rain10minuteago sprintf($rainDP,$WX['rain0total-val10']-$WX['rain0total-ydmin']); // should be dmax!
  
$rainrate10minuteago $WX['rain0rate-val10']; // Añadido por AGallardo
}

if ( 
MB_isdata('th0temp-val15') ) { // only set if the variable has valid data
  
$temp15minuteago $WX['th0temp-val15'];
  
$wind15minuteago $WX['wind0avgwind-val15'];
  
$dir15minuteagodeg $WX['wind0dir-val15']; // Añadido por AGallardo
  
$dir15minuteago =  MB_deg2dir($dir5minuteagodeg); // Modificado por AGallardo
  
$hum15minuteago =  $WX['th0hum-val15'];
  
$dew15minuteago =  $WX['th0dew-val15'];
  
$baro15minuteago $WX['thb0seapress-val15'];
  
$rain15minuteago sprintf($rainDP,$WX['rain0total-val15']-$WX['rain0total-ydmin']); // should be dmax!
  
$rainrate15minuteago $WX['rain0rate-val15']; // Añadido por AGallardo
}

if ( 
MB_isdata('th0temp-val30') ) { // only set if the variable has valid data
  
$temp30minuteago $WX['th0temp-val30'];
  
$wind30minuteago $WX['wind0avgwind-val30'];
  
$dir30minuteagodeg $WX['wind0dir-val30']; // Añadido por AGallardo
  
$dir30minuteago =  MB_deg2dir($dir5minuteagodeg); // Modificado por AGallardo
  
$hum30minuteago =  $WX['th0hum-val30'];
  
$dew30minuteago =  $WX['th0dew-val30'];
  
$baro30minuteago $WX['thb0seapress-val30'];
  
$rain30minuteago sprintf($rainDP,$WX['rain0total-val30']-$WX['rain0total-ydmin']); // should be dmax!
  
$rainrate30minuteago $WX['rain0rate-val30']; // Añadido por AGallardo
}

if ( 
MB_isdata('th0temp-val60') ) { // only set if the variable has valid data
  
$temp60minuteago $WX['th0temp-val60'];
  
$wind60minuteago $WX['wind0avgwind-val60'];
  
$dir60minuteagodeg $WX['wind0dir-val60']; // Añadido por AGallardo
  
$dir60minuteago =  MB_deg2dir($dir5minuteagodeg); // Modificado por AGallardo
  
$hum60minuteago =  $WX['th0hum-val60'];
  
$dew60minuteago =  $WX['th0dew-val60'];
  
$baro60minuteago $WX['thb0seapress-val60'];
  
$rain60minuteago sprintf($rainDP,$WX['rain0total-val60']-$WX['rain0total-ydmin']); // should be dmax!
  
$rainrate60minuteago $WX['rain0rate-val60']; // Añadido por AGallardo
}

if ( 
MB_isdata('th0temp-delta2h') ) { // only set if the variable has valid data por AGallardo
  
$temp2hourago = ($temp0minuteago $WX['th0temp-delta2h']);
  
$wind2hourago = ($wind0minuteago $WX['wind0avgwind-delta2h']);
  
$dir2houragodeg = ($dir0minuteagodeg $WX['wind0dir-delta2h']);
  
$dir2hourago =  MB_deg2dir($dir2houragodeg);
  
$hum2hourago = ($hum0minuteago $WX['th0hum-delta2h']);
  
$dew2hourago = ($dew0minuteago $WX['th0dew-delta2h']);
  
$baro2hourago = ($baro0minuteago $WX['thb0seapress-delta2h']);
  
$rain2hourago sprintf($rainDP,($WX['rain0total-act']-$WX['rain0total-delta2h']-$WX['rain0total-ydmin'])); // should be dmax!
  
$rainrate2hourago number_format($rainrate0minuteago $WX['rain0rate-delta2h'], 1'.''');
}

if ( 
MB_isdata('th0temp-delta3h') ) { // only set if the variable has valid data por AGallardo
  
$temp3hourago = ($temp0minuteago $WX['th0temp-delta3h']);
  
$wind3hourago = ($wind0minuteago $WX['wind0avgwind-delta3h']);
  
$dir3houragodeg = ($dir0minuteagodeg $WX['wind0dir-delta3h']);
  
$dir3hourago =  MB_deg2dir($dir3houragodeg);
  
$hum3hourago = ($hum0minuteago $WX['th0hum-delta3h']);
  
$dew3hourago = ($dew0minuteago $WX['th0dew-delta3h']);
  
$baro3hourago = ($baro0minuteago $WX['thb0seapress-delta3h']);
  
$rain3hourago sprintf($rainDP,($WX['rain0total-act']-$WX['rain0total-delta3h']-$WX['rain0total-ydmin'])); // should be dmax!
  
$rainrate3hourago number_format($rainrate0minuteago $WX['rain0rate-delta3h'], 1'.''');
}

if ( 
MB_isdata('th0temp-delta6h') ) { // only set if the variable has valid data por AGallardo
  
$temp6hourago = ($temp0minuteago $WX['th0temp-delta6h']);
  
$wind6hourago = ($wind0minuteago $WX['wind0avgwind-delta6h']);
  
$dir6houragodeg = ($dir0minuteagodeg $WX['wind0dir-delta6h']);
  
$dir6hourago =  MB_deg2dir($dir6houragodeg);
  
$hum6hourago = ($hum0minuteago $WX['th0hum-delta6h']);
  
$dew6hourago = ($dew0minuteago $WX['th0dew-delta6h']);
  
$baro6hourago = ($baro0minuteago $WX['thb0seapress-delta6h']);
  
$rain6hourago sprintf($rainDP,($WX['rain0total-act']-$WX['rain0total-delta6h']-$WX['rain0total-ydmin'])); // should be dmax!
  
$rainrate6hourago number_format($rainrate0minuteago $WX['rain0rate-delta6h'], 1'.''');
}

if ( 
MB_isdata('th0temp-delta12h') ) { // only set if the variable has valid data por AGallardo
  
$temp12hourago = ($temp0minuteago $WX['th0temp-delta12h']);
  
$wind12hourago = ($wind0minuteago $WX['wind0avgwind-delta12h']);
  
$dir12houragodeg = ($dir0minuteagodeg $WX['wind0dir-delta12h']);
  
$dir12hourago =  MB_deg2dir($dir12houragodeg);
  
$hum12hourago = ($hum0minuteago $WX['th0hum-delta12h']);
  
$dew12hourago = ($dew0minuteago $WX['th0dew-delta12h']);
  
$baro12hourago = ($baro0minuteago $WX['thb0seapress-delta12h']);
  
$rain12hourago sprintf($rainDP,($WX['rain0total-act']-$WX['rain0total-delta12h']-$WX['rain0total-ydmin'])); // should be dmax!
  
$rainrate12hourago number_format($rainrate0minuteago $WX['rain0rate-delta12h'], 1'.''');
}

if ( 
MB_isdata('th0temp-delta24h') ) { // only set if the variable has valid data por AGallardo
  
$temp24hourago = ($temp0minuteago $WX['th0temp-delta24h']);
  
$temp24hoursago $temp24hourago// Pasamos la variable para utilizarla en el cuadro de mandos
  
$wind24hourago = ($wind0minuteago $WX['wind0avgwind-delta24h']);
  
$dir24houragodeg = ($dir0minuteagodeg $WX['wind0dir-delta24h']);
  
$dir24hourago =  MB_deg2dir($dir24houragodeg);
  
$hum24hourago = ($hum0minuteago $WX['th0hum-delta24h']);
  
$dew24hourago = ($dew0minuteago $WX['th0dew-delta24h']);
  
$baro24hourago = ($baro0minuteago $WX['thb0seapress-delta24h']);
  
$rain24hourago sprintf($rainDP,($WX['rain0total-act']-$WX['rain0total-delta24h']-$WX['rain0total-ydmin'])); // should be dmax!
  
$rainrate24hourago number_format($rainrate0minuteago $WX['rain0rate-delta24h'], 1'.''');
}

if ( 
MB_isdata('th0temp-avg@h48') ) { // only set if the variable has valid data por AGallardo
  
$temp2dayago $WX['th0temp-avg@h48'];
  
$wind2dayago $WX['wind0avgwind-avg@h48'];
  
$dir2dayagodeg $WX['wind0dir-avg@h48'];
  
$dir2dayago =  MB_deg2dir($dir2dayagodeg);
  
$hum2dayago $WX['th0hum-avg@h48'];
  
$dew2dayago $WX['th0dew-avg@h48'];
  
$baro2dayago $WX['thb0seapress-avg@h48'];
  
$rain2dayago sprintf($rainDP,($WX['rain0total-avg@h48']-$WX['rain0total-ydmin'])); // should be dmax!
  
$rainrate2dayago $WX['rain0rate-avg@h48']; // Añadido por AGallardo
}

if ( 
MB_isdata('th0temp-avg@h72') ) { // only set if the variable has valid data por AGallardo
  
$temp3dayago $WX['th0temp-avg@h72'];
  
$wind3dayago $WX['wind0avgwind-avg@h72'];
  
$dir3dayagodeg $WX['wind0dir-avg@h72'];
  
$dir3dayago =  MB_deg2dir($dir3dayagodeg);
  
$hum3dayago $WX['th0hum-avg@h72'];
  
$dew3dayago $WX['th0dew-avg@h72'];
  
$baro3dayago $WX['thb0seapress-avg@h72'];
  
$rain3dayago sprintf($rainDP,($WX['rain0total-avg@h72']-$WX['rain0total-ydmin'])); // should be dmax!
  
$rainrate3dayago $WX['rain0rate-avg@h72']; // Añadido por AGallardo
}

if ( 
MB_isdata('th0temp-avg@h96') ) { // only set if the variable has valid data por AGallardo
  
$temp4dayago $WX['th0temp-avg@h96'];
  
$wind4dayago $WX['wind0avgwind-avg@h96'];
  
$dir4dayagodeg $WX['wind0dir-avg@h96'];
  
$dir4dayago =  MB_deg2dir($dir4dayagodeg);
  
$hum4dayago $WX['th0hum-avg@h96'];
  
$dew4dayago $WX['th0dew-avg@h96'];
  
$baro4dayago $WX['thb0seapress-avg@h96'];
  
$rain4dayago sprintf($rainDP,($WX['rain0total-avg@h96']-$WX['rain0total-ydmin'])); // should be dmax!
  
$rainrate4dayago $WX['rain0rate-avg@h96']; // Añadido por AGallardo
}

if ( 
MB_isdata('th0temp-avg@h120') ) { // only set if the variable has valid data por AGallardo
  
$temp5dayago $WX['th0temp-avg@h120'];
  
$wind5dayago $WX['wind0avgwind-avg@h120'];
  
$dir5dayagodeg $WX['wind0dir-avg@h120'];
  
$dir5dayago =  MB_deg2dir($dir5dayagodeg);
  
$hum5dayago $WX['th0hum-avg@h120'];
  
$dew5dayago $WX['th0dew-avg@h120'];
  
$baro5dayago $WX['thb0seapress-avg@h120'];
  
$rain5dayago sprintf($rainDP,($WX['rain0total-avg@h120']-$WX['rain0total-ydmin'])); // should be dmax!
  
$rainrate5dayago $WX['rain0rate-avg@h120']; // Añadido por AGallardo
}

if ( 
MB_isdata('th0temp-avg@h144') ) { // only set if the variable has valid data por AGallardo
  
$temp6dayago $WX['th0temp-avg@h144'];
  
$wind6dayago $WX['wind0avgwind-avg@h144'];
  
$dir6dayagodeg $WX['wind0dir-avg@h144'];
  
$dir6dayago =  MB_deg2dir($dir6dayagodeg);
  
$hum6dayago $WX['th0hum-avg@h144'];
  
$dew6dayago $WX['th0dew-avg@h144'];
  
$baro6dayago $WX['thb0seapress-avg@h144'];
  
$rain6dayago sprintf($rainDP,($WX['rain0total-avg@h144']-$WX['rain0total-ydmin'])); // should be dmax!
  
$rainrate6dayago $WX['rain0rate-avg@h144']; // Añadido por AGallardo
}

if ( 
MB_isdata('th0temp-avg@h168') ) { // only set if the variable has valid data por AGallardo
  
$temp7dayago $WX['th0temp-avg@h168'];
  
$wind7dayago $WX['wind0avgwind-avg@h168'];
  
$dir7dayagodeg $WX['wind0dir-avg@h168'];
  
$dir7dayago =  MB_deg2dir($dir7dayagodeg);
  
$hum7dayago $WX['th0hum-avg@h168'];
  
$dew7dayago $WX['th0dew-avg@h168'];
  
$baro7dayago $WX['thb0seapress-avg@h168'];
  
$rain7dayago sprintf($rainDP,($WX['rain0total-avg@h168']-$WX['rain0total-ydmin'])); // should be dmax!
  
$rainrate7dayago $WX['rain0rate-avg@h168']; // Añadido por AGallardo
}

$mrecordhighbaro $WX['thb0seapress-mmax'];
$mrecordhighbaroday substr($WX['thb0seapress-mmaxtime'],6,2);
$mrecordhighbaromonth substr($WX['thb0seapress-mmaxtime'],4,2);
$mrecordhighbaroyear substr($WX['thb0seapress-mmaxtime'],0,4);

$mrecordlowbaro $WX['thb0seapress-mmin'];
$mrecordlowbaroday substr($WX['thb0seapress-mmintime'],6,2);
$mrecordlowbaromonth substr($WX['thb0seapress-mmintime'],4,2);
$mrecordlowbaroyear substr($WX['thb0seapress-mmintime'],0,4);

$mrecordhightemp $WX['th0temp-mmax'];
$mrecordhightempday substr($WX['th0temp-mmaxtime'],6,2);
$mrecordhightempmonth substr($WX['th0temp-mmaxtime'],4,2);
$mrecordhightempyear substr($WX['th0temp-mmaxtime'],0,4);

$mrecordlowtemp $WX['th0temp-mmin'];
$mrecordlowtempday substr($WX['th0temp-mmintime'],6,2);
$mrecordlowtempmonth substr($WX['th0temp-mmintime'],4,2);
$mrecordlowtempyear substr($WX['th0temp-mmintime'],0,4);

$mrecordhighhum $WX['th0hum-mmax']; // Añadido por AGallardo
$mrecordhighhumday substr($WX['th0hum-mmaxtime'],6,2); // Añadido por AGallardo
$mrecordhighhummonth substr($WX['th0hum-mmaxtime'],4,2); // Añadido por AGallardo
$mrecordhighhumyear substr($WX['th0hum-mmaxtime'],0,4); // Añadido por AGallardo

$mrecordlowhum $WX['th0hum-mmin']; // Añadido por AGallardo
$mrecordlowhumday substr($WX['th0hum-mmintime'],6,2); // Añadido por AGallardo
$mrecordlowhummonth substr($WX['th0hum-mmintime'],4,2); // Añadido por AGallardo
$mrecordlowhumyear substr($WX['th0hum-mmintime'],0,4); // Añadido por AGallardo

$mrecordlowchill $WX['wind0chill-mmin'];
$mrecordlowchillday substr($WX['wind0chill-mmintime'],6,2);
$mrecordlowchillmonth substr($WX['wind0chill-mmintime'],4,2);
$mrecordlowchillyear substr($WX['wind0chill-mmintime'],0,4);

$mrecordhighhi = isset($WX['th0heatindex-mmax'])?$WX['th0heatindex-mmax']:'--'// Añadido por AGallardo
if(isset($WX['th0heatindex-mmaxtime'])){
    
$mrecordhighhiday substr($WX['th0heatindex-mmaxtime'],6,2); // Añadido por AGallardo
  
$mrecordhighhimonth substr($WX['th0heatindex-mmaxtime'],4,2); // Añadido por AGallardo
  
$mrecordhighhiyear substr($WX['th0heatindex-mmaxtime'],0,4);  // Añadido por AGallardo
} else {
    
$mrecordhighhiday '01'// Añadido por AGallardo
  
$mrecordhighhimonth '01'// Añadido por AGallardo
  
$mrecordhighhiyear '1970';  // Añadido por AGallardo
}
$mrecordhighgust $WX['wind0wind-mmax'];
$mrecordhighgustday substr($WX['wind0wind-mmaxtime'],6,2);
$mrecordhighgustmonth substr($WX['wind0wind-mmaxtime'],4,2);
$mrecordhighgustyear substr($WX['wind0wind-mmaxtime'],0,4);

$mrecordrainrate $WX['rain0rate-mmax']; // Añadido por AGallardo
$mrecordrainrateday substr($WX['rain0rate-mmaxtime'],6,2); // Añadido por AGallardo
$mrecordrainratemonth substr($WX['rain0rate-mmaxtime'],4,2); // Añadido por AGallardo
$mrecordrainrateyear substr($WX['rain0rate-mmaxtime'],0,4); // Añadido por AGallardo

$mrecordsolar $WX['sol0rad-mmax']; // Añadido por AGallardo
$mrecordsolarday substr($WX['sol0rad-mmaxtime'],6,2); // Añadido por AGallardo
$mrecordsolarmonth substr($WX['sol0rad-mmaxtime'],4,2); // Añadido por AGallardo
$mrecordsolaryear substr($WX['sol0rad-mmaxtime'],0,4); // Añadido por AGallardo

$mrecorduv $WX['uv0index-mmax']; // Añadido por AGallardo
$mrecorduvday substr($WX['uv0index-mmaxtime'],6,2); // Añadido por AGallardo
$mrecorduvmonth substr($WX['uv0index-mmaxtime'],4,2); // Añadido por AGallardo
$mrecorduvyear substr($WX['uv0index-mmaxtime'],0,4); // Añadido por AGallardo

$mrecordavgwind $WX['wind0avgwind-mmax']; // Añadido por AGallardo
$mrecordavgwindday substr($WX['wind0avgwind-mmaxtime'],6,2); // Añadido por AGallardo
$mrecordavgwindmonth substr($WX['wind0avgwind-mmaxtime'],4,2); // Añadido por AGallardo
$mrecordavgwindyear substr($WX['wind0avgwind-mmaxtime'],0,4); // Añadido por AGallardo


$yrecordhighbaro $WX['thb0seapress-ymax'];
$yrecordhighbaroday substr($WX['thb0seapress-ymaxtime'],6,2);
$yrecordhighbaromonth substr($WX['thb0seapress-ymaxtime'],4,2);
$yrecordhighbaroyear substr($WX['thb0seapress-ymaxtime'],0,4);

$yrecordlowbaro $WX['thb0seapress-ymin'];
$yrecordlowbaroday substr($WX['thb0seapress-ymintime'],6,2);
$yrecordlowbaromonth substr($WX['thb0seapress-ymintime'],4,2);
$yrecordlowbaroyear substr($WX['thb0seapress-ymintime'],0,4);

$yrecordhightemp $WX['th0temp-ymax'];
$yrecordhightempday substr($WX['th0temp-ymaxtime'],6,2);
$yrecordhightempmonth substr($WX['th0temp-ymaxtime'],4,2);
$yrecordhightempyear substr($WX['th0temp-ymaxtime'],0,4);

$yrecordlowtemp $WX['th0temp-ymin'];
$yrecordlowtempday substr($WX['th0temp-ymintime'],6,2);
$yrecordlowtempmonth substr($WX['th0temp-ymintime'],4,2);
$yrecordlowtempyear substr($WX['th0temp-ymintime'],0,4);

$yrecordhighhum $WX['th0hum-ymax']; // Añadido por AGallardo
$yrecordhighhumday substr($WX['th0hum-ymaxtime'],6,2); // Añadido por AGallardo
$yrecordhighhummonth substr($WX['th0hum-ymaxtime'],4,2); // Añadido por AGallardo
$yrecordhighhumyear substr($WX['th0hum-ymaxtime'],0,4); // Añadido por AGallardo

$yrecordlowhum $WX['th0hum-ymin']; // Añadido por AGallardo
$yrecordlowhumday substr($WX['th0hum-ymintime'],6,2); // Añadido por AGallardo
$yrecordlowhummonth substr($WX['th0hum-ymintime'],4,2); // Añadido por AGallardo
$yrecordlowhumyear substr($WX['th0hum-ymintime'],0,4); // Añadido por AGallardo

$yrecordlowchill = isset($WX['wind0chill-ymin'])?$WX['wind0chill-ymin']:'--';
if(isset(
$WX['wind0chill-ymintime'])){
    
$yrecordlowchillday substr($WX['wind0chill-ymintime'],6,2);
  
$yrecordlowchillmonth substr($WX['wind0chill-ymintime'],4,2);
  
$yrecordlowchillyear substr($WX['wind0chill-ymintime'],0,4);
} else {
    
$yrecordlowchillday '01';
  
$yrecordlowchillmonth '01';
  
$yrecordlowchillyear '1970';
}

$yrecordhighhi = isset($WX['th0heatindex-ymax'])?$WX['th0heatindex-ymax']:'--'// Añadido por AGallardo
if(isset($WX['th0heatindex-ymaxtime'])) {
    
$yrecordhighhiday substr($WX['th0heatindex-ymaxtime'],6,2); // Añadido por AGallardo
  
$yrecordhighhimonth substr($WX['th0heatindex-ymaxtime'],4,2); // Añadido por AGallardo
  
$yrecordhighhiyear substr($WX['th0heatindex-ymaxtime'],0,4); // Añadido por AGallardo
} else {
    
$yrecordhighhiday '01'// Añadido por AGallardo
  
$yrecordhighhimonth '01'// Añadido por AGallardo
  
$yrecordhighhiyear '1970'// Añadido por AGallardo
}
$yrecordwindgust $WX['wind0wind-ymax'];
$yrecordhighgustday substr($WX['wind0wind-ymaxtime'],6,2);
$yrecordhighgustmonth substr($WX['wind0wind-ymaxtime'],4,2);
$yrecordhighgustyear substr($WX['wind0wind-ymaxtime'],0,4);

$yrecordrainrate $WX['rain0rate-ymax']; // Añadido por AGallardo
$yrecordrainrateday substr($WX['rain0rate-ymaxtime'],6,2); // Añadido por AGallardo
$yrecordrainratemonth substr($WX['rain0rate-ymaxtime'],4,2); // Añadido por AGallardo
$yrecordrainrateyear substr($WX['rain0rate-ymaxtime'],0,4); // Añadido por AGallardo

$yrecordsolar $WX['sol0rad-ymax']; // Añadido por AGallardo
$yrecordsolarday substr($WX['sol0rad-ymaxtime'],6,2); // Añadido por AGallardo
$yrecordsolarmonth substr($WX['sol0rad-ymaxtime'],4,2); // Añadido por AGallardo
$yrecordsolaryear substr($WX['sol0rad-ymaxtime'],0,4); // Añadido por AGallardo

$yrecorduv $WX['uv0index-ymax']; // Añadido por AGallardo
$yrecorduvday substr($WX['uv0index-ymaxtime'],6,2); // Añadido por AGallardo
$yrecorduvmonth substr($WX['uv0index-ymaxtime'],4,2); // Añadido por AGallardo
$yrecorduvyear substr($WX['uv0index-ymaxtime'],0,4); // Añadido por AGallardo

$yrecordavgwind $WX['wind0avgwind-ymax']; // Añadido por AGallardo
$yrecordavgwindday substr($WX['wind0avgwind-ymaxtime'],6,2); // Añadido por AGallardo
$yrecordavgwindmonth substr($WX['wind0avgwind-ymaxtime'],4,2); // Añadido por AGallardo
$yrecordavgwindyear substr($WX['wind0avgwind-ymaxtime'],0,4); // Añadido por AGallardo

$arecordhighbaro $WX['thb0seapress-amax']; // Añadido por AGallardo
$arecordhighbaroday substr($WX['thb0seapress-amaxtime'],6,2); // Añadido por AGallardo
$arecordhighbaromonth substr($WX['thb0seapress-amaxtime'],4,2); // Añadido por AGallardo
$arecordhighbaroyear substr($WX['thb0seapress-amaxtime'],0,4); // Añadido por AGallardo

$arecordlowbaro $WX['thb0seapress-amin']; // Añadido por AGallardo
$arecordlowbaroday substr($WX['thb0seapress-amintime'],6,2); // Añadido por AGallardo
$arecordlowbaromonth substr($WX['thb0seapress-amintime'],4,2); // Añadido por AGallardo
$arecordlowbaroyear substr($WX['thb0seapress-amintime'],0,4); // Añadido por AGallardo

$arecordhightemp $WX['th0temp-amax']; // Añadido por AGallardo
$arecordhightempday substr($WX['th0temp-amaxtime'],6,2); // Añadido por AGallardo
$arecordhightempmonth substr($WX['th0temp-amaxtime'],4,2); // Añadido por AGallardo
$arecordhightempyear substr($WX['th0temp-amaxtime'],0,4); // Añadido por AGallardo

$arecordlowtemp $WX['th0temp-amin']; // Añadido por AGallardo
$arecordlowtempday substr($WX['th0temp-amintime'],6,2); // Añadido por AGallardo
$arecordlowtempmonth substr($WX['th0temp-amintime'],4,2); // Añadido por AGallardo
$arecordlowtempyear substr($WX['th0temp-amintime'],0,4); // Añadido por AGallardo

$arecordhighhum $WX['th0hum-amax']; // Añadido por AGallardo
$arecordhighhumday substr($WX['th0hum-amaxtime'],6,2); // Añadido por AGallardo
$arecordhighhummonth substr($WX['th0hum-amaxtime'],4,2); // Añadido por AGallardo
$arecordhighhumyear substr($WX['th0hum-amaxtime'],0,4); // Añadido por AGallardo

$arecordlowhum $WX['th0hum-amin']; // Añadido por AGallardo
$arecordlowhumday substr($WX['th0hum-amintime'],6,2); // Añadido por AGallardo
$arecordlowhummonth substr($WX['th0hum-amintime'],4,2); // Añadido por AGallardo
$arecordlowhumyear substr($WX['th0hum-amintime'],0,4); // Añadido por AGallardo

$arecordlowchill $WX['wind0chill-amin']; // Añadido por AGallardo
$arecordlowchillday substr($WX['wind0chill-amintime'],6,2); // Añadido por AGallardo
$arecordlowchillmonth substr($WX['wind0chill-amintime'],4,2); // Añadido por AGallardo
$arecordlowchillyear substr($WX['wind0chill-amintime'],0,4); // Añadido por AGallardo

$arecordhighhi = isset($WX['th0heatindex-amax'])?$WX['th0heatindex-amax']:'--'// Añadido por AGallardo
if(isset($WX['th0heatindex-amaxtime'])){
    
$arecordhighhiday substr($WX['th0heatindex-amaxtime'],6,2); // Añadido por AGallardo
  
$arecordhighhimonth substr($WX['th0heatindex-amaxtime'],4,2); // Añadido por AGallardo
  
$arecordhighhiyear substr($WX['th0heatindex-amaxtime'],0,4); // Añadido por AGallardo
}else {
    
$arecordhighhiday   '01';
    
$arecordhighhimonth '01';
    
$arecordhighhiyear  '1970';
}
$arecordwindgust $WX['wind0wind-amax']; // Añadido por AGallardo
$arecordhighgustday substr($WX['wind0wind-amaxtime'],6,2); // Añadido por AGallardo
$arecordhighgustmonth substr($WX['wind0wind-amaxtime'],4,2); // Añadido por AGallardo
$arecordhighgustyear substr($WX['wind0wind-amaxtime'],0,4); // Añadido por AGallardo

$arecordrainrate $WX['rain0rate-amax']; // Añadido por AGallardo
$arecordrainrateday substr($WX['rain0rate-amaxtime'],6,2); // Añadido por AGallardo
$arecordrainratemonth substr($WX['rain0rate-amaxtime'],4,2); // Añadido por AGallardo
$arecordrainrateyear substr($WX['rain0rate-amaxtime'],0,4); // Añadido por AGallardo

$arecordsolar = isset($WX['sol0rad-amax'])?$WX['sol0rad-amax']:'--'// Añadido por AGallardo
if(isset($WX['sol0rad-amaxtime'])){
    
$arecordsolarday substr($WX['sol0rad-amaxtime'],6,2); // Añadido por AGallardo
  
$arecordsolarmonth substr($WX['sol0rad-amaxtime'],4,2); // Añadido por AGallardo
  
$arecordsolaryear substr($WX['sol0rad-amaxtime'],0,4); // Añadido por AGallardo
} else {
    
$arecordsolarday '01'// Añadido por AGallardo
  
$arecordsolarmonth '01'// Añadido por AGallardo
  
$arecordsolaryear '1970'// Añadido por AGallardo
}
$arecorduv = isset($WX['uv0index-amax'])?$WX['uv0index-amax']:'--'// Añadido por AGallardo
if(isset($WX['uv0index-amaxtime'])){
    
$arecorduvday substr($WX['uv0index-amaxtime'],6,2); // Añadido por AGallardo
  
$arecorduvmonth substr($WX['uv0index-amaxtime'],4,2); // Añadido por AGallardo
  
$arecorduvyear substr($WX['uv0index-amaxtime'],0,4); // Añadido por AGallardo
} else {
    
$arecorduvday '01'// Añadido por AGallardo
  
$arecorduvmonth '01'// Añadido por AGallardo
  
$arecorduvyear '1970'// Añadido por AGallardo
}
$arecordavgwind $WX['wind0avgwind-amax']; // Añadido por AGallardo
$arecordavgwindday substr($WX['wind0avgwind-amaxtime'],6,2); // Añadido por AGallardo
$arecordavgwindmonth substr($WX['wind0avgwind-amaxtime'],4,2); // Añadido por AGallardo
$arecordavgwindyear substr($WX['wind0avgwind-amaxtime'],0,4); // Añadido por AGallardo

$avgwindirdeg = isset($WX['wind0dir-avg10'])?$WX['wind0dir-avg10']:'--'// Añadido por AGallardo
$havgwindirdeg = isset($WX['wind0dir-havg'])?$WX['wind0dir-havg']:'--'// Añadido por AGallardo
$davgwindirdeg = isset($WX['wind0dir-davg'])?$WX['wind0dir-davg']:'--'// Añadido por AGallardo
$yestavgwindirdeg = isset($WX['wind0dir-ydavg'])?$WX['wind0dir-ydavg']:'--'// Añadido por AGallardo
$mavgwindirdeg = isset($WX['wind0dir-mavg'])?$WX['wind0dir-mavg']:'--'// Añadido por AGallardo
$yavgwindirdeg = isset($WX['wind0dir-yavg'])?$WX['wind0dir-yavg']:'--'// Añadido por AGallardo
$aavgwindirdeg = isset($WX['wind0dir-aavg'])?$WX['wind0dir-aavg']:'--'// Añadido por AGallardo

$avgwindir MB_deg2dir($avgwindirdeg); // Añadido por AGallardo
$havgwindir MB_deg2dir($havgwindirdeg); // Añadido por AGallardo
$davgwindir MB_deg2dir($davgwindirdeg); // Añadido por AGallardo
$yestavgwindir MB_deg2dir($yestavgwindirdeg); // Añadido por AGallardo
$mavgwindir MB_deg2dir($mavgwindirdeg); // Añadido por AGallardo
$yavgwindir MB_deg2dir($yavgwindirdeg); // Añadido por AGallardo
$aavgwindir MB_deg2dir($aavgwindirdeg); // Añadido por AGallardo

if(isset($WX['forecast-text']) and $WX['forecast-text'] <> '') {
    
$vpforecasttext $WX['forecast-text'];
    
$vpforecasttextes = isset($WX['forecast-texteshtml'])?$WX['forecast-texteshtml']:$WX['forecast-text']; // Añadido por AGallardo
}


# MB unique functions included from MB-functions-inc.txt 
#-------------------------------------------------------------------------------------
# function processed WD variables
#-------------------------------------------------------------------------------------

global $SITE;

$SITE['commaDecimal'] = strpos($temperature,',') !==false?true:false// using comma for decimal point?
if(!isset($SITE['WDdateMDY'])) {$WDdateMDY false;} else {$WDdateMDY $SITE['WDdateMDY'];}
if(isset(
$SITE['conditionsMETAR'])) { // override with METAR conditions for text and icon if requested.
    
include_once("get-metar-conditions-inc.php");
    list(
$sunrise,$sunset) = MB_getSuntimes("$date $time",$SITE['latitude'],$SITE['longitude']);
    list(
$Currentsolardescription,$iconnumber) = mtr_conditions($SITE['conditionsMETAR'], $time$sunrise$sunset);
}
# generate the separate date/time variables by dissection of input date/time and format
list($date_year,$date_month,$date_day,$time_hour,$time_minute,$monthname,$dayname)
  = 
MB_setDateTimes($date,$time,$WDdateMDY);

$beaufortnum =  MB_beaufortNumber($avgspd,$uomwind);
$bftspeedtext MB_beaufortText($beaufortnum);

list(
$chandler,$chandlertxt,$chandlerimg) = MB_CBI($temperature,$uomtemp,$humidity);

if(!isset(
$wdversion) and isset($SITE['WXsoftwareVersion'])) {$wdversion $SITE['WXsoftwareVersion']; }

$humidex MB_calcHumidex($temperature,$humidity,$uomtemp); // WD Sample= '61.6°F'

list($feelslike,$heatcolourword) = MB_setFeelslike ($temperature,$windch,$humidex,$uomtemp);

$date MB_dateOnly($date_year.$date_month.$date_day,$WDdateMDY); // convert YYYYMMDD to DD/MM/YYYY or MM/DD/YYYY

#-------------------------------------------------------------------------------------
# MB support function - MB_getSuntimes($time,$stationlatitude,$stationlongitude);
#-------------------------------------------------------------------------------------
function MB_getSuntimes($stationtime,$stationlatitude,$stationlongitude) {
    
    
$tstamp strtotime($stationtime);
    if(
function_exists('date_sun_info')) {
      
$info date_sun_info($tstamp,$stationlatitude,$stationlongitude);
      
$t $info['sunrise'] . ' ' $info['sunset'];
    } else {
      
$t 'n/a n/a';
    }
    
    return(
explode(' ',$t));
    
// end MB_getSuntimes

#-------------------------------------------------------------------------------------
# MB support function - MB_isdata
#-------------------------------------------------------------------------------------

function MB_isdata$variable ) {
  global 
$WX;
  
// see if $WX array has valid data contents
  
if(isset($WX[$variable]) and $WX[$variable] !== '--') { return (true); } else { return (false); }    
}


#-------------------------------------------------------------------------------------
# MB support function - MB_calcHumidex
#-------------------------------------------------------------------------------------

function MB_calcHumidex ($temp,$humidity,$useunit) {
// Calculate Humidex from temperature and humidity
// Source of calculation: http://www.physlink.com/reference/weather.cfm    
  
global $Debug,$WX;
    if(
$temp == '--' or $humidity == '--') {return('--'); }
  if(
preg_match('|F|i',$WX['uomTemp'])) {
    
$TMB_convertTemp($temp,'C');
  } else {
    
$T $temp;
  }
  
$H $humidity;
  
  
$t=7.5*$T/(237.7+$T);
  
$et=pow(10,$t);
  
$e=6.112*$et*($H/100);
  
$humidex=$T+(5/9)*($e-10);
  
$Debug .= "<!-- calcHumidex T=$T C, H=$H calc=$humidex ";
  if (
$humidex $T) {
     
$humidex=$T;
     
$Debug .= " set to T, ";
  }
  if(
preg_match('|F|i',$useunit)) {
     
# convert to F
     
$humidex sprintf("%01.1f",round((1.8 $humidex) + 32.0,1));      
  }
  
$humidex round($humidex,1);
  
$Debug .= " humidex=$humidex $useunit -->\n"
  return(
$humidex);    
}

#-------------------------------------------------------------------------------------
# MB support function - MB_calcHeatIndex
#-------------------------------------------------------------------------------------

function MB_calcHeatIndex ($temp,$humidity,$useunit) {
// Calculate Heat Index from temperature and humidity
// Source of calculation: http://woody.cowpi.com/phpscripts/getwx.php.txt    
  
global $Debug;
  if(
preg_match('|C|i',$useunit)) {
    
$tempF round(1.8 $temp 32,1);
  } else {
    
$tempF round($temp,1);
  }
  
$rh $humidity;
  
  
  
// Calculate Heat Index based on temperature in F and relative humidity (65 = 65%)
  
if ($tempF 79 && $rh 39) {
      
$hiF = -42.379 2.04901523 $tempF 10.14333127 $rh 0.22475541 $tempF $rh;
      
$hiF += -0.00683783 pow($tempF2) - 0.05481717 pow($rh2);
      
$hiF += 0.00122874 pow($tempF2) * $rh 0.00085282 $tempF pow($rh2);
      
$hiF += -0.00000199 pow($tempF2) * pow($rh2);
      
$hiF round($hiF,1);
      
$hiC round(($hiF 32) / 1.8,1);
  } else {
      
$hiF $tempF;
      
$hiC round(($hiF 32) / 1.8,1);
  }
  
$Debug .= "<!-- MB_calcHeatIndex temp=$temp ($tempF F) C, rh=$rh calc=$hiF F, $hiC C ";
  if(
preg_match('|F|i',$useunit)) {
     
$heatIndex $hiF;      
  } else {
     
$heatIndex $hiC;
  }
  
$Debug .= " heatIndex=$heatIndex $useunit -->\n"
  return(
$heatIndex);    
}

#-------------------------------------------------------------------------------------
# MB support function - MB_convertTemp
#-------------------------------------------------------------------------------------

function MB_convertTemp ($rawtemp,$useunit) {
     
$dpTemp 1;
     if(!
is_numeric($rawtemp)) { return($rawtemp); } // no conversions for missing values
     
if (preg_match('|C|i',$useunit))  { // convert F to C
        
return( sprintf("%01.{$dpTemp}f",round(($rawtemp-32.0) / 1.8,$dpTemp)));
     } else {  
// leave as F
        
return (sprintf("%01.{$dpTemp}f"round($rawtemp*1.0,$dpTemp)));
     }
}

#-------------------------------------------------------------------------------------
# MB support function - MB_timeOnly
#-------------------------------------------------------------------------------------

function MB_timeOnly ($indatetime) {
// Return HH:MM (24hr time format)
// expecting
// 0....+....1....+
// 20110622061003
// yyyymmddhhMMss
  
return(substr($indatetime,8,2).':'.substr($indatetime,10,2));
}

#-------------------------------------------------------------------------------------
# MB support function - MB_dateOnly
#-------------------------------------------------------------------------------------

function MB_dateOnly ($indatetime,$MDY=true) {
// Return dd/mm/yyyy or mm/dd/yyyy
// expecting
// 0....+....1....+
// 20110622061003
// yyyymmddhhMMss
  
if($MDY) {
    return(
substr($indatetime,4,2).'/'.substr($indatetime,6,2).'/'.substr($indatetime,0,4));
  } else {
    return(
substr($indatetime,6,2).'/'.substr($indatetime,4,2).'/'.substr($indatetime,0,4));
  }
}

#-------------------------------------------------------------------------------------
# MB support function - MB_WDrecordDate
#-------------------------------------------------------------------------------------

function MB_WDrecordDate ($indatetime) {
// extract Y, M, D and return as array
// expecting
// 0....+....1....+
// 20110622061003
// yyyymmddhhMMss
  
return(array(substr($indatetime,0,4),substr($indatetime,4,2),substr($indatetime,6,2)));
}

#-------------------------------------------------------------------------------------
# MB support function - MB_fixupTime
#-------------------------------------------------------------------------------------

function MB_fixupTime ($intime) {
  global 
$Debug;
  
$tfixed preg_replace('/^(\S+)\s+(\S+)$/is',"$2",$intime);
  
$t explode(':',$tfixed);
  if (
preg_match('/p/i',$tfixed)) { $t[0] = $t[0] + 12; }
  if (
$t[0] > 23) {$t[0] = 12; }
  if (
preg_match('/^12.*a/i',$tfixed)) { $t[0] = 0; }
  if (
$t[0] < '10') {$t[0] = sprintf("%02d",$t[0]); } // leading zero on hour.
  
$t2 join(':',$t); // put time back to gether;
  
$t2 preg_replace('/[^\d\:]/is','',$t2); // strip out the am/pm if any
  
$Debug .= "<!-- MB_fixupTime in='$intime' tfixed='$tfixed' out='$t2' -->\n";
  return(
$t2);
      
// end MB_fixupTime

#-------------------------------------------------------------------------------------
# MB support function - MB_setDateTimes
#-------------------------------------------------------------------------------------

function MB_setDateTimes ($indate,$intime,$MDYformat=true) {
// returns: $date_year,$date_month,$date_day,$time_hour,$time_minute,$date_month,$monthname,$dayname
  
global $Debug;
  
$Debug .= "<!-- MB_setDateTimes date='$indate' time=$intime' MDY=$MDYformat -->\n";
  
  
$MBtime strtotime("$indate $intime");
   
  
$MBtime date('Y m d H i F l',$MBtime);
  
$Debug .= "<!-- MB_setDateTimes MBtime='$MBtime' values set -->\n";
  if(isset(
$_REQUEST['debug'])) {echo $Debug; } 
  return(
explode(' ',$MBtime)); // results returned in array for list() assignment
      
// end MB_setDateTimes

#-------------------------------------------------------------------------------------
# MB support function - MB_deg2dir - Convert wind direction degrees to cardinal name
#-------------------------------------------------------------------------------------

function MB_deg2dir ($degrees) {
   
// figure out a text value for compass direction
// Given the wind direction, return the text label
// for that value.  16 point compass
   
$winddir $degrees;
   if (
$winddir == "--") { return($winddir); }

  if (!isset(
$winddir)) {
    return 
"---";
  }
  if (!
is_numeric($winddir)) {
    return(
$winddir);
  }
  
$windlabel = array ("N","NNE""NE""ENE""E""ESE""SE""SSE""S",
     
"SSW","SW""WSW""W""WNW""NW""NNW");
  
$dir $windlabel[ (integer)fmod((($winddir 11) / 22.5),16) ];
  return(
$dir);

// end function MB_deg2dir


#-------------------------------------------------------------------------------------
# MB support function - MB_beaufortNumber
#-------------------------------------------------------------------------------------

function MB_beaufortNumber ($inWind,$usedunit) {
   global 
$Debug;
   if(
$inWind == '--') {return ("0"); } // fix Notice errata on missing data
   
$rawwind $inWind;
// first convert all winds to knots
   
if(strpos($inWind,',') !== false) {
       
$rawwind preg_replace('|,|','.',$inWind);
   }
   
$WINDkts 0.0;
   if       (
preg_match('/kts|knot/i',$usedunit)) {
       
$WINDkts $rawwind 1.0;
   } elseif (
preg_match('/mph/i',$usedunit)) {
       
$WINDkts $rawwind 0.8689762;
   } elseif (
preg_match('/mps|m\/s/i',$usedunit)) {
       
$WINDkts $rawwind 1.94384449;
   } elseif  (
preg_match('/kmh|km\/h/i',$usedunit)) {
       
$WINDkts $rawwind 0.539956803;
   } else {
       
$Debug .= "<!-- MB_beaufortNumber .. unknown input unit '$usedunit' for wind=$rawwind -->\n";
       
$WINDkts $rawwind 1.0;
   }

// return a number for the beaufort scale based on wind in knots
  
if ($WINDkts ) {return(0); }
  if (
$WINDkts ) {return(1); }
  if (
$WINDkts ) {return(2); }
  if (
$WINDkts 11 ) {return(3); }
  if (
$WINDkts 17 ) {return(4); }
  if (
$WINDkts 22 ) {return(5); }
  if (
$WINDkts 28 ) {return(6); }
  if (
$WINDkts 34 ) {return(7); }
  if (
$WINDkts 41 ) {return(8); }
  if (
$WINDkts 48 ) {return(9); }
  if (
$WINDkts 56 ) {return(10); }
  if (
$WINDkts 64 ) {return(11); }
  if (
$WINDkts >= 64 ) {return(12); }
  return(
"0");
// end MB_beaufortNumber

#-------------------------------------------------------------------------------------
# MB support function - MB_beaufortText
#-------------------------------------------------------------------------------------

function MB_beaufortText ($beaufortnumber) {

  
$B = array( /* Beaufort 0 to 12 in English */
   
"Calm""Light air""Light breeze""Gentle breeze""Moderate breeze""Fresh breeze",
   
"Strong breeze""Near gale""Gale""Strong gale""Storm",
   
"Violent storm""Hurricane"
  
);

  if(isset(
$B[$beaufortnumber])) {
    return 
$B[$beaufortnumber];
  } else {
    return 
"Unknown $beaufortnumber Bft";
  }
    
    
// end MB_beaufortText

#-------------------------------------------------------------------------------------
# MB support function - MB_setFeelslike
#-------------------------------------------------------------------------------------


function MB_setFeelslike ($temp,$windchill,$heatindex,$tempUOM) {
global 
$Debug;
// establish the feelslike temperature and return a word describing how it feels

$HeatWords = array(
 
'Unknown''Extreme Heat Danger''Heat Danger''Extreme Heat Caution''Extremely Hot''Uncomfortably Hot',
 
'Hot''Warm''Comfortable''Cool''Cold''Uncomfortably Cold''Very Cold''Extreme Cold' );

// first convert all temperatures to Centigrade if need be
  
$TC $temp;
  
$WC $windchill;
  
$HC $heatindex;
  if(
$TC == '--' or $WC == '--' or $HC == '--') {return array('--','n/a'); } // fix Notice errata on missing data
  
if(strpos($TC,',') !== false) {
    
$TC preg_replace('|,|','.',$temp);
    
$WC preg_replace('|,|','.',$windchill);
    
$HC preg_replace('|,|','.',$heatindex);
  }
  
  if (
preg_match('|F|i',$tempUOM))  { // convert F to C if need be
     
$TC sprintf("%01.1f",round(($TC-32.0) / 1.8,1));
     
$WC sprintf("%01.1f",round(($WC-32.0) / 1.8,1));
     
$HC sprintf("%01.1f",round(($HC-32.0) / 1.8,1));
  }
 
 
// Feelslike
 
  
if ($TC <= 16.0 ) {
    
$feelslike $WC//use WindChill
  
} elseif ($TC >=27.0) {
    
$feelslike $HC//use HeatIndex
  
} else {
    
$feelslike $TC;   // use temperature
  
}

  if (
preg_match('|F|i',$tempUOM))  { // convert C back to F if need be
    
$feelslike = (1.8 $feelslike) + 32.0;
  }
  
$feelslike round($feelslike,0);

// determine the 'heat color word' to use  
 
$hcWord $HeatWords[0];
 
$hcFound false;
 if (
$TC 32 and $HC 29) {
    if (
$HC 54 and ! $hcFound) { $hcWord $HeatWords[1]; $hcFound true;}
    if (
$HC 45 and ! $hcFound) { $hcWord $HeatWords[2]; $hcFound true; }
    if (
$HC 39 and ! $hcFound) { $hcWord $HeatWords[4]; $hcFound true; }
    if (
$HC 29 and ! $hcFound) { $hcWord $HeatWords[6]; $hcFound true; }
 } elseif (
$WC 16 ) {
    if (
$WC < -18 and ! $hcFound) { $hcWord $HeatWords[13]; $hcFound true; }
    if (
$WC < -and ! $hcFound)  { $hcWord $HeatWords[12]; $hcFound true; }
    if (
$WC < -and ! $hcFound)  { $hcWord $HeatWords[11]; $hcFound true; }
    if (
$WC and ! $hcFound)   { $hcWord $HeatWords[10]; $hcFound true; }
    if (
$WC 16 and ! $hcFound)  { $hcWord $HeatWords[9]; $hcFound true; }
 } elseif (
$WC >= 16 and $TC <= 32) {
    if (
$TC <= 26 and ! $hcFound) { $hcWord $HeatWords[8]; $hcFound true; }
    if (
$TC <= 32 and ! $hcFound) { $hcWord $HeatWords[7]; $hcFound true; }
 }

 if(isset(
$_REQUEST['debug'])) {
  echo 
"<!-- MB_setFeelslike input T,WC,HI,U='$temp,$windchill,$heatindex,$tempUOM' cnvt T,WC,HI='$TC,$WC,$HC' feelslike=$feelslike hcWord=$hcWord -->\n";
 }

 return(array(
$feelslike,$hcWord));
    
// end of MB_setFeelslike

#-------------------------------------------------------------------------------------
# MB support function - MB_CBI - Chandler Burning Index
#-------------------------------------------------------------------------------------

function MB_CBI($inTemp,$inTempUOM,$inHumidity) {
    
// thanks to Chris from sloweather.com for the CBI calculation script
    // modified by Ken True for template usage
    
if($inTemp == '--' or $inHumidity == '--') { return(array('--','n/a','')); } // no Notice error on missing data
    
preg_match('/([\d\.\,\+\-]+)/',$inTemp,$t); // strip non-numeric from inTemp if any
    
$ctemp $t[1];
    if(
strpos($ctemp,',') !== false) {
        
$ctemp preg_replace('|,|','.',$ctemp);
    }
    if(!
preg_match('|C|i',$inTempUOM)) {
      
$ctemp = ($ctemp-32.0) / 1.8// convert from Fahrenheit    
    
}
    
preg_match('/([\d\.\,\+\-]+)/',$inHumidity,$t); // strip non-numeric from inHumidity if any
    
$rh $t[1];
    if(
strpos($rh,',') !== false) {
        
$rh preg_replace('|,|','.',$rh);
    }

    
// Start Index Calcs
    
    // Chandler Index
    
$cbi = (((110 1.373 $rh) - 0.54 * (10.20 $ctemp)) * (124 pow(10,-0.0142 $rh) ))/60;
    
// CBI = (((110 - 1.373*RH) - 0.54 * (10.20 - T)) * (124 * 10**(-0.0142*RH)))/60
    
    //Sort out the Chandler Index
    
$cbi round($cbi,1);
    if (
$cbi "97.5") {
        
$cbitxt "EXTREME";
        
$cbiimg"fdl_extreme.gif";
    
    } elseif (
$cbi >="90") {
        
$cbitxt "VERY HIGH";
        
$cbiimg"fdl_vhigh.gif";
    
    } elseif (
$cbi >= "75") {
        
$cbitxt "HIGH";
        
$cbiimg"fdl_high.gif";
    
    } elseif (
$cbi >= "50") {
        
$cbitxt "MODERATE";
        
$cbiimg"fdl_moderate.gif";
    
    } else {
        
$cbitxt="LOW";
        
$cbiimg"fdl_low.gif";
    }
     
$data = array($cbi,$cbitxt,$cbiimg);
     return 
$data;
     
// end MB_CBI

#-------------------------------------------------------------------------------------
# MB support function - MB_get_barotrend_text
#-------------------------------------------------------------------------------------

function MB_get_barotrend_text($rawpress,$usedunit='hPa') {
  global 
$Debug;
// routine from Anole's wxsticker PHP (adapted)  
//   Barometric Trend(3 hour)

// Change Rates
// Rapidly: =.06" inHg; 1.5 mm Hg; 2 hPa; 2 mb
// Slowly: =.02" inHg; 0.5 mm Hg; 0.7 hPa; 0.7 mb

// 5 Arrow Positions:
// Rising Rapidly
// Rising Slowly
// Steady
// Falling Slowly
// Falling Rapidly

// Page 52 of the PDF Manual
// http://www.davisnet.com/product_documents/weather/manuals/07395.234-VP2_Manual.pdf

// first convert to hPa for comparisons
     
if (preg_match('/hPa|mb/i',$usedunit)) {
        
$btrend sprintf("%02.1f",round($rawpress 1.0,1)); // leave in hPa
     
} elseif (preg_match('/mm/i',$usedunit)) {
       
$btrend sprintf("%02.1f",round($rawpress 1.333224,1)); 
     } else { 
// convert from inHg
        
$btrend sprintf("%02.1f",round($rawpress  33.86388158,1));
     }

   
// figure out a text value for barometric pressure trend
   
(float)$baromtrend $btrend;
//   settype($baromtrend, "float");
   
switch (TRUE) {
      case ((
$baromtrend >= -0.6) and ($baromtrend <= 0.6)):
        
$baromtrendwords "Steady";
      break;
      case ((
$baromtrend 0.6) and ($baromtrend 2.0)):
        
$baromtrendwords "Rising Slowly";
      break;
      case (
$baromtrend >= 2.0):
        
$baromtrendwords "Rising Rapidly";
      break;
      case ((
$baromtrend < -0.6) and ($baromtrend > -2.0)):
        
$baromtrendwords "Falling Slowly";
      break;
      case (
$baromtrend <= -2.0):
        
$baromtrendwords "Falling Rapidly";
      break;
   } 
// end switch
   
$Debug .= "<!-- MB_get_barotrend_text in=$rawpress $usedunit change out=$btrend hPa change [$baromtrend] ($baromtrendwords) -->\n";
  return(
$baromtrendwords);
}

#-------------------------------------------------------------------------------------
# end of MB support functions
#-------------------------------------------------------------------------------------

?>