Open Weather Map

I am not sure if that is true…
I have an API key, that I use for example Xamarin Weather App for my students, but also I have generated an station and the API tells that you upload to the generated station ID.
At least, that is what I have read here:

I think you could probably create one and use based on lat-lon, but I am not sure if every time I start Weather-Display, a diferent station is created. I am not sure also if you have any limit with your apikey. You could see all the stations that OWM have created using your api key.
http://api.openweathermap.org/data/3.0/stations

And also I think that you could retrieve your station information only if you know your id and station id. On the map, you can see it, I think that the stations also, but only current basic information. But maybe you can retrieve to use with your personal apps for example (Like OpenHAB).

I try now your setup, and tomorrow try to see if new station appears on map.

Ruben


Anotación 2019-04-03 232430.jpg

you might be right
I think the way I am doing it, there is a new station created each time
and instead I need to have it where you can set the station ID?
(but where/how do you get that?)

The problem is that OWM doesn’t have a web UI to create the stations, so it must be created with a POST web petition. I have used some web services that allow do POST, GET, etc petitions with custom headers (I don’t remember which one, but I can search, because not all works correctly). So doing this:
[POST] http://api.openweathermap.org/data/3.0/stations?appid=ab19XXXXXXX and adding this JSON header:
{
“external_id”: “SF_TEST001”,
“name”: “San Francisco Test Station”,
“latitude”: 37.76,
“longitude”: -122.43,
“altitude”: 150
}
with your custom data, external_id is like a code that you can asign, in my case I have used “OWMALCOIBARA1”, name: “Alcoi - Baradello Gelat”, lat, lon and altitude of my station.
If all works correctly, it returns this:
{
“ID”: “583436dd9643a9000196b8d6”,
“updated_at”: “2016-11-22T12:15:25.96727176Z”,
“created_at”: “2016-11-22T12:15:25.967271732Z”,
“user_id”: “557066d0ff7a7e3897531d94”,
“external_id”: “SF_TEST001”,
“name”: “San Francisco Test Station”,
“latitude”: 37.76,
“longitude”: -122.43,
“altitude”: 150,
“source_type”: 5
}
The ID could be used for future petitions to your station.
So you can send data to your station with this:
[POST] http://api.openweathermap.org/data/3.0/measurements?appid=ab19XXXXXXX
putting the data and station ID on the JSON header content:
[
{
“station_id”: “583436dd9643a9000196b8d6”,
“dt”: 1479817340,
“temperature”: 18.7,
“wind_speed”: 1.2,
“wind_gust”: 3.4,
“pressure”: 1021,
“humidity”: 87,
“rain_1h”: 2,
“clouds”: [
{
“condition”: “NSC”
}
]
}
]

I only have created the station, and I am waiting Weather-Display could upload data to it :lol: :lol: :lol:
All the API documentation is here:
https://openweathermap.org/stations

Ruben

that is what I have done
but
what I am doing wrong
is am the doing the first part every time
and so a new station id is created and used each time
looks like I only need to do that once, store that station id, and use next time for data send
I will make that change now…
standby

use this update
http://www.weather-display.com/downloadfiles/cronopenweathermap.zip
I guess I should though have that station id made visible,once its created, e.g back in the setup ?

I haven’t tested yet the new version, when I could test it, I tell you here.
Maybe you can put a “Register Station” button, and then the station id is shown in a text label and remain saved on config.

Ruben

Enviat des del meu SM-T280 usant Tapatalk

the latest test update has it
Where the station ID is shown now
The next time you go back to the setup

Hi

Following this with interest. Tried the latest build. When I click on “view your data” it goes off to the Wunderground site. Probably low on priorities, but thought I would mention it!

Cheers

I will remove that link
as I do not actually know how to view on the web the data you send to open weather map?
does any one know?

I have updated to this one: http://www.weather-display.com/downloadfiles/weatherdisplaytest.zip but I don’t appreciate any difference with the previous version. Also tried the openweathercron update. No station Id or “create station” or something like this, only same information as before (lat, lon, name, and altitude).

In the case to test data send, the api tells this one:
https://api.openweathermap.org/data/3.0/measurements?station_id=816aXXXXX&type=h&limit=100&appid=b1b1XXXXXX
With the type as the kind of agregated information of your station: “Type of the aggregated data - minute, hour or day. Specifies the letters m, h or d respectively”
“This method is used for receiving the aggregated measurements from the station. In total are supported 3 types of units - minute, hour and day”

It returns something like this:
[
{
“type”: “m”,
“date”: 1480508280,
“station_id”: “583d7bbbebb3ff000123f1ce”,
“temp”: {
“max”: 22.7,
“min”: 21.7,
“average”: 22.03,
“weight”: 3
},
“humidity”: {
“average”: 76.33,
“weight”: 3
},
“wind”: {
“deg”: 160,
“speed”: 3.3
},
“pressure”: {
“min”: 1031,
“max”: 1033,
“average”: 1031.67,
“weight”: 3
},
“precipitation”: {}
},
{
“type”: “m”,
“date”: 1480599660,
“station_id”: “583d7bbbebb3ff000123f1ce”,
“temp”: {
“max”: 21.7,
“min”: 21.7,
“average”: 21.7,
“weight”: 1
},
“humidity”: {
“average”: 77,
“weight”: 1
},
“wind”: {},
“pressure”: {
“min”: 1031,
“max”: 1031,
“average”: 1031,
“weight”: 1
},
“precipitation”: {}
}
]

In the sample, lacks to params, the from and to timestamp in unix format:
I have tested this one (but my station hasn’t currently any data):
https://api.openweathermap.org/data/3.0/measurements?station_id=5c927d0XXXXXXX&type=h&limit=100&from=1554076800&to=1554657771&appid=ab19d2f302dXXXXXXX

Ruben

yes, I do know of that, that is how I know the data was being sent OK, as I was able to get it back OK
but that is not all that useful information, being just average data ?
anyway, try again that download, new update
http://www.weather-display.com/downloadfiles/weatherdisplaytest.zip

I am testing it… but not apreciable diference. I can’t see stationid (and also I can’t put apikey to avoid all people use yours).
And it is the last test version, because has MQTT option (this is the next thing I have to try with OpenHab).

Ruben

The station id
Should be showing
Just after where it says
Station id:

That works for me
Maybe u do not have the latest
Cronopenweathermap.exe
That is included in the latest full install

You might want to blank your password in that screen shot?

Thanks, I don’t realize that WUnderground password appears bottom ;-)… :lol: Thanks!

I have replaced with the Cronopenweathermap.exe that is on last weatherdisplaytest.zip
Is this ok?

No Id yet… maybe I need to change lat/lon/name?

I think could be better that we could put our own apikey, or we can’t recover data from our station (as we need to put always apikey to see it).

Ruben
PD: Maybe a apikey textbox, plus a button “Create station” that returns and fill station id, could be great :wink:

just tested here again
brand new setup
it works
(after clicking on test and then go back into that setup)
see the attached

http://www.weather-display.com/downloadfiles/cronopenweathermap.zip


Working last update!
I have to remove blank whitespaces on station name… maybe this was the problem before.

Ruben

spaces should never be used on the internet for data ideally (use _ instead of a space if you need to use a space)?