Virtual HTTP Input

INTRODUCTION

The virtual HTTP inputs allows you to readout a value from a website or a XML-File. This feature makes it possible to implement data inquiry of a device with web interface without PicoC.

Fields of application: heating control, PV-inverter, multimedia uses, etc.

CREATE VIRTUAL HTTP INPUT

In the periphery window click on virtual inputs and then select virtual HTTP input.

Loxone Config Virtual HTTP Input

In the Properties window of the virtual HTTP input, the protocol, address and port of the device to be controlled can be entered. Furthermore, you can set the polling cycle.

In this example a value from a website gets periodically read out. To keep it simple we use the state of a Miniserver input in this example. However, it works in a similar manner with other devices.

If authentication is needed, you can add username and password to the string as follows:

http://USERNAME:PASSWORD@IP-address

In this example we connect to the IP 10.44.44.40 with user “admin” and password “admin”.

/dev/sps/io/Test/state is the webservice-command to get the value of input “Test” on the Miniserver.

Loxone Config Virtual HTTP Input Properties

VIRTUAL HTTP COMMAND

So far the website will be reloaded every 10 seconds. To get a value, we need a virtual command.

Highlight the recently created virtual HTTP input in the periphery window and then select virtual HTTP input command.

Loxone Config Virtual HTTP Input Command

Now we take a look on the website we would like to analyse.

For that reason we simply open the page in our browser.

As shown in the screenshot, there is the keyword value=” in front of the value we would like to get:

Loxone Config Virtual HTTP Input Command Value

This is significant for the command recognition.

Our setting: value=”\v

That means: take the value (\v), after value=”

Loxone Config Virtual HTTP Input Command Value 2

A common mistake is to use \1 instead of \v. On websites, numbers are often displayed as single ASCI signs. If you interpret the sign as ASCI it will be the value it shows plus 38. For example the digit 3 has the ASCI value 41.

Back to the example:

Every 10 seconds we will receive the value of input Test on the Miniserver with the IP 10.44.44.30.

en_kb_config_virtual_http_value_test

EXTENDED COMMANDS

Just a brief overview which commands and control signs are available:

\vUsing the variable \v, the virtual HTTP input can take on the value given by the sender
\1Byte 1 (lowest significant bit)
\2Byte 2
\3Byte 3
\4Byte 4 (most significant bit)
\hUsing the variable \h, the virtual HTTP input can take on the hex value given by the sender
\xhexadecimal such as \x09 for 0x09
\\\ (Backslash)
\.any sign
\wany word
\#any number
\ttab(0x09)
\btab (0x09) or blank (0x20)
\rCarriage Return (0x0D)
\nLine Feed (0x0A)
\dany digit (0-9)
\many alphabetic< character (A-Z,a-z) or digit (0-9)
\aanyalphabetic character (A-Z,a-z)
\s12skip 12 characters (\s17 = skip 17 characters)
\ixxx\ijump to xxx such as \ivalue\i jumps after value

It is possible to use and combine multiple control signs in one command.