Request and evaluation of web pages and IP devices
Introduction
This functions allows any structured data to be sent via a TCP/IP connection and the response data to be evaluated. Sending and receiving is not limited to pure text (e.g. HTTP commands), but also allows processing using binary data.
Data can be evaluated in one of two ways:
- Simple evaluation - evaluation by defining single
data blocks.
- Complex evaluation - evaluation using a regular expression and assignment of
data blocks.
To initiate the request and evaluation of a web page/IP device, the command type
"evaluate web page/IP device"is available under
commands. The last requests are partially logged on the
debug page in section
Event-BiDir.
Purpose of use
- controlling external IP devices and evaluation of the response, e.g. IP cameras from Mobotix® or Sony®.
- call-up of web pages and the evaluation of the content, e.g. of weather pages or to display the RSS feed.
- actuation of serial devices via serial IP converter
Examples
Importing and exporting libraries
Using the import and export functions, completed requests can be stored as libraries and re-used in other projects. Single requests can be exported or a complete folder, including subfolders. If a library contains several requests then these are always imported in single steps, i.e. a maximum of one folder will be created. All requests can then be found in this folder.
When importing, the IP/host address, the IP port, user name and password can be entered for all requests. For this, the data are suggested that are found in the library to be imported by the HS Expert. All imported elements are preassigned with these values. Depending on the content of the library, different fields may be active. The user name and password fields, for instance, are only active in those cases when an HTTP request with password protection exists in the library.
If additional objects are used in the library (e.g. communication objects, sequences, etc.) then a project-specific conversion must be made in the "Objects" bar. Hereby, you can recognize which function the object has based on the object description and the type.
Note: A list of the libraries already available will be posted shortly at the internet address
http://www.dacom-homeautomation.de/.
Important notes
-
The HomeServer can receive and evaluate data up to a maximum size of 100,000 bytes. Data in excess of this limit can not be evaluated.
-
To test a web request, the debug page delivers some information. In the section Event-BiDir, all requests/evaluations made are listed:

The following data are shown:
The date and time of the request, the host address and IP port
Send: The number of characters sent, incl. display of the first character as a Hex/ASCII value.
Recv: The number of characters received, incl. display of the first character as a Hex/ASCII value.
Total: The number of defined data blocks
Work: The number of processed data blocks.
OK: 1=evaluation successful, 0=evaluation failed.
Data
Designation
The request/evaluation is kept under this name in the HomeServer Expert.
IP/Host address:
Address of the TCP/IP remote terminal. (e.g. www.gira.de or 192.168.0.1)
IP port:
The connection is opened on this port of the address.
Terminate connection after reception of a certain amount of data
Yes: The HomeServer ends the connection prematurely after receiving the number of characters stipulated in the Max. length of the response field.
No: The HomeServer waits until the remote terminal ends the connection.
Note: This option is recommended when the remote terminal does not terminate the connection or, e.g. only the fist n-characters are relevant in a web page and the rest of the data can be rejected. Attention: If the option is deactivated or if the field Max. length of the response has the value 0 then the HomeServer sets the value automatically to 100,000 bytes.
Send
The following possibilities exist to send data to the remote terminal:
-
Send HTTP request
Requests a web page from the remote terminal. The HS Expert automatically creates the suitable data blocks; a GET command is thereby always generated.
Note: The last sent telegrams and their responses can be viewed on the debug page in the "Event-BiDir" section.
URL (only path)
Path of the web page (e.g. /wetter.html).
Convert URL
Yes: The URL indicated is coded according to the HTTP standard. Example: URL /wetter von gestern.html is converted to /wetter%20von%20gestern.html
No: The data are sent as indicated to the web server.
Password protection
Yes: The web page is secured by HTTP password protection.
No: The web page can be called-up without user name and password.
User name
User name for the request. Only required when password protection is activated.
Password
Password for the request. Only required when password protection is activated.
-
Send data blocks
Data blocks can be defined in this list. The data blocks are sent to the remote terminal in the order defined.
Receive (simple evaluation)
The result of the sent request is evaluated in this screen. The
data blocks to be defined are defined in this list.
Receive (complex telegram)
If a complex telegram was defined when creating the telegram then a regular expression must be defined. The following field is used for this. The defined
data blocks depend on the regular expression.
Regular expression
Defines the regular expression which serves for evaluation of the telegram.
Commands
Commands can be run together with the evaluation of the response data. A difference is made here between a successful and an unsuccessful evaluation.
Note 1: The commands pertaining to an unsuccessful evaluation are especially suited as as indication of changed structures within a web page.
Note 2: If the connection has failed then no commands are run. The section
Event-BiDir is on the
debug page for troubleshooting.