HTTP Device & XML How to

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
nic_rt
Posts: 29
Joined: 26 Sep 2015 15:00

HTTP Device & XML How to

Post by nic_rt » 19 Oct 2015 18:06

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 3521 times
Nick


Raspberry + Razberry + FGS221 x 4 + FGRM 222 + Aeon Labs Micro Motor Controller + FGK 101 + Z-Wave Aeotec Smart Plug-in Switch GEN5 + Minimote + Aeotec KeyFob + Greenwave Smart Power Node x 2

remoticz
Posts: 45
Joined: 07 Oct 2015 20:35
Location: no

Re: HTTP Device & XML How to

Post by remoticz » 19 Oct 2015 18:28

In the Recipes section I found two community made wunderground modules. Have a look there
v2.1.1 raspi2

nic_rt
Posts: 29
Joined: 26 Sep 2015 15:00

Re: HTTP Device & XML How to

Post by nic_rt » 19 Oct 2015 21:25

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...)
Nick


Raspberry + Razberry + FGS221 x 4 + FGRM 222 + Aeon Labs Micro Motor Controller + FGK 101 + Z-Wave Aeotec Smart Plug-in Switch GEN5 + Minimote + Aeotec KeyFob + Greenwave Smart Power Node x 2

TritonT
Posts: 9
Joined: 16 Oct 2015 19:13

Re: HTTP Device & XML How to

Post by TritonT » 21 Oct 2015 11:13

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.

pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: HTTP Device & XML How to

Post by pz1 » 21 Oct 2015 11:56

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 3481 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

nic_rt
Posts: 29
Joined: 26 Sep 2015 15:00

Re: HTTP Device & XML How to

Post by nic_rt » 21 Oct 2015 12:45

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/
Nick


Raspberry + Razberry + FGS221 x 4 + FGRM 222 + Aeon Labs Micro Motor Controller + FGK 101 + Z-Wave Aeotec Smart Plug-in Switch GEN5 + Minimote + Aeotec KeyFob + Greenwave Smart Power Node x 2

Post Reply