[ENG] 14.3. [DKSF 53/203.1 IU] Controlling Temperature Sensors

 HTTP API in the device can be used to integrate with web applications without using the SNMP protocol. Via HTTP API, control of temperature sensors is available.

Request of the state

http://192.168.0.100/thermo.cgi?tN

where:

N — number of the temperature sensor, indicated after ?t.

Return values

Error in the request (wrong format or wrong number of sensor):

thermo_result('error')

Successful completion of the command:

thermo_result('ok', 36, 2);

where:

The first argument: always 'ok' (upon request error - 'error').

The second argument: current temperature.

The third argument: the sensor status

0 - Sensor not connected or malfunctioning

1 - Temperature is below normal

2 - Temperature is normal

3 - Temperature above normal

Authorization

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>

where:

<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