I/O Quido modules are designed for the remote control and supervision of technologies. They are equipped with inputs for contacts and voltage and with high-performance relay on the outputs. It is possible to easily control Quido via HTTP GET. And Quido is able to use HTTP GET to send the state of the inputs and outputs to a remote server. In this article you will learn how simple it is to use HTTP GET.
HTTP GET in Quido serves two basic functions:
The basic use of the HTTP GET command in Quido is the direct control of outputs and resetting of counters. It's undoubtedly the easiest way to control Guido from your system.
The following commands can be used to easily control the outputs and counters of Quido. GETs are received by the set.xml script. Access to this script is secured with a user name and a password.
Close (switch) the output
Example: set.xml?type=s&id=1
This command closes the output whose number is specified in id (OUT1 in this case).
By adding time parameter you can set for how long the output should be ON. You can enter a number from 1 to 255 corresponding with 0.5 to 127.5 seconds ON time.
Open (release) the output
Example: set.xml?type=r&id=5
By adding time parameter you can set for how long the output should be OFF. You can enter a number from 1 to 255 corresponding with 0.5 to 127.5 seconds OFF time.
Invert the output
Example: set.xml?type=i&id=12
This command inverts the output whose number is specified in id.
Generate a pulse on the output
Example: set.xml?type=p&id=2
(The pulse length can be adjusted individually for each output on the web interface of Quido)
Deduction from a counter
Example: set.xml?type=c&id=3&cnt=274
This command can be used to subtract the entered value from the current state of a counter. The number of the counter is specified in id. The value to be subtracted is in cnt parameter. (The cnt value must be equal to or less than the current counter status.)
(This command is not implemented in Quido ETH 3/0, 3/0B and 0/2. The deduction can be accomplished using XML responses described in the documentation of Quido ETH page 40 and 41.)
Reset (clear) all counters
Example: set.xml?type=C
This command can reset (clear) the current value of all counters simultaneously. (This command is not implemented in Quido ETH 3/0, 3/0B and 0/2. The deduction can be accomplished using XML responses described in the documentation of Quido ETH page 40 and 41.)
Close (switch) all outputs
Example: set.xml?type=S
This command can be used to close (switch) all the outputs at the same time (only if they are in the manual mode).
Open (release) all outputs
Example: set.xml?type=R
This command can be used to open (release) all the outputs at the same time (only if they are in the manual mode).
Set multiple outputs simultaneously
Example: set.xml?type=A&sts=00110x01
This command can be used to set the status of several outputs simultaneously. (The above example applies to Quido ETH 8/8, so the number of characters is 8.) The first character in the sequence represents the output OUT1. One of these three characters is expected: 0 (open/release the output), 1 (close/switch the output) or x (leave the output unchanged)
Setting multiple outputs for a specific period of time
Example: set.xml?type=T&sts=10xxxxxx&time=5
In this way, multiple outputs can be set for a certain period of time at the same time.16 The stscontains exactly as many characters as is the number of Quido outputs. (The above example applies to Quido ETH 8/8, so the number of characters is 8.) The first character in the sequence represents the output OUT1. One of these three characters is expected: 0 (open/release the output for the period time), 1 (close/switch the output for the period time) or x (leave the output unchanged). The time parameter is a number in the range 1 to 255, corresponding to times 0.5 to 127.5 sec.
Responses to the commands are in the XML format. An example can be found below:
<?xml version="1.0" encoding="ISO-8859-1"?> <root> <result status="1" outs="6" val="0" pic="7"/> </root>
The meaning of individual parameters in the XML is as follows:
Another possibility is to use the HTTP GET commands to send the current state of the I/O Quido module. Quido sends a GET to the server and in response it may receive a command in XML format to change the status.
Quido sends HTTP GET in the following cases:
The GET always contains all of the following:
An example of HTTP GET sent by Quido ETH 8/8 (this I/O module has 8 inputs, 8 outputs and one thermometer):
script.php?mac=00-20-4A-B4-8D-F7&name=Office&ins=01101010&outs=00100010&tempS=0&tempV=21.8&cnt2=235&cnt6=126
The meaning of individual parameters in HTTP GET is the following:
Why? When Quido is part of the internal network and your server is somewhere on the Internet, it may be difficult to send commands from the Internet to the internal network to control Quido. It is necessary to establish a “tunnel” from the Internet to the internal network, which could be a safety problem. The solution is to control Quido by responses to HTTP GET.
Quido can be configured to send information about its current state periodically (e.g. every 15 seconds) in the form of HTTP GET. Your server can then respond to the received information by a simple text in the XML format to set the status of the outputs or reset to the counters on the inputs.
An example? Here it is: Quido has sent the aforesaid HTTP GET to your server. The server assessed the message immediately and in response it sent this brief text in the standard XML format.
<?xml version="1.0" encoding="ISO-8859-1"?> <root> <set outs="0x10x010" cnt2="235" cnt6="12" /> </root>
The set node contains individual parameters that can be used to set the status of the outputs or change the status of the counters. (Full details are provided in the Quido manual.)
Did you know that complete information about the current state of Quido is also available in the popular XML format?
See the article XML in Quido...