Page 1 of 1

UV from WU

Posted: Fri Dec 22, 2017 5:41 pm
by sbmike
Weather Underground does report UV in its XML. Seems that by changing update.php I can include UV reported from my weather station to my site. I am using an Ambient Weather WS-2902 weather station.

Code: Select all

diff -u update.php.orig  update.php
--- update.php.orig     2017-12-12 03:58:19.253102000 +0000
+++ update.php  2017-12-22 17:21:49.597102000 +0000
@@ -278,6 +278,8 @@
         $rawUpdate['RR'] = convertor($rawUpdate['RR'],"in","mm");
         $rawUpdate['B'] = (string)$xmlWU->current_observation[$lastWU]->wind_degrees;
         $rawUpdate['S'] = (string)$xmlWU->current_observation[$lastWU]->solar_radiation;
+//Add UV
+        $rawUpdate['UV'] = (string)$xmlWU->current_observation[$lastWU]->UV;

     } // end WU

Re: UV from WU

Posted: Sun Jan 07, 2018 7:59 pm
by nicoloconte
Great! ;)

Re: UV from WU

Posted: Mon Jan 15, 2018 1:51 am
by Dehatter
This worked for me!! Thank you!!

Tom

Re: UV from WU

Posted: Sun Mar 12, 2023 4:01 pm
by Sandro.g
Hi,
I also have this problem, I did some tests but I couldn't get it to work, maybe because I have the latest version of meteotemplate, (18.0 Papaya) and the update.php file is not the same, can someone help me?
Thank you

Re: UV from WU

Posted: Tue Jul 04, 2023 8:07 am
by AnGeLiuS
Hello,
I had the same problem when i had install et configure the Template.

In Template/update/update.php, i see one line is missing concerning the uv, so i add this, line 272 in the original file :

Code: Select all

$rawUpdate['UV'] = $fileRaw['observations'][0]['uv'];
I hope it's help you