More rainfall data

Discussion, issues, recommendations around Meteohub's dashboard and WD Live integration

Moderator: Mattk

Post Reply
markhiseman
Senior Boarder
Senior Boarder
Posts: 61
Joined: Wed Nov 05, 2008 4:25 pm
Location: Maidstone, Kent, UK
Contact:

More rainfall data

Post by markhiseman » Thu Nov 12, 2009 9:39 pm

Hi Boris,

You've added some good WDL updates recently, especially the moon phase/rise/set feature.

Please could I ask for one more update: to add the following information to the clientrawextra.txt file:

Field #482: Days since last rain
Field #534: Yesterday rain (mm)

Info taken from the WDL parser at http://www.tnetweather.com/wd-parser.php

WD Live will display this information on the 'live' screen if it is provided.

It's about the only 'live' data that Meteohub does not currently provide, so it would be a good addition.

Many thanks as always,

Mark.

markhiseman
Senior Boarder
Senior Boarder
Posts: 61
Joined: Wed Nov 05, 2008 4:25 pm
Location: Maidstone, Kent, UK
Contact:

Re: More rainfall data

Post by markhiseman » Wed Feb 02, 2011 4:45 pm

Thank you Boris. I see that 4.7 includes the 'Yesterday's rain' feature.

'Days since last rain' does not seem to be implemented yet. Hopefully this can be added when you have time.

Mark.

User avatar
YJB
Platinum Boarder
Platinum Boarder
Posts: 386
Joined: Thu Feb 19, 2009 5:53 pm
Location: Venhuizen, Netherlands
Contact:

Re: More rainfall data

Post by YJB » Wed Feb 02, 2011 6:49 pm

Not sure what you are trying to do, but this is the code that I'm using in my testtags.php script:

Code: Select all

// Fetch daily rain_array, this starts with yesterday
$rain_day_string = "[seqday1_rain0_total_mm]";
$rain_day_array = explode(" ", $rain_day_string);
// Need to insert todays rain at the start of the array
array_unshift($rain_day_array,"[day1_rain0_total_mm]");

// Now find the 1st non 0.00 day
while ($rain = current($rain_day_array)) {
    if ($rain != 0.00) break;
next ($rain_day_array);
 }
$dayswithnorain = key($rain_day_array);
//
//get timestamp for the last recorded rain
$rain_time = strtotime("-".$dayswithnorain." day");
//format the date using the timestamp generated
$dateoflastrainalways = date("d/m/Y", $rain_time);
Hope this helps,
Ysbrand

Post Reply