CGI commands
CGI commands can only be executed internally from web pages on the device.
This section describes the Common Gateway Interface (CGI) available from the default or custom web pages.
The web pages enable the user to send commands from the device to the network and request information from the network.
The CGI has been modelled on the Dynalite Text protocol and the Dynalite Tasking syntax. In these protocols many of the command parameters are optional, so if a parameter is not specified then the default value (or the value that was previously specified) for this parameter is used for subsequent CGI requests. Alternatively, you may explicitly specify a value for all parameters each time a command is executed.
Issues to consider:
-
If your default page is no longer index.htm, then you must change the option in devices properties.
-
The filename WebPage.cgi is reserved for retrieving webpage data.
-
The filename SetDyNet.cgi is reserved for issuing DyNet commands.
-
The filename GetDyNet.cgi is reserved for retrieving DyNet status.
-
All files names are case sensitive on this device, following Unix and web standards.
-
The ? char is used to initialize a CGI string and the & char is used for delimiting.
For example. 192.168.2.2/GetDyNet.cgi?a=3&p=2&l
DyNet commands and status requests
Following table lists the HTTP/CGI requests available from the device.
Function | CGI request | Required & Optional Parameters | Value Required | Value Range | Description |
---|---|---|---|---|---|
Recall preset (Set) Request current preset (Get) |
P or PRESET |
Preset number Command A C, J, F |
Yes |
0 to 65535 Also supports special presets: 0=Reset Preset 65520=Off 65532=Restored Saved 65533=Toggle 65534=Panic 65535=Don’t care preset |
|
Recall channel level (Set) Request current channel level (Get) |
L or LEVEL |
Channel level Command/Parameter A C, J, F |
Yes |
0 to 100 |
Channel level in percentage 255 is special don’t know/don’t care value. |
Program/save preset (Set) |
PP or S |
Preset number Command L, A C, J |
Yes |
0 to 255 |
Saves the current channel levels to the specified preset |
Start task (Set) |
STT |
Task number Command - DC, BN |
Yes |
0 to 255 |
If DC and BN are not provided, the device’s DC and BN will be used. |
Stop task (Set) |
SPT |
Task number Command - DC, BN |
Yes |
0 to 255 |
If DC and BN are not provided, the device’s DC and BN will be used. |
Pause task (Set) |
PT |
Task number Command - DC, BN |
Yes |
0 to 255 |
If DC and BN are not provided, the device’s DC and BN will be used. |
Enable event (Set) |
EEVT |
Event number Command - - |
Yes |
0 to 255 |
0: All Events Other values: particular event number |
Disable event (Set) |
DEVT |
Event number Command - - |
Yes |
0 to 255 |
0: All Events Other values: particular event number |
Trigger event (Set) |
TEVT |
Event number Command - - |
Yes |
1 to 255 |
0: All Events Other values: particular event number |
Read task port value (Get) |
RPV |
Task port number Command - SBP |
Yes |
0 to 255 |
SBP is optional for task sub-port number |
Write on task port (Set) |
WPV |
Task port number Command - SBP |
Yes |
0 to 255 |
SBP is optional for task sub-port number |
Write on sub-task port (Set) |
SBP |
Task sub-port number Parameter RPV or WPV |
Yes |
0 to 255 |
|
Value to write to Port (Set) |
V |
Value to write Parameter WPV SBP |
Yes |
0 to 255 |
Specifies the value to write to task port. |
Nudge up (Set) |
NU |
Increment factor Command A C, J |
Yes |
0 to 100 |
Channel level in percentage |
Nudge down (Set) |
ND |
Decrement factor Command A C, J |
Yes |
0 to 100 |
Channel level in percentage |
Ramp level (Set) |
RL or RAMPLEVEL |
Ramp level value Command A C, J |
Yes |
0 to 100 |
Level in percentage |
Stop fade (Set) |
SF or STOPFADE |
Stop fading Command A C, J |
No |
||
Get temperature (Get) |
TPTR or TEMPERATURE |
Temperature in +/- xx.yy format Command A J |
No |
-64 to 64 |
Returned temperature shall be in +/- xx.yy format |
Set temperature set-point (Set) Get temperature set-point (Get) |
TPSP or TEMPERATURESETPOINT |
Temperature in +/- xx.yy format Command A J |
Yes, for Set No, for Get |
-64 to 64 |
Returned temperature shall be in +/- xx.yy format |
Get DALI ballast runtime status (Get) |
QBS |
DALI ballast runtime status Command DC, BN, C CN |
No |
Reply if CN not specified: QBS=x Reply if CN specified (for example CN=5): QBS=x;x;x;x;x x=0 : Lamp failure, ballast offline x=1 : Lamp Ok, ballast offline x=2 : Lamp failure, ballast online x=3 : Lamp Ok, ballast online C: 1 to 64 for DDBC120-DALI CN: 1 to 64 for DDBC120-DALI |
|
Set the preset offset (Set) |
O or OFFSET |
Preset offset Command A J |
Yes |
0 to 127 or 0 to 65535 |
Set the preset offset for an area. The maximum value that can be set for a DyNet 1 message is 127. The maximum value that can be set for a DyNet 2 message is 65535. |
Set reply time out (Set) Get reply time out (Get) |
REPLYTIMEOUT |
Reply time out in milliseconds Command - - |
Yes, for Set No, for Get |
200 to 20000 |
This is the amount of time that device will wait for a any request message (when GetDyNet.cgi is used) to get back with a reply. If there is no reply after this time, device will reply with an error back to the client. |
Set task register X (Set) Get task register X (Get) |
X |
X register value Command - - |
No |
0 to 255 |
|
Set task accumulator (Set) Get task accumulator (Get) |
ACC |
ACC register value Command - - |
No |
0 to 255 |
|
Area (Set or Get) |
A or AREA |
Area number Parameter - - |
Yes |
Area: 0 to 65535 Channel: 1 to 255 |
If area is not specified, then request will be processed for last area received and saved by the Xport. Else channel level for requested area will be returned, without storing the requested area. |
Join (Set or Get) |
J or JOIN |
Join value Parameter - - |
Yes |
0 to 255 |
|
Channel number (Set or Get) |
C or CHANNEL |
Channel number Parameter - - |
Yes |
0 to 65535 |
|
Number of physical channels (Get) |
CN |
Number of physical channels Parameter - - |
Yes |
0 to 65535 |
|
Box number (Set or Get) |
BN |
Box number value in physical address Parameter - - |
Yes |
0 to 255 |
|
Device Code (Set or Get) |
DC |
Device Code value in physical address Parameter - - |
Yes |
0 to 255 |
|
Fade time (Set) |
F or FADE |
Fade time in milliseconds Parameter - - |
Yes |
0 to 5,242,710 ms |
DyNet commands and status request examples
To control DyNet Areas, DyNet logical commands use the http Set method with the SetDyNet.cgi file. DyNet logical status requests use the http Get method with the GetDyNet.cgi File.
Example 1: Recalling preset 2 in area 3.
http://192.168.10.10/SetDyNet.cgi?a=3&p=2
This sets area 3 to preset 2. Multiple parameters may be used in the one request; however, only one of them should be of the command type. The response from this HTTP request automatically redirects the browser back to the calling page as detailed below.
<html><body onload=history.back()></body></html>
Example 2: Request the current preset in area 3
http://192.168.10.10/GetDyNet.cgi?a=3&p
or
http://192.168.10.10/GetDyNet.cgi?a=3
The response from this HTTP request contains the state retrieved from the DyNet area. A single numeric value is returned indicating the current preset or channel level. If the logical entity does not exist a single full stop character "." is returned. If the response shown below is returned from the request, then area 3 is in preset 4.
p=4
Example 3: Set the preset offset in area 2 to 6
http://192.168.10.10/SetDyNet.cgi?a=2&o=6
If the current preset is 4, the reply will be:
p=4 o=6
Example 4: Check the current setting for Reply Time Out and set it to a new value
Reading the current setting:
http://192.168.10.10/GetDyNet.cgi?replytimeout
returns:
replytimeout=200
Now setting it to a new value: (this is typically for wireless devices that can have very slow response times)
http://192.168.10.10/SetDyNet.cgi?replytimeout=2000
Example 5: Program Area 2, Channel 3 and Level 25% to Preset 10
http://192.168.10.10/SetDyNet.cgi?a=2&c=3,j=255&l=25&pp=10
Example 6: Fade Area 2, Channel 3 to 25% channel level with 5 seconds fade time
http://192.168.10.10/SetDyNet.cgi?a=2&c=3,j=255&l=25&f=5000
Example 7: Request the saved channel level in Area 2, Channel 3 for Preset 4
http://192.168.10.10/GetDyNet.cgi?a=2&c=3&j=255&p=4
Example 8: Request the current channel level in Area 3, channel 2 (returns 23%)
http://192.168.10.10/GetDyNet.cgi?a=3&c=2&j=255&l
or
http://192.168.10.10/GetDyNet.cgi?a=3&c=2&j=255
returns:
l=23