Page 1 of 1

OpenWeatherMap

Posted: Wed 08 Jan 2014 1:48 pm
by WoodburyMan
Do you know if Cumulus plans to support OpenWeatherMap in any version of Cumulus in the near future? It seems to be becoming a fairly popular weather site which many apps use. Meteohub and Metobridge currently support it. I currently have a Pebble Smartwatch, and there are quite a number of apps for it that draw data from OpenWeatherMap.. as well if you're into custom firmware for Android devices, the #1 Custom Firmware for many devices CyanogenMod, also used OpenWeatherMap to draw data for Weather on the phone's lockscreen.

http://openweathermap.org/Maps


They also document the API to upload to it, as well as download data from it.
http://openweathermap.org/wiki/API/data_upload

Even if it will not be supported, anyone have any ideas on how to publish this? I was reading up on possibly creating a simple VisualBasic (only thing besides php I know) to be triggered by Cumulus' external program option and have it pull the data from Cumulus and upload via HTTP POST method... however that may be beyond my skills.

Re: OpenWeatherMap

Posted: Wed 08 Jan 2014 2:03 pm
by steve
It won't be in the near future, I just don't have the time - sorry. I get requests to support web sites like this at least once a week. At least it's a simple protocol so if I ever did get around to it, it wouldn't too hard.

wget handles POST and allows a file as input, so you could perhaps get Cumulus to process a file and then use that as input to wget...

Re: OpenWeatherMap

Posted: Wed 08 Jan 2014 2:25 pm
by steve
Actually, I see that my data is on there anyway - they're getting it from CWOP.

Re: OpenWeatherMap

Posted: Thu 09 Jan 2014 2:14 am
by WoodburyMan
steve wrote:Actually, I see that my data is on there anyway - they're getting it from CWOP.
Ahhhhh awesome. That's much easier then. Just signed up for CWOP...
http://www.findu.com/cgi-bin/find.cgi?call=EW4301
Send in email in confirming position verification so hopefully it will show up soon on their map.

Thanks! And thanks for your awesome work with Cumulus!!

Re: OpenWeatherMap

Posted: Thu 09 Jan 2014 8:37 am
by steve
Yes, I can see you on CWOP now, and on OpenWeatherMap.

Re: OpenWeatherMap

Posted: Sun 25 Jan 2015 9:26 am
by bladel
I wrote a short batch script to post the data via curl:


-get curl for windows
-create a batch file in your cumuls directory

Code: Select all

::
::Variables
::change here
set login=User
set password=Password
set apikey=123456789abcdefghij
set station_name=MyWeatherStaion
set long=1.234
set lat=56.789
set alt=123
::
::use curl
::
C:\curl_X64_ssl\winssl\curl.exe --basic -d "wind_dir=<#bearing>&wind_speed=<#wspeed>&wind_gust=<#wgust>&temp=<#temp>&humidity=<#hum>&pressure=<#press>&rain_1h=<#rhour>&rain_today=<#rmidnight>&lat=%lat%&long=%long%&alt=%alt%&name=%station_name%" --user "%login%:%password%" -H "x-api-key:%apikey%" http://openweathermap.org/data/post
-add bat file to Internet settings-Files (processed files)
Local filename: C:\Cumulus\openweather.bat
Remote filename C:\Cumulus\openweather_processed.bat

-add the processed bat to external programs
Realtime Program: C:\Cumulus\openweather_processed.bat
Image

Re: OpenWeatherMap

Posted: Fri 06 Feb 2015 4:37 pm
by thecivvie
Great script, do they need it realtime or would every 5 mins do. I cannot see any thing on their website

Re: OpenWeatherMap

Posted: Sun 12 Apr 2015 3:58 pm
by EveshamWeather
Has anyone had an success recently using curl to submit information? I have been registered on COAA for nearly a year but cannot see my data on Openweathermap so decided to submit it using the script. Unfortunately I am getting {"message":"Unauthorized.","cod":"401"} error messages.

Re: OpenWeatherMap

Posted: Mon 07 Mar 2016 1:23 pm
by Megachip
EveshamWeather wrote:Has anyone had an success recently using curl to submit information? I have been registered on COAA for nearly a year but cannot see my data on Openweathermap so decided to submit it using the script. Unfortunately I am getting {"message":"Unauthorized.","cod":"401"} error messages.
Do you set username, password and api key correctly?

Re: OpenWeatherMap

Posted: Tue 08 Mar 2016 3:27 pm
by Megachip
I've extend the script a bit:
-rain24h
-solar rad
-uv
-dewpoint

Code: Select all

::
::Variables
::change here
set login=INSERTLOGIN
set password=INSERTPASSWORD
set apikey=INSERTAPIKEY
set station_name=Peter's Wetter
set curlpwd=E:\Curl
::
::use curl
::
%curlpwd%\curl.exe --basic -d "wind_dir=<#bearing>&wind_speed=<#wspeed>&wind_gust=<#wgust>&temp=<#temp>&humidity=<#hum>&pressure=<#press>&rain_1h=<#rhour>&rain_24h=<#r24hour>&rain_today=<#rmidnight>&lum=<#SolarRad>&uv=<#UV>&dewpoint=<#dew>&lat=<#latitude dp=5 rc=y>&long=<#longitude dp=5 rc=y>&alt=<#altitude dp=0>&name=%station_name%" --user "%login%:%password%" -H "x-api-key:%apikey%" http://openweathermap.org/data/post
@Steve
Why there isn't the possibility to get the altitude without the unit (like long and lat)?
How to get an point instead of an comma for all values?

Re: OpenWeatherMap

Posted: Tue 08 Mar 2016 3:41 pm
by steve
Megachip wrote:Why there isn't the possibility to get the altitude without the unit (like long and lat)?
How to get an point instead of an comma for all values?
Normally, you can do both of those things with a bit of javascript, but obviously not in this case.

You can't do it currently because I haven't got around to it, sorry. There was a time when I spent five or six hours a day on Cumulus, as well as doing my day job. I eventually realised how stupid that was, and I am no longer prepared to spend more than an hour or two a day, and all of that is usually taken up with the forum and email. But maybe one day I will find some time to add the required changes - in Cumulus MX.

Re: OpenWeatherMap

Posted: Tue 08 Mar 2016 4:31 pm
by mcrossley
You could use something like (untested)...

Code: Select all

set altitude="<#altitude>"
REM eg. altitude="70&nbsp;m"
REM remove units
set altitude=%altitude:&nbsp;m=%
set altitude=%altitude:"=%

echo %altitude%

REM change comma decimal to dot
set rain_1h=<#rhour>
set rain_1h=%rain_1h:,=.%

echo %rain_1h%

Re: OpenWeatherMap

Posted: Thu 05 May 2016 4:15 pm
by philpugh
Hi

I am trying to submit data to Openweathermap also.

I have written a small python prog to run on the Banana Pi using MySQL to get the data.

The string below is the 'command' I generate and send...
curl -d 'temp=19.9&wind_speed=3.7&wind_dir=180&pressure=1016.12&rain_today=0.0&lum=366.0&uv=3.0&lat=53.32&long=-2.54&alt=68&name=Goosegate' --user 'user:pass' -H 'x-api-key:somelongstring' http://openweathermap.org/data/post
(I have altered the user:password and API key (obviously)!

I get back the following - each time I send data..
{"message":"","cod":"200","id":1461056386}
THis looks OKish to me - but nothing appears on the website. Other than sign up (which I have) do you need to do anything else to 'create' a personal station other than send data - as implied on their website. I must say they are most unhelpful - no response to an email for over two weeks now.