Import Weather Display data to Meteohub?

Discussion of the Meteohub software package

Moderator: Mattk

samikki
Junior Boarder
Junior Boarder
Posts: 20
Joined: Sun Jul 06, 2008 1:03 pm
Location: Kangasala, Finland

Import Weather Display data to Meteohub?

Post 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
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7878
Joined: Mon Oct 01, 2007 10:51 pm

Re:Import Weather Display data to Meteohub?

Post 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.
samikki
Junior Boarder
Junior Boarder
Posts: 20
Joined: Sun Jul 06, 2008 1:03 pm
Location: Kangasala, Finland

Re:Import Weather Display data to Meteohub?

Post 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
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7878
Joined: Mon Oct 01, 2007 10:51 pm

Re:Import Weather Display data to Meteohub?

Post by admin »

When having added the raw data, press "recompute" on the maintenance page. This will take your new old data into account.
skyewright
Platinum Boarder
Platinum Boarder
Posts: 873
Joined: Fri Jan 25, 2008 6:27 pm
Location: Isle of Skye, Scotland

Re:Import Weather Display data to Meteohub?

Post 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. :)
samikki
Junior Boarder
Junior Boarder
Posts: 20
Joined: Sun Jul 06, 2008 1:03 pm
Location: Kangasala, Finland

Re:Import Weather Display data to Meteohub?

Post 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
skyewright
Platinum Boarder
Platinum Boarder
Posts: 873
Joined: Fri Jan 25, 2008 6:27 pm
Location: Isle of Skye, Scotland

Re:Import Weather Display data to Meteohub?

Post 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.
samikki
Junior Boarder
Junior Boarder
Posts: 20
Joined: Sun Jul 06, 2008 1:03 pm
Location: Kangasala, Finland

Re:Import Weather Display data to Meteohub?

Post 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
skyewright
Platinum Boarder
Platinum Boarder
Posts: 873
Joined: Fri Jan 25, 2008 6:27 pm
Location: Isle of Skye, Scotland

Re:Import Weather Display data to Meteohub?

Post 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. :)
samikki
Junior Boarder
Junior Boarder
Posts: 20
Joined: Sun Jul 06, 2008 1:03 pm
Location: Kangasala, Finland

Re:Import Weather Display data to Meteohub?

Post 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
skyewright
Platinum Boarder
Platinum Boarder
Posts: 873
Joined: Fri Jan 25, 2008 6:27 pm
Location: Isle of Skye, Scotland

Re:Import Weather Display data to Meteohub?

Post 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. :)
skyewright
Platinum Boarder
Platinum Boarder
Posts: 873
Joined: Fri Jan 25, 2008 6:27 pm
Location: Isle of Skye, Scotland

Re:Import Weather Display data to Meteohub?

Post 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?
samikki
Junior Boarder
Junior Boarder
Posts: 20
Joined: Sun Jul 06, 2008 1:03 pm
Location: Kangasala, Finland

Re:Import Weather Display data to Meteohub?

Post 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...
geiro
Senior Boarder
Senior Boarder
Posts: 47
Joined: Mon Jul 18, 2011 12:42 am
Location: Oslo, Norway
Contact:

Re: Import Weather Display data to Meteohub?

Post by geiro »

anyone tried this? I have 6 years of WD data that I would love to have imported to Meteohub
geiro
Senior Boarder
Senior Boarder
Posts: 47
Joined: Mon Jul 18, 2011 12:42 am
Location: Oslo, Norway
Contact:

Re: Import Weather Display data to Meteohub?

Post by geiro »

nobody that has done this lately?
Post Reply