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