-----------------------------------------------------------------------------------------------------------------------

 Description of HTTP GET from VALUES.JSON and VALUES-EX.JSON for TAx6xx and PAx6xx Web Sensors

 v1.0 for firmware 11-0-0-0 or higher

-----------------------------------------------------------------------------------------------------------------------

1.  History of changes

    |-----------------------|--------------------|--------------------------------------------------------------------|
    | Date                  | Version            | Description of changes                                             |
    |                       |                    |                                                                    |
    |-----------------------|--------------------|--------------------------------------------------------------------|
    | 2026-03-20            | v1.0               | Initial revision of the document                                   |
    |-----------------------|--------------------|--------------------------------------------------------------------|


2.  Structure of VALUES.JSON, VALUES-EX.JSON and parameters

2.1 Description

    Measured values can be obtained via HTTP GET requests sent to the HTTP server running on the Web Sensor. Requests 
    for the files values.json and values-ex.json can be sent to the server on port 80. This feature is independent of 
    the HTTP(s) server running on port 81 or 443 (when HTTPs is enabled), which is intended for user access. To use 
    this feature, it must be enabled in the device settings (Protocols / HTTP Server / JSON and XML). When the feature 
    is disabled, an HTTP 403 error code is returned. Access to the files values.json and values-ex.json is independent 
    of the device security subsystem. The files are accessible on port 80 without any restrictions. The file 
    values.json contains basic information about the current measured values. The file values-ex.json contains extended
    information such as minimum and maximum values, as well as descriptions of channels defined by the user. The JSON 
    files uses UTF-8 encoding.

    Responses to HTTP GET requests for the files values.json and values-ex.json on port 80 are served by an HTTP/1.0 
    server with single TCP socket capability. Response time depends on the load of the HTTP server. The average 
    response time is 10 ms. In case of communication issues or server overload, the response time may be higher.


2.2 VALUES.JSON structure

    {
      "devname": ...,
      "devsn": ...,
      "time": ...,
      "timeunix": ...,
      "synch": ...,
      "acc": ...,
      "ch": [
        {
          "name": ...,
          "unit": ...,
          "type": ...,
          "value": ...,
          "alarm1": ...,
          "alarm2": ...
        },
        ...
        ...
      ]
    }


2.3 VALUES-EX.JSON structure

    {
      "devname": ...,
      "devsn": ...,
      "time": ...,
      "timeunix": ...,
      "synch": ...,
      "acc": ...,
      "ch": [
        {
          "name": ...,
          "namelang": ...,
          "unit": ...,
          "type": ...,
          "value": ...,
          "valuelang": ...,
          "alarm1": ...,
          "alarm2": ...,
          "timevalid": ...,  // not available at binary inputs
          "min": {           // not available at binary inputs
            "val": ...,
           "time": ...
          },
          "max": {           // not available at binary inputs
            "val": ...,
            "time": ...
          }
        },
        ...
        ...
      ]
    }


2.4 Message parameters

    |-------------------|----|--------|-----------|-------------------------------------------------------------------|
    | Parameter         | Ex | Type   | Range     | Description                                                       |
    |                   | *) |        |           |                                                                   |
    |-------------------|----|--------|-----------|-------------------------------------------------------------------|
    | devname           |    | STR    | 64B len   | Device name                                                       |
    |-------------------|----|--------|-----------|-------------------------------------------------------------------|
    | devsn             |    | STR    | 8B len    | Device serial number (e.g. 25686614)                              |
    |-------------------|----|--------|-----------|-------------------------------------------------------------------|
    | time              |    | STR    | RFC3339   | Current device time                                               |
    |-------------------|----|--------|-----------|-------------------------------------------------------------------|
    | timeunix          |    | INT    | 32b unsig | Current device time as Unix timestamp (seconds since 01/01/1970)  |
    |-------------------|----|--------|-----------|-------------------------------------------------------------------|
    | synch             |    | INT    | 0, 1      | Indicates if device time is valid (1 = RTC time is valid)         |
    |-------------------|----|--------|-----------|-------------------------------------------------------------------|
    | acc               |    | INT    | 0, 1      | Acoustic active (1 = active)                                      |
    |-------------------|----|--------|-----------|-------------------------------------------------------------------|
    | ch                |    |        |           | Array with measured values at channels **)                        |
    |  |                |----|--------|-----------|-------------------------------------------------------------------|
    |  |-name           |    | STR    | 32B len   | English description of the measured value for the channel         |
    |  |                |----|--------|-----------|-------------------------------------------------------------------|
    |  |-namelang       | X  | STR    | 32B len   | Channel name set in device settings                               |
    |  |                |----|--------|-----------|-------------------------------------------------------------------|
    |  |-unit           |    | STR    | 16B len   | Unit of the channel                                               |
    |  |                |----|--------|-----------|-------------------------------------------------------------------|
    |  |-type           | X  | INT    | 32b unsig | Channel type — see Table 2.5 for details                          |
    |  |                |----|--------|-----------|-------------------------------------------------------------------|
    |  |-value          |    | STR    | 32B len   | Measured value (e.g., 12.8, n/a, ErrorX)                          |
    |  |                |----|--------|-----------|-------------------------------------------------------------------|
    |  |-valuelang      | X  | STR    | 32B len   | Measured value in selected language (e.g., 12.8, n/a, ChybaX)     |
    |  |                |----|--------|-----------|-------------------------------------------------------------------|
    |  |-alarm1         |    | INT    | 0, 1      | Alarm 1 state (1 = alarm)                                         |
    |  |                |----|--------|-----------|-------------------------------------------------------------------|
    |  |-alarm2         |    | INT    | 0, 1      | Alarm 2 state (1 = alarm)                                         |
    |  |                |----|--------|-----------|-------------------------------------------------------------------|
    |  |-timevalid      | X  | STR    | RFC3339   | Time from which the minimum and maximum values are valid ***)     |
    |  |                |----|--------|-----------|-------------------------------------------------------------------|
    |  |-min            | X  |        |           | Minimum values ***)                                               |
    |  |  |             |----|--------|-----------|-------------------------------------------------------------------|
    |  |  |-val         | X  | STR    | 32B len   | Minimum value (e.g., -2.4, n/a, ErrorX)                           |
    |  |  |             |----|--------|-----------|-------------------------------------------------------------------|
    |  |  |-time        | X  | STR    | RFC3339   | Time when the minimum value was recorded                          |
    |  |                |----|--------|-----------|-------------------------------------------------------------------|
    |  |-max            | X  |        |           | Maximum values ***)                                               |
    |  |  |             |----|--------|-----------|-------------------------------------------------------------------|
    |  |  |-val         | X  | STR    | 32B len   | Maximum value (e.g., 25.3, n/a, ErrorX)                           |
    |  |  |             |----|--------|-----------|-------------------------------------------------------------------|
    |  |  |-time        | X  | STR    | RFC3339   | Time when the maximum value was recorded                          |
    |-------------------|----|--------|-----------|-------------------------------------------------------------------|
    | Notes:                                                                                                          |
    |                                                                                                                 |
    |       *)   Field is available only in file values-ex.json                                                       |
    |       **)  There are always 8 channels.                                                                         |
    |       ***) Field is not available for binary input channels.                                                    |
    |                                                                                                                 |
    |-----------------------------------------------------------------------------------------------------------------|


2.5 Table of channel types

    |------|----------------------------------------------------------|
    | Type | Description                                              |
    |      |                                                          |
    |------|----------------------------------------------------------|
    | 0    | Unknown type of channel                                  |
    | 1    | Channel is not available                                 |
    | 2    | Temperature from internal sensor                         |
    | 3    | Temperature from internal temperature + humidity sensor  |
    | 4    | Temperature from first Pt1000 input                      |
    | 5    | Temperature from second Pt1000 input                     |
    | 6    | Internal relative humidity channel                       |
    | 7    | Computed value from internal channel                     |
    | 8    | Atmospheric pressure from internal sensor                |
    | 9    | CO2 concentration from internal sensor                   |
    | 10   | Binary input 1                                           |
    | 11   | Binary input 2                                           |
    | 12   | Binary input 3                                           |
    |------|----------------------------------------------------------|
    | 13   | Channel calculated from other channels                   |
    | 80   | First value from Digi input 1                            |
    | 81   | Second value from Digi input 1                           |
    | 82   | Third value from Digi input 1                            |
    | 96   | First value from Digi input 2                            |
    | 97   | Second value from Digi input 2                           |
    | 98   | Third value from Digi input 2                            |
    |------|----------------------------------------------------------|
    | 144  | First value from input 1 for PAx6xx                      |
    | 145  | Second value from input 1 for PAx6xx                     |
    | 160  | First value from input 2 for PAx6xx                      |
    | 161  | Second value from input 2 for PAx6xx                     |
    | 176  | First value from input 3 for PAx6xx                      |
    | 177  | Second value from input 3 for PAx6xx                     |
    | 192  | First value from input 4 for PAx6xx                      |
    | 193  | Second value from input 4 for PAx6xx                     |
    |------|----------------------------------------------------------|


3.  Example of values.json and values-ex.json

    Example JSON files are available in the "json-example" directory.


4.  Code examples

    The "code-examples" directory contains examples demonstrating how to obtain values using different programming 
    languages. The current version of the SDK includes an example in Python only.

