• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Weather Underground API
#1
Hi,
if you are using the wunderground protocol you get problems with some locations because of multiple search results for this locations. E.g. Stuttgart (Germany) or Hannover (Germany).

I've made a small workaround for this:
- added an additional location value called "zmd" to the config.json in the wunderground "id" section (it's an unique location identifier, the needed value you can receive from wunderground.com)
- modified the wunderground.c - now it should use the zmd value (and not "location" and "country") if this value has been set

In the attachement there is an patch with my modifications (against wunderground.c v1.0). It would be nice if you could add this option to the next published version of the wunderground protocol.

PS: One problem still exists: If the value "zmd" has not been set in the config.json, I receive an error about the missing value. Because I've no experience with pilight protocol development, I don't know how to correctly declare this variable.


Attached Files
.txt   wundergroundC.patch.txt (Size: 3.52 KB / Downloads: 9)
 
Reply
#2
Please read the big warning here:
http://www.pilight.org/modules/protocols/ Wink
 
Reply
#3
Translation of a german saying:
"Who is able to read has a big advantage!"

I'll create the code against the development branch in the next days (meanwhile, I think I also know how to correctly set the variable as optional).
 
Reply
#4
I'm using the Weather Undeground protocol in combination with the nightly build.
Somehow I can't understand what the changes are in te protocol settings, but the result is not updating the temp & humidity

This is what I see in the GUI:
[Image: weatherundeground.jpg]


The configuration in my config.json
Code:
"weer": {
                        "protocol": [ "wunderground" ],
                        "id": [{
                                "api": "xxxx",
                                "location": "maassluis",
                                "country": "nl"
                        }],
                        "humidity": 0.00,
                        "temperature": 0.05,
                        "sunrise": 8.43,
                        "sunset": 17.02,
                        "sun": "rise",
                        "update": 1
                },

I was looking at pilight-receive and got this output:
Code:
{
        "message": {
                "api": "xxxx",
                "location": "maassluis",
                "country": "nl",
                "update": 1
        },
        "origin": "receiver",
        "protocol": "wunderground",
        "uuid": "0000-00-00-66-45aa6f"
}

Looks like it is trying to update, but is getting no weather information.
 
Reply
#5
Please read what the wiki says about the wunderground API:
Quote:1. Please notice that the weather underground interval cannot be less than 15m due to daily polling restrictions. 2. This restriction also counts for the update button in the webgui. You won't receive updates within the 15m between two updates. 3. This wiki page shows a random API key. Please register yourself at wunderground.com to get your own.
 
Reply
#6
1.) I have no polling interval configured, so I assume it's polling every 900 seconds (Default setting)
Also when I login to my weather underground page I can see that today only 16 update requests have been done.
2.) I haven't used the update button
3.) I have my own API key
 
Reply
#7
It doesn't poll every 900 seconds. It allows you to poll no more than every 900 seconds by using the update button in the webgui.
 
Reply
#8
In that case my update button is not working.
It's Yellow, so it should be clickable, but it's not.

If I read the wiki it says:
Quote:poll-interval 900 seconds What should be the poll interval of the API

My assumption is that the API (and not the button) has an interval of 900 seconds.
Also the settings above did work in the stable release, but it's not working in the nightly.

Somehow I've the idea that the settings and examples on the wiki are not nightly compatible.

I tried clicking the update button, it's Yellow now (and not greyed out) but it's not clickable/responding.

If I look at the control panel of weather underground, I can see that pilight is polling and that I have not reached my daily poll's. So where is the temperature and humidity data going ?? /dev/null ???

[Image: weatherund.jpg]
 
Reply
#9
The wiki are indeed not nightly compatible, it never was. I did some fixes to the wunderground protocol today. Either manually compile of install the one from tonight.
 
Reply
#10
Installed the nightly but still no data is returned.
pilight-daemon version 5.0, commit v5.0-193-gf300db8

Code:
{
        "message": {
                "api": "3254a8151bfd2435",
                "location": "maassluis",
                "country": "nl",
                "update": 1
        },
        "origin": "receiver",
        "protocol": "wunderground",
        "uuid": "0000-00-00-66-45aa6f"
}
Also the update button is still not clickable in the webGUI.

I've also tested my API key and if it's still receiving data. In a browser I opened http://api.wunderground.com/api/<MY API KEY>/geolookup/conditions/q/nl/maassluis.json and got a full response:

Code:
{
  "response": {
  "version":"0.1",
  "termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
  "features": {
  "geolookup": 1
  ,
  "conditions": 1
  }
    }
        ,    "location": {
        "type":"INTLCITY",
        "country":"NL",
        "country_iso3166":"NL",
        "country_name":"Netherlands",
        "state":"",
        "city":"Maassluis",
        "tz_short":"CET",
        "tz_long":"Europe/Amsterdam",
        "lat":"51.92333221",
        "lon":"4.25000000",
        "zip":"00000",
        "magic":"2",
        "wmo":"06343",
        "l":"/q/zmw:00000.2.06343",
        "requesturl":"global/stations/06343.html",
        "wuiurl":"http://www.wunderground.com/global/stations/06343.html",
        "nearby_weather_stations": {
        "airport": {
        "station": [
        { "city":"Rotterdam Geulhaven Aws", "state":"", "country":"Netherlands", "icao":"", "lat":"51.89194489", "lon":"4.31250000" }
        ,{ "city":"Rotterdam", "state":"", "country":"NL", "icao":"EHRD", "lat":"51.95371628", "lon":"4.44407177" }
        ,{ "city":"Woensdrecht", "state":"", "country":"NL", "icao":"EHWO", "lat":"51.44785690", "lon":"4.34225988" }
        ,{ "city":"Gilze-Rijen", "state":"", "country":"NL", "icao":"EHGR", "lat":"51.56499863", "lon":"4.93527794" }
        ]
        }
        ,
        "pws": {
        "station": [
        {
        "neighborhood":"Noordvliet Zuidzijde",
        "city":"Maassluis",
        "state":"",
        "country":"NL",
        "id":"IMAASSLU7",
        "lat":51.922607,
        "lon":4.254566,
        "distance_km":0,
        "distance_mi":0
        },
        {
        "neighborhood":"Prinsekade",
        "city":"Maassluis",
        "state":"",
        "country":"NL",
        "id":"IMAASSLU4",
        "lat":51.923519,
        "lon":4.258111,
        "distance_km":0,
        "distance_mi":0
        },
        {
        "neighborhood":"Van Lennepstraat",
        "city":"Maassluis",
        "state":"",
        "country":"NL",
        "id":"IMAASSLU2",
        "lat":51.920643,
        "lon":4.260080,
        "distance_km":0,
        "distance_mi":0
        },
        {
        "neighborhood":"Dutoitstraat",
        "city":"Maassluis",
        "state":"",
        "country":"NL",
        "id":"IMAASSLU5",
        "lat":51.915920,
        "lon":4.248744,
        "distance_km":0,
        "distance_mi":0
        },
        {
        "neighborhood":"\u0027s-Herenstraat",
        "city":"Maasland",
        "state":"",
        "country":"NL",
        "id":"IMAASLAN4",
        "lat":51.936138,
        "lon":4.270849,
        "distance_km":2,
        "distance_mi":1
        },
        {
        "neighborhood":"Job van der Zeelaan",
        "city":"Maassluis",
        "state":"",
        "country":"NL",
        "id":"IMAASSLU6",
        "lat":51.934250,
        "lon":4.226180,
        "distance_km":2,
        "distance_mi":1
        },
        {
        "neighborhood":"Boumare",
        "city":"Maasland",
        "state":"",
        "country":"NL",
        "id":"IMAASLAN2",
        "lat":51.930920,
        "lon":4.277010,
        "distance_km":2,
        "distance_mi":1
        },
        {
        "neighborhood":"Kastanjehof",
        "city":"Maasland",
        "state":"",
        "country":"NL",
        "id":"IMAASLAN3",
        "lat":51.936977,
        "lon":4.270450,
        "distance_km":2,
        "distance_mi":1
        },
        {
        "neighborhood":"Boumare aan de Vliet",
        "city":"Maasland",
        "state":"ZUID-HOLLAND",
        "country":"NETHERLANDS",
        "id":"IZUIDHOL181",
        "lat":51.931087,
        "lon":4.277617,
        "distance_km":2,
        "distance_mi":1
        },
        {
        "neighborhood":"Rozenburg",
        "city":"Rozenburg",
        "state":"ZUID HOLLAND",
        "country":"NETHERLANDS",
        "id":"IZUIDHOL110",
        "lat":51.904396,
        "lon":4.234235,
        "distance_km":2,
        "distance_mi":1
        },
        {
        "neighborhood":"Dwarspad",
        "city":"Rozenburg",
        "state":"",
        "country":"NL",
        "id":"IROZENBU2",
        "lat":51.901840,
        "lon":4.237762,
        "distance_km":2,
        "distance_mi":1
        },
        {
        "neighborhood":"Johanna Naberkade",
        "city":"Vlaardingen",
        "state":"",
        "country":"NL",
        "id":"IVLAARDI8",
        "lat":51.935745,
        "lon":4.331464,
        "distance_km":5,
        "distance_mi":3
        },
        {
        "neighborhood":"Vlaardingen",
        "city":"Vlaardingen",
        "state":"South Holland",
        "country":"Netherlands",
        "id":"IZHVLAAR1",
        "lat":51.914024,
        "lon":4.337512,
        "distance_km":6,
        "distance_mi":3
        },
        {
        "neighborhood":"Glidkruid",
        "city":"Vlaardingen",
        "state":"",
        "country":"NL",
        "id":"IVLAARDI6",
        "lat":51.933762,
        "lon":4.338290,
        "distance_km":6,
        "distance_mi":3
        },
        {
        "neighborhood":"Lariksdreef",
        "city":"Vlaardingen",
        "state":"",
        "country":"NL",
        "id":"IVLAARDI5",
        "lat":51.935799,
        "lon":4.342350,
        "distance_km":6,
        "distance_mi":3
        },
        {
        "neighborhood":"J. de Klerkstraat",
        "city":"Brielle",
        "state":"",
        "country":"NL",
        "id":"IBRIELLE2",
        "lat":51.901554,
        "lon":4.161197,
        "distance_km":6,
        "distance_mi":3
        },
        {
        "neighborhood":"Lindendreef",
        "city":"Vlaardingen",
        "state":"",
        "country":"NL",
        "id":"IVLAARDI2",
        "lat":51.940384,
        "lon":4.343538,
        "distance_km":6,
        "distance_mi":4
        },
        {
        "neighborhood":"Esdoorndreef",
        "city":"Vlaardingen",
        "state":"",
        "country":"NL",
        "id":"IVLAARDI3",
        "lat":51.938862,
        "lon":4.347320,
        "distance_km":6,
        "distance_mi":4
        },
        {
        "neighborhood":"Hartmansstraat",
        "city":"Vlaardingen",
        "state":"",
        "country":"NL",
        "id":"IVLAARDI9",
        "lat":51.915440,
        "lon":4.353166,
        "distance_km":7,
        "distance_mi":4
        },
        {
        "neighborhood":"Otto van Egmondlaan",
        "city":"Schipluiden",
        "state":"",
        "country":"NL",
        "id":"ISCHIPLU2",
        "lat":51.975147,
        "lon":4.320149,
        "distance_km":7,
        "distance_mi":4
        },
        {
        "neighborhood":"Aalbersestraat",
        "city":"Naaldwijk",
        "state":"",
        "country":"NL",
        "id":"INAALDWI7",
        "lat":51.993465,
        "lon":4.219958,
        "distance_km":8,
        "distance_mi":4
        },
        {
        "neighborhood":"Schaepmanstraat",
        "city":"Naaldwijk",
        "state":"",
        "country":"NL",
        "id":"INAALDWI2",
        "lat":51.994381,
        "lon":4.217440,
        "distance_km":8,
        "distance_mi":4
        },
        {
        "neighborhood":"Abtsrechtseweg",
        "city":"Schipluiden",
        "state":"",
        "country":"NL",
        "id":"ISCHIPLU3",
        "lat":51.979366,
        "lon":4.329030,
        "distance_km":8,
        "distance_mi":4
        },
        {
        "neighborhood":"Sint Martinusstraat",
        "city":"Naaldwijk",
        "state":"",
        "country":"NL",
        "id":"INAALDWI6",
        "lat":51.995354,
        "lon":4.210407,
        "distance_km":8,
        "distance_mi":5
        },
        {
        "neighborhood":"P.C. Hooftstraat",
        "city":"Spijkenisse",
        "state":"",
        "country":"NL",
        "id":"ISPIJKEN9",
        "lat":51.854729,
        "lon":4.311076,
        "distance_km":8,
        "distance_mi":5
        },
        {
        "neighborhood":"Delft",
        "city":"Zuid Holland",
        "state":"Netherlands",
        "country":"Netherlands",
        "id":"IDELFT1",
        "lat":51.979519,
        "lon":4.341783,
        "distance_km":8,
        "distance_mi":5
        },
        {
        "neighborhood":"Kievitslaan",
        "city":"Schiedam",
        "state":"",
        "country":"NL",
        "id":"ISCHIEDA3",
        "lat":51.934845,
        "lon":4.381451,
        "distance_km":9,
        "distance_mi":5
        },
        {
        "neighborhood":"Oude Woerdlaan",
        "city":"Naaldwijk",
        "state":"",
        "country":"NL",
        "id":"INAALDWI5",
        "lat":52.001297,
        "lon":4.205193,
        "distance_km":9,
        "distance_mi":5
        },
        {
        "neighborhood":"Hoek van Holland",
        "city":"Hoek Van Holland",
        "state":"ZUID-HOLLAND",
        "country":"NETHERLANDS",
        "id":"IZUIDHOL123",
        "lat":51.975689,
        "lon":4.145247,
        "distance_km":9,
        "distance_mi":5
        },
        {
        "neighborhood":"City",
        "city":"Schiedam",
        "state":"ZUID-HOLLAND",
        "country":"NEDERLAND",
        "id":"IZUIDHOL179",
        "lat":51.913101,
        "lon":4.385060,
        "distance_km":9,
        "distance_mi":5
        },
        {
        "neighborhood":"Westfrankelandsestraat",
        "city":"Schiedam",
        "state":"",
        "country":"NL",
        "id":"ISCHIEDA2",
        "lat":51.913612,
        "lon":4.387730,
        "distance_km":9,
        "distance_mi":5
        },
        {
        "neighborhood":"Graaf Florisstraat",
        "city":"Schiedam",
        "state":"",
        "country":"NL",
        "id":"ISCHIEDA5",
        "lat":51.911991,
        "lon":4.389493,
        "distance_km":9,
        "distance_mi":5
        },
        {
        "neighborhood":"Groenelaan",
        "city":"Honselersdijk",
        "state":"",
        "country":"NL",
        "id":"IHONSELE2",
        "lat":52.011463,
        "lon":4.222612,
        "distance_km":9,
        "distance_mi":5
        },
        {
        "neighborhood":"Meropestraat",
        "city":"Hook Of Holland",
        "state":"",
        "country":"NL",
        "id":"IHOOKOFH2",
        "lat":51.980667,
        "lon":4.137643,
        "distance_km":9,
        "distance_mi":5
        },
        {
        "neighborhood":"Westland",
        "city":"\u0027s-Gravenzande",
        "state":"ZUID-HOLLAND",
        "country":"NETHERLANDS",
        "id":"IZUIDHOL94",
        "lat":52.000885,
        "lon":4.173863,
        "distance_km":10,
        "distance_mi":6
        },
        {
        "neighborhood":"Theo Dobbepad",
        "city":"Hoogvliet Rotterdam",
        "state":"",
        "country":"NL",
        "id":"IHOOGVLI4",
        "lat":51.861591,
        "lon":4.358032,
        "distance_km":10,
        "distance_mi":6
        },
        {
        "neighborhood":"Den Hoorn",
        "city":"Den Hoorn",
        "state":"SOUTH HOLLAND",
        "country":"NETHERLANDS",
        "id":"ISOUTHHO16",
        "lat":51.999977,
        "lon":4.334674,
        "distance_km":10,
        "distance_mi":6
        }
        ]
        }
        }
    }
  ,    "current_observation": {
        "image": {
        "url":"http://icons.wxug.com/graphics/wu2/logo_130x80.png",
        "title":"Weather Underground",
        "link":"http://www.wunderground.com"
        },
        "display_location": {
        "full":"Maassluis, Netherlands",
        "city":"Maassluis",
        "state":"",
        "state_name":"Netherlands",
        "country":"NL",
        "country_iso3166":"NL",
        "zip":"00000",
        "magic":"2",
        "wmo":"06343",
        "latitude":"51.92333221",
        "longitude":"4.25000000",
        "elevation":"2.00000000"
        },
        "observation_location": {
        "full":"Rozenburg, Rozenburg, ZUID HOLLAND",
        "city":"Rozenburg, Rozenburg",
        "state":"ZUID HOLLAND",
        "country":"NETHERLANDS",
        "country_iso3166":"NL",
        "latitude":"51.904396",
        "longitude":"4.234235",
        "elevation":"0 ft"
        },
        "estimated": {
        },
        "station_id":"IZUIDHOL110",
        "observation_time":"Last Updated on January 17, 11:57 AM CET",
        "observation_time_rfc822":"Sat, 17 Jan 2015 11:57:27 +0100",
        "observation_epoch":"1421492247",
        "local_time_rfc822":"Sat, 17 Jan 2015 11:57:28 +0100",
        "local_epoch":"1421492248",
        "local_tz_short":"CET",
        "local_tz_long":"Europe/Amsterdam",
        "local_tz_offset":"+0100",
        "weather":"Mostly Cloudy",
        "temperature_string":"39.4 F (4.1 C)",
        "temp_f":39.4,
        "temp_c":4.1,
        "relative_humidity":"92%",
        "wind_string":"From the West at 4.5 MPH Gusting to 4.5 MPH",
        "wind_dir":"West",
        "wind_degrees":270,
        "wind_mph":4.5,
        "wind_gust_mph":"4.5",
        "wind_kph":7.2,
        "wind_gust_kph":"7.2",
        "pressure_mb":"1014",
        "pressure_in":"29.95",
        "pressure_trend":"0",
        "dewpoint_string":"37 F (3 C)",
        "dewpoint_f":37,
        "dewpoint_c":3,
        "heat_index_string":"NA",
        "heat_index_f":"NA",
        "heat_index_c":"NA",
        "windchill_string":"36 F (2 C)",
        "windchill_f":"36",
        "windchill_c":"2",
        "feelslike_string":"36 F (2 C)",
        "feelslike_f":"36",
        "feelslike_c":"2",
        "visibility_mi":"6.2",
        "visibility_km":"10.0",
        "solarradiation":"--",
        "UV":"1","precip_1hr_string":"0.00 in ( 0 mm)",
        "precip_1hr_in":"0.00",
        "precip_1hr_metric":" 0",
        "precip_today_string":"0.00 in (0 mm)",
        "precip_today_in":"0.00",
        "precip_today_metric":"0",
        "icon":"mostlycloudy",
        "icon_url":"http://icons.wxug.com/i/c/k/mostlycloudy.gif",
        "forecast_url":"http://www.wunderground.com/global/stations/06343.html",
        "history_url":"http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=IZUIDHOL110",
        "ob_url":"http://www.wunderground.com/cgi-bin/findweather/getForecast?query=51.904396,4.234235",
        "nowcast":""
    }
}
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  [Partially Supported] TFA / Conrad Weather Yves 184 10,320 03-31-2019, 05:22 PM
Last Post: curlymo
  Bresser 3Ch weather sensors Harald654 13 4,367 02-15-2019, 01:06 PM
Last Post: saak2820
  Weather Station Globaltronics GT-WT-01 Prutsky 13 6,894 04-09-2018, 07:34 PM
Last Post: NevelS
  Weather Underground "wunderground" humidity wimThoelke 6 1,424 10-23-2017, 09:44 PM
Last Post: wimThoelke
  Weather Sensor NC-7345-675 OllRo 7 2,982 03-29-2016, 04:01 PM
Last Post: LukaNoah
  Mebus 06181 weather station stefanroellin 0 1,595 12-27-2015, 06:36 PM
Last Post: stefanroellin
  GPIO Weather koos147 0 1,513 04-01-2015, 08:28 PM
Last Post: koos147
  Weather Sensor Wrong Temp lechiel 1 1,923 03-23-2015, 03:21 PM
Last Post: pilino1234
  Connect digital weather sensor Pitter2014 44 29,441 01-06-2015, 11:13 AM
Last Post: curlymo
  Weather LogiLink WS0001 Strunz02 10 6,584 08-15-2014, 06:54 PM
Last Post: Strunz02

Forum Jump:


Browsing: 1 Guest(s)