[ENG] 14.2. [DKSF 53/203.1 IU] Relay Control

An interface of URL-encoded commands in a device can be used to integrate with web applications without using an SNMP protocol. A relay management is available through the interface of URL-encoded commands.

Relay Status Request


N  is a number of a relay, which is indicated after ?r. 

Returned Values

An error (incorrect format of a request or an incorrect relay number):


Successful completion of a command:

relay_result('ok', 2, 1);


The first argument is always 'ok' ('error' in the case of an error).

The second argument: a relay management source (values are represented for the firmware DKST70):

0 – turned off manually

1 – turned on manually

2 – watchdog

3 – schedule

4 – schedule + watchdog

5 – logic

6 – schedule + logic

The third argument is an instant current status of a relay («0» or «1») considering functioning of the mode «Watchdog», after activating a reset, pulse issue, etc.

Switching a Relay

Changing a control source as well as manual turning on and turning off a relay:

After ?r a relay number is specified after = a number of the mode (source of control) is indicated.


n is a relay number

s is a relay operation mode. It is one of the next values:

0 – Manual off

1 – Manual on

2 – Watchdog

3 – Schedule

4 – Schedule+Watchdog

5 – Logic

6 – Schedule+Logic


Switching (inverting) a relay,on <-> off:

A relay must be set to the mode «Manual off» or «Manual on».


Short term switching a relay into an inverted status (issuing a pulse of reset):

Duration in seconds is specified after a comma. It is applicable to all modes except "logic".

Returned Values

An error is returned in case of a wrong format of a request, as a result of an incorrect/invalid value of a number of a relay or a mode.




To add a login and password to the structure of a URL-encoded command, it is possible to use the next scheme:

  • http://<username>:<password>@<host>:<port>/<URL‐path>?<parameters>


<username>:<password> – are credentials for authorization in a device web interface;

<host>  is an IP address of a device;

<port>  is a port of an HTTP server;

<URL‐path>?<parameters>  is a URL-encoded command