Page 1 of 2

Import Weather Display data to Meteohub?

Posted: Sun Jul 06, 2008 1:17 pm
by samikki
Yesterday I bought NSLU2 and installed Meteohub. I had been using Weather Display previously and I successfully configured Weather Display to get weather from Meteohub, thanks to great instructions I read from here. The system works beautifully now - WD continues to update my weather pages (www.pinseri.com/saa) and Meteohub sends rapid fire updates to Weather Underground.

But there is one thing I haven't yet found an answer for. I have over a year's worth of weather data in Weather Display. I would like to transfer all of that to Meteohub because I'm planning to discontinue WD and create all my statistics and graphics using Meteohub. I'd like to have my weather history for long time graphs and statistics.

Is there a solution to transfer WD historical data to Meteohub?

Sami

Re:Import Weather Display data to Meteohub?

Posted: Mon Jul 07, 2008 10:41 pm
by admin
One could generate raw data for Meteohub in theory, but there is not tool for doing so.

Have a look at the raw data format of Meteohub in the manual to get an impression if you are willing to do this.

Re:Import Weather Display data to Meteohub?

Posted: Tue Jul 08, 2008 1:12 am
by samikki
OK, thanks for the information. I might try to convert data myself. I suppose it might not be that hard if I can get all weather data out of WD in .csv format. Just a couple of lines of Perl :)

Do I have to notify Meteohub somehow if I add raw data files or will it notice the new data by itself?

Sami

Re:Import Weather Display data to Meteohub?

Posted: Tue Jul 08, 2008 1:25 am
by admin
When having added the raw data, press "recompute" on the maintenance page. This will take your new old data into account.

Re:Import Weather Display data to Meteohub?

Posted: Tue Jul 08, 2008 10:12 am
by skyewright
samikki wrote:I suppose it might not be that hard if I can get all weather data out of WD in .csv format. Just a couple of lines of Perl :)
If you do do that, others may be interested in your 'couple of lines' too. ;) :)

I have about 3 months more data in WD than in Meteohub. Not so much that it's ever been a high enough priority to set about converting it, but if there was code available...

Just a thought. :)

Re:Import Weather Display data to Meteohub?

Posted: Tue Jul 08, 2008 10:20 am
by samikki
If I manage to get it working, I'll post the code. It might be that I don't have time to work with it until later though -- summer holidays are about to start :)

Sami

Re:Import Weather Display data to Meteohub?

Posted: Tue Jul 08, 2008 11:15 am
by skyewright
samikki wrote:It might be that I don't have time to work with it until later though -- summer holidays are about to start :)
Fine. No pressure. All contributions gratefully received. :)
Have a good holiday.

Re:Import Weather Display data to Meteohub?

Posted: Mon Aug 04, 2008 1:46 pm
by samikki
Hello! I have been experimenting with Weather Display to Meteohub conversion software, quite successfully in fact.

I made a perl script which creates meteohub raw data out of WD log files.

As promised, I'll make the source code available here.

You can find the script here:
http://www.pinseri.com/saa2/wd2meteohub.txt

Please note that it is spaghetti code and there are no guarantees that it works for you. But maybe you get some ideas out of it.

Usage:
Copy WD log files to same directory as the script. You need three files, for example:

72008lg.txt
72008indoorlog.txt
72008vantagelog.txt

(Vantagelog contains data for WMR-100 UV sensor).

Then start the script and give month+day as a parameter.

The script prints meteohub raw data to STDOUT.

Like this:

./wd2meteohub.pl 72008 > raw

Copy the raw file to corresponding directory on meteohub and do "recompute".

There are still some bugs with rain sensors and changes of month, but I'm trying to iron them out. The linked script can change any time as I am working with it.

Happy experimenting!

Sami

Re:Import Weather Display data to Meteohub?

Posted: Mon Aug 04, 2008 2:37 pm
by skyewright
samikki wrote:I made a perl script which creates meteohub raw data out of WD log files.

As promised, I'll make the source code available here.
Thank you. Looks good I'll have a play with it sometime. :)

Re:Import Weather Display data to Meteohub?

Posted: Mon Aug 04, 2008 2:53 pm
by samikki
Be sure to take the latest copy when you do... I'm tweaking the script all the time (I just made some modifications to rain total calculation, for example).

-Sami

Re:Import Weather Display data to Meteohub?

Posted: Mon Aug 04, 2008 4:47 pm
by skyewright
samikki wrote:Be sure to take the latest copy when you do... I'm tweaking the script all the time (I just made some modifications to rain total calculation, for example).
Thanks for that - useful to know. No import in re-inventing a wheel if it already exists. :)

Re:Import Weather Display data to Meteohub?

Posted: Sat Aug 09, 2008 2:39 pm
by skyewright
Slightly puzzled by this:

Code: Select all

	
# need to calculate a fake value for alltime rain total
# because meteohub uses it to calculate rain amounts.
# we don't know the total at the end of previous month
# so we need to come up with a value that is smaller
# than any value at the end of previous month.
# if you are adding log data between actual log data,
# this may give you problems.

	if ($month_total==0) {
		$month_total=9999;
	}
Any particular reason for choosing 9999 as the initial value?
Wouldn't 0 be an almost guaranteed 'smaller than any value at the end of previous month.' value?

Re:Import Weather Display data to Meteohub?

Posted: Sat Aug 09, 2008 7:31 pm
by samikki
Any particular reason for choosing 9999 as the initial value?
That's for ensuring that the change from converted to live data goes smoothly. My live data has alltime total of around 1200 mm or so, so I had to use number bigger than that...

Re: Import Weather Display data to Meteohub?

Posted: Sun Feb 05, 2012 2:00 pm
by geiro
anyone tried this? I have 6 years of WD data that I would love to have imported to Meteohub

Re: Import Weather Display data to Meteohub?

Posted: Fri Mar 16, 2012 1:16 pm
by geiro
nobody that has done this lately?