Page 1 of 1

HTTP Device & XML How to

Posted: 19 Oct 2015 18:06
by nic_rt
Dear all,
I've tried to make an HTTP Device in the smarthome UI that allows me to get the wind speed in my city. (see attached picture).
I use this in the "URL to get value" field :
http://api.wunderground.com/api/myapike ... ype:1/.xml

As you can see I use wunderground.com and I have checked that my api key is working fine (key not shown here).

I use in the "Inline Javascript to parse incoming data to number" field, this :
{var wind = parseFloat($.findOne('/response/current_observation/wind_kph/text()')); return wind;}

I'm an absolute newbie in coding in javascript and in smarthome, may be my error is obvious ... :roll:

Whatever, please let me know!
httpdevice.jpg
httpdevice.jpg (133.4 KiB) Viewed 4518 times

Re: HTTP Device & XML How to

Posted: 19 Oct 2015 18:28
by remoticz
In the Recipes section I found two community made wunderground modules. Have a look there

Re: HTTP Device & XML How to

Posted: 19 Oct 2015 21:25
by nic_rt
Thanks. In fact I took the ideas there. I was thinking that it will be simple, 2 lines implemented in the HTTP device. But it does not work.
Thus I've tried to install userModules such as wunderground, XMLdevice and none of them is working (the device appears, but no value is displayed whatever the city chosen is).
The local weather app is not working too (it was working before, but before what...)

Re: HTTP Device & XML How to

Posted: 21 Oct 2015 11:13
by TritonT
Just to confirm, Local Weather, WeatherUnderground and Wunderground Weather Services are not working for me either.

My plan was to circumvent this by creating HTTP Devices (sensorMultilevel type) and have EventGhost periodically send the values by the API, doing this I could get weather forecasts as well my own weather station data appearing in Z-Way reliably.

...:8083/ZAutomation/api/v1/devices/HTTP_Device_sensorMultilevel_10/whatevergoeshere

However, I have been unsuccessful in finding the correct syntax to 'push' the values in.

Re: HTTP Device & XML How to

Posted: 21 Oct 2015 11:56
by pz1
With these settings Wunderground Weather Services works for me on raspi2 with v2.1.1 (Click on image or scroll down for all settings)
WU.JPG
WU.JPG (33.46 KiB) Viewed 4478 times
Note that you must have a valid personal license number. Do not select xml as source format. That won't work anymore.
In the recipes section there are some instructions to taylor it for your needs. Most of the screendumps there are outdated unfortunately.

note You can't place just any location (City). Check Wunderground.com for the place nearest to you

Re: HTTP Device & XML How to

Posted: 21 Oct 2015 12:45
by nic_rt
Insteresting answers for future applications!
One more thing, I have succeeded in getting the wind speed as I want this morning using XML Device (with the same approach I suggested before in the HTML device).
It was not working fine yesterday because I have forgotten the last slash when specifying the path :

/reponse/current_observation/wind_kph/