version 0.0.9 released 2018-03-01
- Provided wind direction as a variable (currentWindDir)
New plugin [pimatic-wunderground]
version 0.0.9 released 2018-03-01
The wind speed was already available as a variable (currentWind)
@saxnpaule Is it also possible to provide access to weather history data? Ideally this should be a feature to allow for querying the temperature at a given date/time for given location, e.g. through an action provider.
https://www.wunderground.com/weather/api/d/docs?d=data/history
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
Yes, that should be possible. Could you please provide an usecase and a possible rule or action request?
What is the expected response? Do you need a specific frontend representation?
The wunderground API returns hourly or more detailed data. Is this level of detail required or is the daily summary enough?
One of the hourly measurepoints:
{
"date": {
"pretty": "6:50 PM CET on March 18, 2018",
"year": "2018",
"mon": "03",
"mday": "18",
"hour": "18",
"min": "50",
"tzname": "Europe/Berlin"
},
"utcdate": {
"pretty": "5:50 PM GMT on March 18, 2018",
"year": "2018",
"mon": "03",
"mday": "18",
"hour": "17",
"min": "50",
"tzname": "UTC"
},
"tempm": "-4.0",
"tempi": "24.8",
"dewptm": "-13.0",
"dewpti": "8.6",
"hum": "50",
"wspdm": "29.6",
"wspdi": "18.4",
"wgustm": "-9999.0",
"wgusti": "-9999.0",
"wdird": "80",
"wdire": "East",
"vism": "-9999.0",
"visi": "-9999.0",
"pressurem": "1013",
"pressurei": "29.92",
"windchillm": "-11.6",
"windchilli": "11.1",
"heatindexm": "-9999",
"heatindexi": "-9999",
"precipm": "-9999.00",
"precipi": "-9999.00",
"conds": "Clear",
"icon": "clear",
"fog": "0",
"rain": "0",
"snow": "0",
"hail": "0",
"thunder": "0",
"tornado": "0",
"metar": "METAR EDDC 181750Z 08016KT CAVOK M04/M13 Q1013 R04/91//95 TEMPO 08015G25KT"
}
Daily summary:
{
"dailysummary": [{
"date": {
"pretty": "12:20 AM CET on March 18, 2018",
"year": "2018",
"mon": "03",
"mday": "18",
"hour": "00",
"min": "20",
"tzname": "Europe/Berlin"
},
"fog": "0",
"rain": "0",
"snow": "1",
"snowfallm": "",
"snowfalli": "",
"monthtodatesnowfallm": "",
"monthtodatesnowfalli": "",
"since1julsnowfallm": "",
"since1julsnowfalli": "",
"snowdepthm": "",
"snowdepthi": "",
"hail": "0",
"thunder": "0",
"tornado": "0",
"meantempm": "-6",
"meantempi": "22",
"meandewptm": "-13",
"meandewpti": "8",
"meanpressurem": "1011.90",
"meanpressurei": "29.89",
"meanwindspdm": "35",
"meanwindspdi": "22",
"meanwdire": "East",
"meanwdird": "81",
"meanvism": "10.0",
"meanvisi": "6.2",
"humidity": "55",
"maxtempm": "-3",
"maxtempi": "26",
"mintempm": "-8",
"mintempi": "17",
"maxhumidity": "68",
"minhumidity": "43",
"maxdewptm": "-11",
"maxdewpti": "12",
"mindewptm": "-14",
"mindewpti": "7",
"maxpressurem": "1014",
"maxpressurei": "29.95",
"minpressurem": "1010",
"minpressurei": "29.83",
"maxwspdm": "48",
"maxwspdi": "30",
"minwspdm": "20",
"minwspdi": "13",
"maxvism": "10.0",
"maxvisi": "6.2",
"minvism": "10.0",
"minvisi": "6.2",
"gdegreedays": "0",
"heatingdegreedays": "44",
"coolingdegreedays": "0",
"precipm": "0.0",
"precipi": "0.00",
"precipsource": "3Or6HourObs",
"heatingdegreedaysnormal": "",
"monthtodateheatingdegreedays": "",
"monthtodateheatingdegreedaysnormal": "",
"since1sepheatingdegreedays": "",
"since1sepheatingdegreedaysnormal": "",
"since1julheatingdegreedays": "",
"since1julheatingdegreedaysnormal": "",
"coolingdegreedaysnormal": "",
"monthtodatecoolingdegreedays": "",
"monthtodatecoolingdegreedaysnormal": "",
"since1sepcoolingdegreedays": "",
"since1sepcoolingdegreedaysnormal": "",
"since1jancoolingdegreedays": "",
"since1jancoolingdegreedaysnormal": ""
}]
}
Thanks for the sample snippets.
@saxnpaule said in New plugin [pimatic-wunderground]:
Could you please provide an usecase and a possible rule or action request?
The use case is a terrarium control system which simulates the habitat of a reptile with respect to daylight, temperature, and humidity. The idea is to take the actual temperature of the natural habitat (Vietnam) into account rather than using climate tables with average temperatures. As Vietnam is 7 hours behind UTC, it is required to access the history data as the daylight cycle for is shifted to our local time.
An action to fetch the temperature/humidity at a given time or date where the given time is matched to the closest available history data) would suffice.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
Unfortunately this is not possible by the API. The API returns the whole past day with at least 12 or more datasets.
I think there needs to be a WeatherHistoryDevice that takes:
At local time 12 o’clock
Day Offset = 0 and Time Offset -7 would be today 5 o’clock at the configured location.
Time Offset = -13 would be yesterday 11 PM at given location
There is a lot of calculation needed and in case of summer/winter time in Germany there will be additional testing required.
I can give it a try with finding the nearest possible datetime in the response.
The device will provide variables for temperature, humidity and rain in a first version.
@mwittig I’m at the implementation of the device but I’m totally weird in the head now.
Everything should be calculated with the UTC date for don’t caring about daylight saving time.
If the user configures an offset of -7 hours, what should be used? 7 hours before CET or 7 hours before MEZ?
The wunderground API profides all measurepoints also in UTC, so it would be easy to find a corresponding point.
Hi @SaxnPaule
thank you for the very nice plugin. Everything is working fine except that I’m getting a lot of logging data. It seems that the plugin is polling very often. Is that normal?
I have set an upadte interval of 30 minutes in the config.
I think you misconfigured something. Do you have the latest version?
This is how my log looks like:
18:03:20.022 [pimatic-wunderground] info: Reloading weather data...
18:33:20.044 [pimatic-wunderground] info: Reloading weather data...
19:03:20.051 [pimatic-wunderground] info: Reloading weather data...
19:33:20.058 [pimatic-wunderground] info: Reloading weather data...
20:03:20.072 [pimatic-wunderground] info: Reloading weather data...
20:33:20.094 [pimatic-wunderground] info: Reloading weather data...
21:03:20.166 [pimatic-wunderground] info: Reloading weather data...
21:33:20.242 [pimatic-wunderground] info: Reloading weather data...
22:03:20.255 [pimatic-wunderground] info: Reloading weather data...
@mwittig Finally I got a first version implemented. Feel free to test it. It’s pushed to the master branch in GIT: https://github.com/saxn-paule/pimatic-wunderground
@SaxnPaule can you have a look at my config? Are ther some misconfigurations?
Plugin conf
{
"debug": true,
"plugin": "wunderground",
"active": true
},
Device config
{
"apiKey": "xxxxxxxxxxxxxx",
"lang": "DL",
"interval": 30,
"id": "wetter",
"name": "Wetter in Stuttgart",
"class": "WundergroundDevice",
"city": "Gablenberg",
"days": "1",
"country": "Germany"
}
Thank you
That looks good so far. Do you have the latest version installed?
The weather is also reloaded on page reload. If you refresh your browser every minute, a reqest is done as well.
Could you please provide the log from during night, when you were sleeping?
version 0.1.0 released 2018-03-25
@SaxnPaule sorry for the late reply. Everything is working fine. Perhaps it was just the page reload like you have mentioned. Thank you for your help and also the nice plugin.
Just one point of improvement, out of my opinion, is a more unstandable css file. It took me a while to reduce the size of the font and the icons. So maybe a scaleable size would be nice. But just an idea from my side.
You could overwrite the CSS by either editing the css file or by overwriting it via the css-inject plugin.
Yes, I did it this way (overwrite the css file) . But it took me a while to identify each parameter.
For my phone it was bit too big in comparison to the other devices. Therefore I changed your initial settings.
Mhh that’s strange. On my phone 5" FHD everything looks well.
@SaxnPaule
Nice plugin. everything works fine. Now i need to implement this in my Gui. Maybe u have an idea?