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

 Description of VALUES.JSON file for Wx7xx devices

 v1.0 for firmware 10-0-2-0 or higher, 2021-01-28

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

1.  History of changes

    |-----------------------|--------------------|--------------------------------------------------------------------|
    | Date                  | Version            | Description of changes                                             |
    |                       |                    |                                                                    |
    |-----------------------|--------------------|--------------------------------------------------------------------|
    | 2021-01-27            |  v1                | Initial version of specification                                   |
    |-----------------------|--------------------|--------------------------------------------------------------------|


2.  Structure of VALUES.JSON and parameters

2.1 Description

    Measured values can be obtained by HTTP GET requests sent to http server running at WiFi sensor. Requests for file
    values.json can be sent to http server running at port 80. This feature is independent on http(s) server running at
    port 81 or 443 (when security is enabled) which are intended to access by human. To be able utilize this feature, it 
    needs to be enabled in the device settings (Protocols / HTTP server / JSON and XML). This feature is disabled 
    by the default. When feature is disabled http error code 403 is returned. Access to file values.json is independent 
    to device security subsystem. In case of feature is enabled together with the device security, file values.json is
    accessible at port 80 without any restrictions.

    Responses to GET requests to file values.json at port 80 are served by the http 1.0 server with single TCP socket
    capability. Response time depends of WiFi signal strength and load of http server. Average response time at high 
    performance mode is 25 ms. In case of communication issues or server overloading it can be response time up to 10 sec.


2.2 JSON structure

    {
      <devname>,
      <devsn>,
      <time>,
      <timeunix>,
      <synch>,
      <rssi>,
      <acc>,
      <ch> [
        {
          <name>,
          <unit>,
          <value>,
          <alarm1>,
          <alarm2>
        },
        ...
        ...
        {
          <name>,
          <unit>,
          <value>,
          <alarm1>,
          <alarm2>
        }
      ]
    }


2.3 Message parameters

    |-----------------------|--------|-----------|--------------------------------------------------------------------|
    | Parameter             | Type   | Range     | Description                                                        |
    |                       |        |           |                                                                    |
    |-----------------------|--------|-----------|--------------------------------------------------------------------|
    | <devname>             | STR    | 64B len   | Device name at UTF-8                                               |
    |-----------------------|--------|-----------|--------------------------------------------------------------------|
    | <devsn>               | STR    | 8B len    | Serial number of the device (e.g. 20286614)                        |
    |-----------------------|--------|-----------|--------------------------------------------------------------------|
    | <time>                | STR    | RFC3339   | Current device time according https://tools.ietf.org/html/rfc3339  |
    |-----------------------|--------|-----------|--------------------------------------------------------------------|
    | <timeunix>            | INT    | 32b unsig | Current device time as Unix timestamp (seconds since 01/01/1970)   |
    |-----------------------|--------|-----------|--------------------------------------------------------------------|
    | <synch>               | INT    | 0, 1      | Indication if device time is valid (1 = RTC time is valid)         |
    |-----------------------|--------|-----------|--------------------------------------------------------------------|
    | <rssi>                | INT    | -30 ~ -99 | Received signal strength indication at [dBm]                       |
    |-----------------------|--------|-----------|--------------------------------------------------------------------|
    | <acc>                 | INT    | 0, 1      | Acoustic active (=1)                                               |
    |-----------------------|--------|-----------|--------------------------------------------------------------------|
    | <ch>                  |        |           | Array with measured values at channels                             |
    |  |                    |--------|-----------|--------------------------------------------------------------------|
    |  |-<name>             | STR    | 32B len   | Name of the channel at UTF-8                                       |
    |  |                    |--------|-----------|--------------------------------------------------------------------|
    |  |-<unit>             | STR    | 16B len   | Unit of the channel at UTF-8                                       |
    |  |                    |--------|-----------|--------------------------------------------------------------------|
    |  |-<value>            | STR    | 32B len   | Measured value (e.g. 12.8, n/a, ErrorX)                            |
    |  |                    |--------|-----------|--------------------------------------------------------------------|
    |  |-<alarm1>           | INT    | 0, 1      | Alarm 1 state (1 = alarm)                                          |
    |  |                    |--------|-----------|--------------------------------------------------------------------|
    |  |-<alarm2>           | INT    | 0, 1      | Alarm 2 state (1 = alarm)                                          |
    |-----------------------|--------|-----------|--------------------------------------------------------------------|


3.  Example of values.json

    Example of JSON file is at directory "json-example".


4.  Code examples

    Directory "code-examples" contains examples how to obtain values via different programming languages. Current
    version of SDK contains example at Python language only.

