Getting information from Http Get-command to use in loxone.

5,785 views
Skip to first unread message

Anders Windsor

unread,
Nov 28, 2015, 11:36:10 AM11/28/15
to Loxone English
I am sorry if I am not using the right words to describe this, but a lot of services lets you get information with a http get-command, fo instance from weather underground, I can use a web-command and get back an XML-file, at the bottom of the post is an outtake from the file. I want to be able to use loxone to get for instance the temperature information, and send this information to my KNX-panel which can display the outdoor temp (it will also be useful for controlling media and so on). Any tips on how to do this?




<observation_location>
<full>Lerkendal, Trondheim, SøR-TRøNDELAG</full>
<city>Lerkendal, Trondheim</city>
<state>SøR-TRøNDELAG</state>
<country/>
<country_iso3166>NO</country_iso3166>
<latitude>63.413868</latitude>
<longitude>10.404950</longitude>
<elevation>100 ft</elevation>
</observation_location>
<estimated></estimated>
<
<temp_c>0.6</temp_c>
<relative_humidity>87%</relative_humidity>
<wind_string>Calm</wind_string>
<wind_dir>SE</wind_dir>
<wind_degrees>133</wind_degrees>

smartbusinesstools.be

unread,
Nov 29, 2015, 5:32:59 AM11/29/15
to Loxone English
Use a Virtual HTTP input and set paramter URL and polling cycle
Then add one or more Virtual HTTP input command to read the wanted value from the result. 
In your example, to read the temperature in Celcius, you can set the parameter Command recognition to \i<temp_c>\i\v

Make sure the polling cycle is not too small (e.g. 1800 seconds) because Wunderground limits #request/time. The first read however only occurs after the polling cycle expires, so for testing, set it to a smaller value e.g. 60 seconds.

The polling is fine for weather data but not for other applications. Does anyone know of a way to immediately trigger a Virtual HTTP input read, or get a similar result without using PicoC?

Anders Windsor

unread,
Nov 29, 2015, 7:12:16 AM11/29/15
to Loxone English
Thanks for  great answer! I will try that out. For my other use (getting info from the media center) an immidiate trigger would be very useful, so I am also interested in that.

Anders Windsor

unread,
Dec 30, 2015, 6:36:38 PM12/30/15
to Loxone English
I never got around to trying this before today. Bt I am struggling abit, first of all, I don't get any values out of this, if I turn on live-view, the value just stands at 0,0, i tried some different inputs, like \v \h \1 just to test, but it doesn't seem to make a difference, I get no value. Furthermore i am a bit confused by your command it seems good, but why is the /i needed at all? According to the documentation on the locone-site it seems unnecessary, but i am probably misunderstanding something.


On Sunday, November 29, 2015 at 11:32:59 AM UTC+1, smartbusinesstools.be wrote:

Patrick Van Rie

unread,
Dec 31, 2015, 1:10:10 AM12/31/15
to Loxone English
Did you see these links for the weather services "Wunderground" and "AerisWeather"? I am using the latter one, it shows Temperature, Wind speed and Humidity. In the future I'll have a look at Wunderground because it offers more info.

Op donderdag 31 december 2015 00:36:38 UTC+1 schreef Anders Windsor:

Anders Windsor

unread,
Dec 31, 2015, 5:58:36 AM12/31/15
to Loxone English
Thanks for the links, looks interesting, but changing out the entire weather-service is a bit outside the scope for me as of now, I just want to get the temperature and a few other values to send to a KNX-display i have.

Anders Windsor

unread,
Dec 31, 2015, 7:11:31 AM12/31/15
to Loxone English
According to to the Weather Underground API-page it seems like loxone is not polling the service at all. So it might not be the parsing of the info that is the problem. DOes anybody have any suggestions on how to troubleshoot this problem? Could it be a router-thing even if it is an outgoing connection? Some other setting that is wrong?

smartbusinesstools.be

unread,
Dec 31, 2015, 8:42:00 AM12/31/15
to loxone-...@googlegroups.com
Hi Anders

Can your Miniserver access any other service and DNS servers on the internet?
Did you put the correct URL value in the virtual http input? My currently working URL is something like
(I changed the API key so this link won't work here)

The parsing is correct. See at the bottom of the documentation you refer to: 
\ixxx\ijump to xxx such as  \ivalue\i jumps after value

Did you also catch my comment:
The first read however only occurs after the polling cycle expires, so for testing, set it to a smaller value e.g. 60 seconds






Anders Windsor

unread,
Dec 31, 2015, 8:50:42 AM12/31/15
to Loxone English
Yeah the URL seem to be the correct one, I am using this one:


Is there a way to check i can access other services? I am able to access the server from outside my home, by using the setting "external adress" and setting it to <mydns>:7777


On Thursday, December 31, 2015 at 2:42:00 PM UTC+1, smartbusinesstools.be wrote:
Hi Anders

Can your Miniserver access any other service and DNS servers on the internet?
Did you put the correct URL value in the virtual http input? My currently working URL is something like
(I changed the API key so this link won't work here)

The parsing is correct. See at the bottom of the documentation you refer to: 
\ixxx\ijump to xxx such as  \ivalue\i jumps after value






smartbusinesstools.be

unread,
Dec 31, 2015, 9:11:55 AM12/31/15
to Loxone English
The URL is fine. Did you set the polling cycle to just a few seconds to test, because the Miniserver only sends the request after the polling cycle time expires.
To test the connection, you could use the Ping function (in Monitoring) to ping api.wunderground.com from the Miniserver.

Anders Windsor

unread,
Dec 31, 2015, 9:50:42 AM12/31/15
to Loxone English
Pinging works fine it seems like, the request polling is set to only 60 seconds, confusing, I will try to troubleshoot some more. Thanks a lot for your help so far.

Anders Windsor

unread,
Dec 31, 2015, 11:04:08 AM12/31/15
to Loxone English
Ok, so polling the location example you provided (http://api.wunderground.com/api/88c0bc530e444f35/conditions/q/FR/Mornas.xml), worked fine (with my own API-key of course). So we are getting close :) But polling http://api.wunderground.com/api/393fa088ba6ffc31/conditions/q/pws:ISRTRNDE40.xml does not work. I see to differences that might explain it. On the latter, the temperature is given as for instance 5.6 instead og just a single number, like 11. Or it might be the semicolon in the address, maybe loxone sees the thing after the semicolon as a password or something?


On Thursday, December 31, 2015 at 3:11:55 PM UTC+1, smartbusinesstools.be wrote:

Sindre Dyvik

unread,
Jan 29, 2016, 7:32:25 AM1/29/16
to loxone-...@googlegroups.com
Hi Anders,

Was wondering how you are doing with the weatherservice. 

I'm trying to get the weatherdata from Yr.no, and managed to get the current weather, but i also want the weather forecast. I'm using the http command as well, but need to jump down in the XML code. Do you know how to do that?


Edit: Nevermind, found out how the \ixxx\i function works :)

- Sindre

Anders Windsor

unread,
Mar 6, 2016, 4:05:53 PM3/6/16
to Loxone English
How where you able to do this? For instance from http://www.yr.no/sted/Norge/S%C3%B8r-Tr%C3%B8ndelag/Trondheim/Lerkendal/varsel.xml i want to get the temprature

<observations>
<weatherstation stno="68860" sttype="eklima" name="Trondheim (Voll)" distance="2345" lat="63.41070" lon="10.45380" source="Meteorologisk Institutt">
<symbol number="3" name="Delvis skyet" time="2016-03-06T18:00:00Z"/>
<temperature unit="celsius" value="0.6" time="2016-03-06T19:00:00Z"/>
<windDirection deg="189.0" code="S" name="Sør" time="2016-03-06T19:00:00Z"/>
<windSpeed mps="2.1" name="Svak vind" time="2016-03-06T19:00:00Z"/>
</weatherstation>

The problem is that "value" is used many places in the page. The loxone help says you can string several commands together, so I tried to first use "\iobservations\i" to jump down to that part in the page, and then use value="\v. So the whole command is \iobservations\i value="\v

But it didn't work as i hoped.

Noor

unread,
Sep 5, 2016, 4:58:24 PM9/5/16
to Loxone English
I quite fancy getting a weather station for my home... do anyone know of any weather stations that can be integrated into loxone?

Thanks

N

Peter van Es

unread,
Sep 6, 2016, 2:12:33 AM9/6/16
to loxone-...@googlegroups.com
There are a few. Check this page: http://www.loxwiki.eu/pages/viewpage.action?pageId=2687120


It works like a charm. You connect the receiver to your router, make sure it has a fixed IP address, and use the virtual inputs to collect data from its internal web page. At the same time it uploads its data to Wunderground.

This station puts all its data on a single web page. The Command recognition goes as follows:

name="windir"\ivalue="\i\v

The first part finds the correct field on the page. 
the \ivalue="\i jumps after that exact string
the \v then picks up the value

For each parameter (wind speed, temperature, humidity etc etc) you create a virtual input with that sort of string.

Peter

Op maandag 5 september 2016 22:58:24 UTC+2 schreef Noor:

Dpin

unread,
Sep 24, 2017, 5:03:26 AM9/24/17
to Loxone English
Hi Guys

Just wondering if anybody knows to read out the variables runstate, poolht and spatemp, would highly appreciate any help

-<response>
  -<system>
    <runstate>1</runstate>
    <time>1506242837</time>
   </system>
  -<equipment>
    <pump>0</pump>
    <poolht>11</poolht>
   </equipment>
  -<temp>
    <pooltemp>2</pooltemp>
    <spatemp>8</spatemp>
   </temp> 
</response>


Diego


Peter van Es

unread,
Sep 25, 2017, 2:21:53 AM9/25/17
to loxone-...@googlegroups.com
Check this page: it tells you all: https://www.loxone.com/enen/kb/virtual-http-input/

Peter

Op zondag 24 september 2017 11:03:26 UTC+2 schreef Dpin:

Dpin

unread,
Sep 25, 2017, 6:40:09 AM9/25/17
to Loxone English
Hi Peter 
I did, but something is not working right, I'd think the command recognition would be something like:
\i-<system>\i<runstate>\v
but it doesn't work, Would appreciate a hand here.

Thanks

Peter van Es

unread,
Sep 25, 2017, 10:55:36 AM9/25/17
to loxone-...@googlegroups.com
You need multiple virtual inputs, one for each value you want to pick up. 

The first one could be in the command recognition field:
runstate>\v

and would pick up the value 1

The second one could be:
poolht>\v 

and would pick up the value 11

Op maandag 25 september 2017 12:40:09 UTC+2 schreef Dpin:

Dpin

unread,
Sep 25, 2017, 11:57:33 AM9/25/17
to Loxone English
Hi Peter

It doesn't seem to work. If you get any other idea let me know please

tks

Peter van Es

unread,
Sep 25, 2017, 4:27:04 PM9/25/17
to Loxone English
Can you post screenshots (similar to the manual) of your:

  • configuration
  • the exact URL and the exact response it returns
  • and Live view values of the defined variables (pretty much like in the manual I referred to earlier)
Peter

Op maandag 25 september 2017 17:57:33 UTC+2 schreef Dpin:

Diego Pinto

unread,
Sep 25, 2017, 9:27:04 PM9/25/17
to Loxone English
Hi Peter

I noticed, when I first try the http://192.168.1.20/status.xml it requests user/pass  (admin/admin) but then not anymore, I/, also attaching some screenshots for the config itself. 

Thanks a lot for your help


Pool3_Virtual HTTP Command Recognition.PNG
pool1_authentication.PNG
Pool2_xml_output.PNG
Pool3_Virtual HTTP Input.PNG

Diego Pinto

unread,
Sep 26, 2017, 2:51:33 AM9/26/17
to Loxone English
HI Peter

It worked it out, it was probably a silly mistake, the URL to the http://192.168.1.20/status.xml, needed a user/pass so I should have used it from the very beggining 

now all works fine 

Thanks in advance for your kind support

Diego

Peter van Es

unread,
Sep 27, 2017, 2:21:30 AM9/27/17
to loxone-...@googlegroups.com
Good to hear... yes, indeed adding the user and password would have been my next suggestion. Great it worked out for you.

Peter

Reply all
Reply to author
Forward
0 new messages