HTTP GET in I/O Quido modules – how to do it?

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:

  • to control Quido: GET can be used to individually and collectively control the outputs and reset the counters on the inputs.
  • to send the current status: Quido uses GET to send the current status of the inputs (and counters), outputs a thermometer periodically or when any change occurs.

Quido control

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.

Response to the control command of HTTP GET

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:

  • The result tag is always only one.
  • The status attribute contains number 1 (command executed) or 0 (command not executed).
  • The outs attribute contains a number specifying the status of all outputs. The number is decimal and must be converted to binary system to identify the status of each output. Example: Number 6 in Quido ETH 8/8 means than outputs 2 and 3 are closed/switched. (6 in the decimal system equals to 00000110 in the binary system and the numbers 1 represent closed/switched outputs.)
  • The val attribute contains 0 (output is released) or 1 (output is closed). This attribute is valid only if the command was received for a specific output.)

Sending of the current state

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.

When is the information sent?

Quido sends HTTP GET in the following cases:

  • Immediately after detecting a change on the input
  • Immediately after detecting a change on the output
  • If the measured temperature exceeds the specified limits
  • Periodically. (The interval ranges from several seconds to one hour.)

What information is sent?

The GET always contains all of the following:

  • Current status of the inputs (each input is represented by number 0 or 1)
  • Current status of the outputs (each output is represented by number 0 or 1)
  • Current status of the counters of changes on the inputs
  • The current temperature measured by the thermometer (if connected)
  • Unique identifier of Quido (MAC address)
  • User-defined name of Quido

What does HTTP GET look like?

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:

  • mac: MAC address of Quido.
  • name: User-defined name of Quido
  • ins: The current status of the inputs. 0 or 1 according to the current state. The first character in the sequence represents the first input.
  • outs: The current status of the outputs.
  • tempS: shows the status of the measured temperature. It can have the following values​​: 0 – the value is valid and shows the current temperature; 1 – waiting for the first measurement; 2 – the measured value has exceeded user-defined upper limit; 3 - the measured value has dropped below the user-defined lower limit; 4 - the value is not valid – measuring error or sensor error (damaged sensor or cable)
  • tempV: The measured temperature as a decimal number without units
  • cntX: The number of pulses recorded by the counter on input X.

Quido control by responses to HTTP GET

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

  • outs: A string showing the required status of individual outputs. The parameter must show a string whose length is exactly equal to the number of outputs. Each character corresponds to one output. The first character on the left represents the first output. The characters can be:
    • 0: open/release the output
    • 1: close/switch the output
    • x: leave the output unchanged (x is the only valid value for outputs controlled by temperature.)
  • cntX: These parameters (instead of X, specify the number of the output) can be used to subtract a value from the current state of a counter in Quido. The number you specify is subtracted from the current state of the counter. (cntX must be equal to or less than the current counter status.)

 

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

Images


Created10/22/2013
We value your privacy
This website stores cookies that help it to work properly. By using our services, you agree to their use.
Allow everythingDetailed settings