Wattsense API (latest)

Download OpenAPI specification:

Wattsense API

The Wattsense API provides a two way communication channel with devices managed by the platform.

Base URL

All the paths in this documentation are relative to the base path https://api.wattsense.com/. We only support HTTPS, all HTTP requests are redirected with a 301.

Rate Limit

A global rate limit is currently defined on the Wattsense API. The rate limit is IP based (in the future it will be device based). The current limits are:

  • 2500 requests every 5 min for all requests
  • 100 requests every 5 min for requests targeting the configuration APIs

Authentication

Our endpoints are all protected using an HMAC (Hash-Based Message Authentication Codes) mechanism.

Note: OAuth 2.0 Client Credentials grant flow is planned for a later version.

Using our management console, you can create an API Key with an access to your Organization. An API Key is associated to a service account and will inherit the right provided by that service account.

Each API Key comes with an API Secret used to sign the messages you send.

To authenticate, you must add to your request the header X-API-Auth containing the API Key and a message signature:

X-API-Auth: <your-api-key>:<request-hmac-512-authentication-code>

The authentication code of the request is computed by applying a HMAC_SHA512 on the request you’re about to send to the server. The message to authenticate has to respect the following specification (in pseudo code):

messageToSign = HttpMethod + '\n'
                  RelativePath + '\n'
                  CanonicalQuery + '\n'
                  Body + '\n'
                  Timestamp

where:

  • HttpMethod: Can be either GET, POST or PUT, mandatory in all requests
  • RelativePath: is a canonical url stripped of the base path, i.e. if you request https://api.wattsense.com/v1/devices that would be /v1/devices, mandatory in all requests
  • CanonicalQuery: the encoded query, to be provided only if there is a query, for example:
    property=temperature&since=1286705410000
    
  • Body: the exact json body to be sent, to be provided only if there is a body to send
  • Timestamp: in milliseconds. If provided, the request will only be valid for 60 seconds after this timestamp. It also has to be provided in the header in X-API-Timestamp.

This message is then authenticated using HMAC_SHA512 and its result base64 encoded. The final result is what we previously called request-hmac-512-authentication-code, or in short a "signature". For example, in Python, that would be:

hmac_digest = hmac.new(api_secret, message.encode(), hashlib.sha512).digest()
signature = base64.b64encode(hmac_digest).decode()

For simplicity, we provide the following example that does everything we described above:

#!/usr/bin/python3
import requests
import base64
import hashlib
import hmac
import time
from urllib import parse

url = 'https://api.wattsense.com'
api_key = '132BA4C2309A9E069BDF129138680F89'
api_secret = 'ZTgwZTliMWJhZmQ4NmFhMmM2M2U5MjdkMTI1MzliYzFmMTYyMWZkMzcyOTIxMzRkNzA0MTQ5ZWRmY2JiMDc3Yg=='

class WattsenseAuth(requests.auth.AuthBase):

    def __init__(self, api_key, api_secret):
        self.api_key = api_key
        self.api_secret = api_secret

    def __call__(self, r):
        timestamp = int(time.time() * 1000)
        url = parse.urlparse(r.url)
        message = '\n'.join([str(e) for e in [r.method, url.path,
                            (url.query if url.query else None),
                            (r.body.decode('utf-8') if r.body else None),
                            timestamp] if e != None])

        hmac_hash = base64.b64encode(hmac.new(self.api_secret.encode(), message.encode(),
                                     hashlib.sha512).digest()).decode()

        r.headers['X-API-Auth'] = '{}:{}'.format(self.api_key, hmac_hash)
        r.headers['X-API-Timestamp'] = str(timestamp)

        return r

if __name__ == '__main__':
    print('Getting devices')
    req = requests.get(f'{url}/v1/devices', auth=WattsenseAuth(api_key=api_key, api_secret=api_secret))
    print(req) // verify status
    print(req.json())

    device_id = req.json()[0]['deviceId']

    print('Setting a property on a device')
    req = requests.put(f'{url}/v1/devices/{device_id}/properties/prop_1', auth=WattsenseAuth(api_key=api_key, api_secret=api_secret), payload={'payload': '33'})
    print(req) // verify status
    print(req.json())

Organization

Get organization

Get an organization

path Parameters
organizationId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
  • "name": "string",
  • "contacts": {
    },
  • "type": "TENANT",
  • "parentId": "70850378-7d3c-4f45-91b7-942d4dfbbd43",
  • "tenantId": "f97df110-f4de-492e-8849-4a6af68026b0",
  • "status": "NEW",
  • "preventRightsPropagation": true
}

Get users of an organization

path Parameters
organizationId
required
string <uuid>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List organizations

query Parameters
nameFilter
string
includeDisabled
boolean
parentId
string <uuid>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update an organization

path Parameters
organizationId
required
string <uuid>
Request Body schema: application/json
required
name
string

Organization name

object (OrganizationContactsDTO)

Organization contacts

preventRightsPropagation
boolean

Prevent rights propagation

parentOrganizationId
string <uuid>

Parent organization ID

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "contacts": {
    },
  • "preventRightsPropagation": true,
  • "parentOrganizationId": "63f6c742-ce8a-40d9-97e1-7492d05907db"
}

Response samples

Content type
application/json
{
  • "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
  • "name": "string",
  • "contacts": {
    },
  • "type": "TENANT",
  • "parentId": "70850378-7d3c-4f45-91b7-942d4dfbbd43",
  • "tenantId": "f97df110-f4de-492e-8849-4a6af68026b0",
  • "status": "NEW",
  • "preventRightsPropagation": true
}

User management

Create user API Key

Create a user API key

path Parameters
username
required
string

The username of the user

Request Body schema: application/json
required
description
string

A description of the API key

expireInHours
integer <int64> [ 1 .. 17520 ]

The number of hours until the API key expires

Responses

Request samples

Content type
application/json
{
  • "description": "string",
  • "expireInHours": 1
}

Response samples

Content type
application/json
{
  • "key": "string",
  • "secret": "string",
  • "belongsTo": "string",
  • "description": "string",
  • "expiryDate": "2019-08-24T14:15:22Z"
}

Delete user API key

Delete an API key belonging to a user

path Parameters
username
required
string

The username of the user

key
required
string

The API Key ID

Responses

Response samples

Content type
application/json
{
  • "deleted": true,
  • "apiKey": {
    }
}

Get the user himself

Return the information of the user making the request

query Parameters
organizationId
string <uuid>

The organization for which to list the users, if not set, will list the users of the calling user's organization

Responses

Response samples

Content type
application/json
{
  • "username": "string",
  • "fullName": "string",
  • "phoneNumber": "string",
  • "language": "fr",
  • "privileges": {
    }
}

Get user API key

Get a user API key

path Parameters
username
required
string

The username of the user

key
required
string

The API Key ID

Responses

Response samples

Content type
application/json
{
  • "key": "string",
  • "secret": "string",
  • "belongsTo": "string",
  • "description": "string",
  • "expiryDate": "2019-08-24T14:15:22Z"
}

List the users of an organization

List all the users of an organization.

  • If the organization is not provided, or is the same as the one of the user, this will list all the users of the said organization.
  • If the organization is different from the one of the user making the request, the user needs to have an organization role with the action GetUser on that specific organization.

The content of roles will vary depending on the rights of the user making the call. Only the Organizations the user has access to will be listed.

query Parameters
organizationId
required
string <uuid>

The organization for which to list the users, if not set, will list the users of the calling user's organization

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List user API keys

List the API keys belonging to a user

path Parameters
username
required
string

The username of the user

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Service accounts

Create a service accounts

Create a service account

Request Body schema: application/json
required
prefix
required
string^[a-z0-9_]+(?:-[a-z0-9_]+)*$

A prefix used in the beginning of the username of the service account. This prefix has to be unique. The resulting service account username is in the form prefix@organizationId.svc.acct.wattsense.com

description
string

A description of this service account

organizationId
required
string <uuid>

The ID of the organization in which to create the service account

Responses

Request samples

Content type
application/json
{
  • "prefix": "string",
  • "description": "string",
  • "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9"
}

Response samples

Content type
application/json
{
  • "username": "string",
  • "description": "string",
  • "enableBasicAuth": true,
  • "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
  • "privileges": {
    }
}

Create service account API key

Create a service account API key

path Parameters
username
required
string

The username of the service account

Request Body schema: application/json
required
description
string

A description of the API key

expireInHours
integer <int64> [ 1 .. 17520 ]

The number of hours until the API key expires

Responses

Request samples

Content type
application/json
{
  • "description": "string",
  • "expireInHours": 1
}

Response samples

Content type
application/json
{
  • "key": "string",
  • "secret": "string",
  • "belongsTo": "string",
  • "description": "string",
  • "expiryDate": "2019-08-24T14:15:22Z"
}

Delete service account

Delete a service account

path Parameters
username
required
string

The username of the service account

Responses

Response samples

Content type
application/json
{
  • "username": "string",
  • "description": "string",
  • "enableBasicAuth": true,
  • "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
  • "privileges": {
    }
}

Delete service account API key

Delete an API key belonging to a service account

path Parameters
username
required
string

The username of the service account

key
required
string

The API Key ID

Responses

Response samples

Content type
application/json
{
  • "deleted": true,
  • "apiKey": {
    }
}

Get a service account

Get a specific service account

path Parameters
username
required
string

The username of the service account to get

Responses

Response samples

Content type
application/json
{
  • "username": "string",
  • "description": "string",
  • "enableBasicAuth": true,
  • "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
  • "privileges": {
    }
}

Get service account API key

path Parameters
username
required
string

The username of the service account

key
required
string

The API Key ID

Responses

Response samples

Content type
application/json
{
  • "key": "string",
  • "secret": "string",
  • "belongsTo": "string",
  • "description": "string",
  • "expiryDate": "2019-08-24T14:15:22Z"
}

List service account API keys

List the API keys belonging to a service account

path Parameters
username
required
string

The username of the service account

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List the service accounts

List all the service accounts of an account

query Parameters
organizationId
required
string <uuid>

The organization for which to list the service accounts, if not set, will list the service accounts of the calling user's account

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Device information

Get a device

Get a device information

path Parameters
deviceId
required
string

The ID of the device

Responses

Response samples

Content type
application/json
{
  • "deviceId": "string",
  • "hardwareId": "string",
  • "lifecycle": "FACTORY",
  • "name": "string",
  • "description": "string",
  • "tenantId": "f97df110-f4de-492e-8849-4a6af68026b0",
  • "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
  • "deviceGroupId": "47103c21-a78d-4990-a233-7f9ad2536254",
  • "siteId": "string",
  • "externalId": "string",
  • "deviceVersionInfo": {
    },
  • "subscription": {
    },
  • "openAlarms": [
    ],
  • "activeTasks": [
    ],
  • "tags": {
    },
  • "type": "TOWER",
  • "activationDate": "2019-08-24T14:15:22Z",
  • "connectivityStatus": {
    },
  • "features": [
    ],
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

Get connectivity status

Get the connectivity status of a device

path Parameters
deviceId
required
string

The ID of the device

Responses

Response samples

Content type
application/json
{
  • "deviceId": "string",
  • "connectionStatusInfo": {
    },
  • "requestedDataUplink": {
    },
  • "currentDataUplink": {
    },
  • "modem": {
    },
  • "wwan0": {
    },
  • "eth0": {
    },
  • "eth1": {
    }
}

List your devices

This endpoint allows you to list all the devices belonging to an organization.

query Parameters
organizationId
string <uuid>

The organization in which to search for devices, if not provided, list all devices the user / apiKey has access to.

includeChildOrganizations
boolean

Include sub organizations and hence their devices

deviceGroupId
string <uuid>

Filter devices by device group

hardwareId
string

Search for a device by its hardwareId. If this is provided, it will ignore all other filters

tag
string

Filter the results by a Tag key and/or a tag value. The filter has to be in the format tagName[:tagValue]. For example, to filter only by the existence of a tag (useful for markers), one can use ?tag=boiler to filter an equipment with the marker "boiler". To filter by a specific value of a tag use ?tag=season:summer.

Multiple filters can be used, by repeating the query as in ?tag=rooftop&tag=ahu&tag=backup:b:true. In the latter tag filter backup:b:true, the key is backup and value b:true (an example of a haystack-style boolean tagging).

deviceType
string (DeviceType)
Enum: "TOWER" "BRIDGE" "BOX" "HUB" "CLASSICAL_HUB"

List only devices that are of that type, if not provided list devices of all types. Possible values:

  • TOWER, to list your Towers
  • BRIDGE, to list your Bridges
  • BOX (deprecated), to list your Towers
  • HUB (deprecated), to list your Bridges

BOX and HUB will be removed in a future release.

lifecycles
Array of strings (DeviceLifecycle)
Items Enum: "FACTORY" "READY" "SHIPPED" "ACTIVATED" "SUSPENDED" "UNDER_MAINTENANCE" "RETIRED" "DEVELOPMENT" "HUB"

Filter by device lifecycle

includeOpenAlarms
boolean

Include the last 5 currently opened alarms for each device

includeActiveTasks
boolean

Include the active tasks for each device

includeRetired
boolean

Include retired devices

page
integer >= 1
Default: 1

One-based page index (1..N)

size
integer >= 1
Default: 20

The size of the page to be returned

sort
Array of strings
Default: "_id,ASC"

Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update a device

Update a device information

path Parameters
deviceId
required
string

The ID of the device

Request Body schema: application/json
required
name
string

A short name for this box

description
string

A long description for this box

organizationId
string <uuid>

The organization this device belongs to

deviceGroupId
string <uuid>

The device group this device belongs to (optional)

object

Tags associated with this device

siteId
string

The site belongs to (optional)

externalId
string

A user provided id, useful for identifying devices using an id not provided by Wattsense

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
  • "deviceGroupId": "47103c21-a78d-4990-a233-7f9ad2536254",
  • "tags": {
    },
  • "siteId": "string",
  • "externalId": "string"
}

Response samples

Content type
application/json
{
  • "deviceId": "string",
  • "hardwareId": "string",
  • "lifecycle": "FACTORY",
  • "name": "string",
  • "description": "string",
  • "tenantId": "f97df110-f4de-492e-8849-4a6af68026b0",
  • "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
  • "deviceGroupId": "47103c21-a78d-4990-a233-7f9ad2536254",
  • "siteId": "string",
  • "externalId": "string",
  • "deviceVersionInfo": {
    },
  • "subscription": {
    },
  • "openAlarms": [
    ],
  • "activeTasks": [
    ],
  • "tags": {
    },
  • "type": "TOWER",
  • "activationDate": "2019-08-24T14:15:22Z",
  • "connectivityStatus": {
    },
  • "features": [
    ],
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

Properties measurements

Get the latest value of a property

path Parameters
deviceId
required
string

The ID of the device

property
required
string

The ID or the slug of the property to query

query Parameters
includeHistory
boolean

Responses

Response samples

Content type
application/json
{
  • "deviceId": "string",
  • "property": "string",
  • "slug": "string",
  • "name": "string",
  • "timestamp": 0,
  • "payload": 23.3,
  • "scaledPayload": 2.33,
  • "writeTimestamp": 0,
  • "writePayload": 33,
  • "writeScaledPayload": 2.33,
  • "writeOutOfService": true,
  • "unit": "null",
  • "equipmentId": "string",
  • "gatewayInterfaceId": "string",
  • "tags": {
    },
  • "externalId": "string",
  • "isOutOfService": true,
  • "history": {
    }
}

List device properties values Deprecated

DEPRECATED: This endpoint is deprecated in favor of the Search device properties values endpoint because it doesn't limit the number of properties in the filter.

This endpoint allows you to search for measurements sent by a device. If no parameter is passed, it returns all the values for all the properties of the device during the last 24 hours.

This endpoint returns paginated results. The pagination uses Link header for defining next, prev, first and last links. It is presented as a list of links separated by a comma, as defined in RCF5988, following the pattern: </v1/devices/deviceId/properties?page=2>; rel="next". For performance reasons, there is no last item provided. You can use the absence of next or a status 204 (NO CONTENT) as a stop.

Parsing the header could be done either manually or using a library such as Python's requests:

import requests

result = requests.get("https://api.wattsense.com/v1/devices/my-device/properties", ...)

if result.links.get('next'):
    # get next page
    result = requests.get(result.links['next']['url'], ...)

The pagination is one-based, i.e. the first page is 1. After the last page we return an empty list with a status code 204 (NO_CONTENT). This could be used as an off-by-one stop as the absence of the next url in the header is enough to indicate that there would be no more content after this.

For simplicity, we provide the following example to query data on a custom time range:

import requests
import base64
import time
import datetime
from urllib.parse import urlparse
requests.packages.urllib3.disable_warnings()

# import the WattsenseAuth class defined earlier
from sign_request import WattsenseAuth

url = 'https://api.wattsense.com'
api_key = '132BA4C2309A9E069BDF129138680F89'
api_secret = 'ZTgwZTliMWJhZmQ4NmFhMmM2M2U5MjdkMTI1MzliYzFmMTYyMWZkMzcyOTIxMzRkNzA0MTQ5ZWRmY2JiMDc3Yg=='
sub_id = '7b7690a2-9d09-4518-909d-83c24f7874eb'

def get_data(device_id, since, until, property_name=None, size_per_request=500):
    params = {'since': int(time.mktime(datetime.datetime.strptime(since, "%Y-%m-%d %H:%M").timetuple()) * 1000),
              'until': int(time.mktime(datetime.datetime.strptime(until, "%Y-%m-%d %H:%M").timetuple()) * 1000),
              'size': size_per_request }

    if property_name:
        params['property'] = property_name

    elements = []

    res = requests.get(f'{url}/v1/devices/{device_id}/properties', params=params, auth=WattsenseAuth(api_key=api_key, api_secret=api_secret))
    while res.status_code == 200:
        elements = elements + res.json()
        if res.links.get('next'):
            next_url_query = urlparse(res.links['next']['url']).query
            # parse next url query parameters
            params = dict(x.split('=') for x in next_url_query.split('&'))

            res = requests.get(f'{url}/v1/devices/{device_id}/properties', params=params, auth=WattsenseAuth(api_key=api_key, api_secret=api_secret)))
        else:
            break
    return elements


# you can then call it using:
result = get_data("dev-one", "2018-07-12 00:00", "2018-07-13 23:59", size_per_request=10)

# if you have python-tabulate
from tabulate import tabulate
print(tabulate([[e['property'],
                 datetime.datetime.fromtimestamp(e['timestamp'] / 1000),
                 e['payload']] for e in result], headers=['property', 'date', 'value']))

which (if you have the library tabulate) will yield a result similar to this:

property    date                          value
----------  --------------------------  -------
temp2       2018-07-12 13:26:12.679000  20.8968
temp2       2018-07-12 13:26:12.578000  20.5863
temp2       2018-07-12 13:26:12.478000  20.7995
temp2       2018-07-12 13:26:12.376000  20.239
temp2       2018-07-12 13:26:12.277000  20.5092
temp2       2018-07-12 13:26:12.175000  20.7335
temp2       2018-07-12 13:26:12.073000  19.0188
temp2       2018-07-12 13:26:11.974000  20.8744
temp2       2018-07-12 13:26:11.871000  20.1135
temp1       2018-07-12 13:26:11.792000  59.3164
temp2       2018-07-12 13:26:11.771000  20.8935
temp1       2018-07-12 13:26:11.690000  59.8559
temp2       2018-07-12 13:26:11.669000  19.5403
temp1       2018-07-12 13:26:11.590000  60.7562
temp2       2018-07-12 13:26:11.570000  19.1456
temp1       2018-07-12 13:26:11.488000  60.3213
temp2       2018-07-12 13:26:11.467000  20.3842
temp1       2018-07-12 13:26:11.389000  60.4053
path Parameters
deviceId
required
string

The ID of the device

query Parameters
property
Array of strings [ 0 .. 64 ] items

Filter the measurements by one or many properties

equipmentId
string

Filter by equipment ID

since
integer <int64>

Since timestamp

until
integer <int64>

Until timestamp

page
integer >= 1
Default: 1

One-based page index (1..N)

size
integer >= 1
Default: 20

The size of the page to be returned

sort
Array of strings
Default: "timestamp,DESC"

Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.

distinct
boolean

Remove duplicates from the result of the current page (does not alter the pagination)

tag
string

Filter the results by a Tag key and/or a tag value. The filter has to be in the format tagName[:tagValue]. For example, to filter only by the existence of a tag (useful for markers), one can use ?tag=boiler to filter an equipment with the marker "boiler". To filter by a specific value of a tag use ?tag=season:summer.

Multiple filters can be used, by repeating the query as in ?tag=rooftop&tag=ahu&tag=backup:b:true. In the latter tag filter backup:b:true, the key is backup and value b:true (an example of a haystack-style boolean tagging).

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List values of all the properties of a device

path Parameters
deviceId
required
string

The ID of the device

query Parameters
historySize
integer <int32> [ 1 .. 10 ]

The number of values to return for each property

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Search device properties values

path Parameters
deviceId
required
string

The ID of the device

query Parameters
page
integer >= 1
Default: 1

One-based page index (1..N)

size
integer >= 1
Default: 20

The size of the page to be returned

sort
Array of strings
Default: "timestamp,DESC"

Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.

Request Body schema: application/json
required
properties
Array of strings

Filter the measurements by one or many properties

equipmentId
string

Filter by equipment ID

since
integer <int64>

Since timestamp

until
integer <int64>

Until timestamp

distinct
required
boolean

Remove duplicates from the result of the current page (does not alter the pagination)

tag
Array of strings

Filter the results by a Tag key and/or a tag value. The filter has to be in the format tagName[:tagValue]. For example, to filter only by the existence of a tag (useful for markers), one can use ?tag=boiler to filter an equipment with the marker "boiler". To filter by a specific value of a tag use ?tag=season:summer.

Multiple filters can be used, by repeating the query as in ?tag=rooftop&tag=ahu&tag=backup:b:true. In the latter tag filter backup:b:true, the key is backup and value b:true (an example of a haystack-style boolean tagging).

Responses

Request samples

Content type
application/json
{
  • "properties": [
    ],
  • "equipmentId": "string",
  • "since": 0,
  • "until": 0,
  • "distinct": true,
  • "tag": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

Set a property value on a device

This endpoint allows you to set the value of a specific property on the device.

The request must contain a payload that can be either string or a number. This operation returns a commandId that can be used to check the status of the operation using Get a specific command sent to a device. With the integration of lorawan, the set property can be used to send a downlink message to a Lorawan sensor. For this a payload that contains the encoded downlink payload and a port separated by a colon : can be set on a property with LoRaWAN codecPropertyId of @sys-rawPayload-downlink.

path Parameters
deviceId
required
string

The ID of the device

property
required
string

The name of the property

Request Body schema: application/json
PropertyNumberValue (number) or PropertyStringValue (string) or Array of PropertyArrayValue (integers) or PropertyJsonValue (object) or Date (string) or DateTime (string) or (PropertyDailyScheduleValue (Array of LpbDailySchedule (objects) or Array of SyncoDailySchedule (objects) or Array of BacnetDailySchedule (objects))) or PropertyFreeFormDateTimeValue (object) or PropertyDateTimeRangeValue (object) or PropertySyncoExceptionPeriodValue (object) or (Array of WeeklySchedule (Array of LpbDailySchedule (objects) or Array of SyncoDailySchedule (objects) or Array of BacnetDailySchedule (objects))) or PropertyBacnetScheduleValue (object)

The value to set on the device. This has to be a valid JSON type, example of supported values:

  • 123
  • 27.7
  • [123, 255]
  • "a string value"
  • {"key": "value"} The type depends on the communication protocol and the data format.

If a kind was provided in the configuration of the property, one can use the following formats:

  • date: A date value date-fullyear "-" date-month "-" date-mday where

    ```
    date-fullyear   = 4DIGIT  ; 1970(min), 2020, 2022, 2500 (max)
    date-month      = 2DIGIT  ; 01-12
    date-mday       = 2DIGIT  ; 01-28, 01-29, 01-30, 01-31
    ```
    

    Examples: "2022-01-31", "2022-05-01"

  • date-time: A date time value date "T" time, where

    ```
    time-hour       = 2DIGIT  ; 00-23
    time-minute     = 2DIGIT  ; 00-59
    time-second     = 2DIGIT  ; 00-58, 00-59
    
    date-time       = date "T" time-hour ":" time-minute ":" time-second
    ```
    

    Examples: "2022-05-01T02:00:59", "2020-12-31T23:59:59"

  • free-form-date-time: Used to send a date time value where some fields are optional. The current use cases are:

    • RVL's Vacation Start and End dates; One has to specify all fields except the year.
    • Synco exception period ranges
  • date-time-range: Used to send a range start -> end; where start and end are two free-form-date-time

    Example:

    {
      "start": {"month": 1, "day": 10, "hour": 0, "minute": 0, "second": 0},
      "end": {"month": 1, "day": 31, "hour": 24, "minute": 0, "second": 0},
    }
    
  • synco-exception-period: Used to set an exception period for a Synco device, takes a range and an exception type (DISABLED, DAY or PERIOD). When using DAY the 8th day of the daily schedule is used to define the behavior, when using PERIOD the equipment will use the mode defined for vacation periods. DISABLED will disable this exception.

    WARNING: Synco devices automatically sort exceptions, hence writing an exception period at slot 1 and 2, then disabling the slot 1, will result in the value of 2 being read on slot 1; this may also happen if the periods are not in chronological order.

    Example:

    {
      "exceptionType": "DAY",
      "range": {
        "start": {"month": 1, "day": 10, "hour": 0, "minute": 0, "second": 0},
        "end": {"month": 1, "day": 31, "hour": 24, "minute": 0, "second": 0},
      }
    }
    
  • daily-schedule (RVL and Synco): Used to to configure a schedule for a single day, represented by an array of daily schedule actions. Each action has a time and a value to set

    Examples:

    • RVL:

      [
        {"time": "01:00", "value": "ON"},
        {"time": "06:00", "value": "OFF"},
        {"time": "13:00", "value": "ON"},
        {"time": "17:00", "value": "OFF"},
        {"time": "22:00", "value": "ON"},
        {"time": "24:00", "value": "OFF"}
      ]
      
    • Synco:

      [
        {"time": "01:00", "value": 1},
        {"time": "06:00", "value": 2},
        {"time": "13:00", "value": 3},
        {"time": "17:00", "value": 2},
        {"time": "22:00", "value": 1},
        {"time": "24:00", "value": 0}
      ]
      
  • weekly-schedule: Used to configure a schedule for a whole week, represented by an array of 7 daily schedules.

    Example:

     [
       [
         {"time": "10:00", "value": 16},
         {"time": "18:00", "value": 19}
       ],
       [],
       [],
       [
         {"time": "07:00", "value": 17},
         {"time": "20:00", "value": 20}
       ],
       [],
       [],
       []
     ]
    
  • bacnet-schedule: Used to to configure a BACnet schedule for a whole week, represented by an array of 7 daily schedules. It can have an exception schedule which is an array up to 256 entries basically composed by a tuple of periods, BACnetTimeValue and EventPriority denominated by BACnet as BACnetSpecialEvent Example:

     {
       "weekly": [
         [
           {"time": "10:00", "value": 16},
           {"time": "18:00", "value": 19}
         ],
         [],
         [],
         [
           {"time": "07:00", "value": 17},
           {"time": "20:00", "value": 20}
         ],
         [],
         [],
         []
       ],
       "exceptionSchedule": [
         {
           "calendar": {
             "periodType": "calendarEntry",
             "calendarEntry": {
               "weekNDay": {"month": 1, "weekOfMonth": 4, "dayOfWeek": 6}
             }
           },
           "timeValue": [
             {"time": "07:00", "value": 17},
             {"time": "20:00", "value": 20}
           ],
           "eventPriority": 4
         }
       ],
       "effectivePeriod": {
         "start": {"month": 1, "day": 10, "hour": 0, "minute": 0, "second": 0},
         "end": {"month": 1, "day": 31, "hour": 24, "minute": 0, "second": 0}
       },
       "priority": 1,
       "dataType": 64,
       "defaultValue": 18,
       "targetProperties": [
         {
           "deviceInstance": 12,
           "objectInstance": 24,
           "objectType": 1000,
           "propertyId": 12101,
           "arrayIndex": 20
         }
       ]
     }
    
nullify
boolean

Explicitly ask the device to nullify the value. The payload has to be set to null for this to have effect

setOutOfService
boolean

Set the Out Of Service status on the equipment's property. This is protocol specific, only supported on RVLs for the moment

isScaled
boolean

Specifies that the payload value is scaled. Value will be unscaled before sending it to the equipment

Responses

Request samples

Content type
application/json
{
  • "payload": 0,
  • "nullify": true,
  • "setOutOfService": true,
  • "isScaled": true
}

Response samples

Content type
application/json
{
  • "commandId": "string",
  • "status": "NEW"
}

Archives management

Wattsense stores data in two different locations, in a database that we qualify as "hot", i.e. data is immediately accessible via the API, and is archived in a "cold" storage location. Data's lifecycle is as follow:

  • When data is received it's available using the Get device properties values API
  • The next day, the data can be recovered using the Request an archive API
  • 30 days after having received the data, it is no longer accessible via the immediate access API, but is still available via the archive retrieval one
  • At the end of your device subscription, you are offered a delay of 6 months to download your archives, before they are permanently removed

Delayed Access Via Archive Retrieval API
Delayed Access Via Archive Retrieval API
Immediate Access Via API
Immediate Access Via API
Archive Retrieval On Request
Archive Retrieval On Request
Now
Now
30 Days After
30 Days After
1 Day After
1 Day After
Subscription End
Subscription End
6 Months after Subscription End
6 Months after Subscription End
Viewer does not support full SVG 1.1

The data in the archives is exported in bulk and stored in a zip archive. This archive contains a folder named as the requested device id, with one or many files:

  • If data is exported grouped by day, it will be one file by day in the format yyyy_mm_dd.json (for json)
    deviceId
    ├── 2020_08_29.json
    ├── 2020_08_30.json
    ├── 2020_08_31.json
    └── 2020_09_01.json
    
  • If data is exported grouped by month, it will be one file by month in the format yyyy_mm.json (for json).
    deviceId
    ├── 2020_08.json
    └── 2020_09.json
    
    Each file will contain the dates requested. Therfore, if you request data from 29th of August to September 1st, you will obtain two files, in the August file there will be data for the 29th, 30th, 31st and in the September file there will be the data for the 1st.

The extension of the file depends on the export format, json, csv, or xlsx.

Each json contains one row per data value, using the same format as defined in the Get device properties values API endpoint's result:

{"deviceId":"deviceId","property":"AiRP4nLREwpzmzfR","timestamp":1598572800073,"payload":1.0,"name":"prop one"}
{"deviceId":"deviceId","property":"HcwFaXJpcpX84vP1","timestamp":1598572800084,"payload":true,"name":"another prop"}
{"deviceId":"deviceId","property":"7L9dRX8KrDPk3oTJ","timestamp":1598572800175,"payload":9.0,"name":"yet another prop"}
{"deviceId":"deviceId","property":"83kwdnK2UjMA8FmB","timestamp":1598572800187,"payload":0,"name":"a name","description":"a description"}

The same keys will be used for CSV and for Excel exports.

Some important remarks:

  • The stored data uses the property's metadata at the time it was received by the platform.
  • The stored metadata does not change after it has been stored, i.e. we do not alter the name, description, tags, or the scaling, after it has been stored. Therefore, you get a truly historical view onto your data. If you want to apply the current scaling on your data, you'll have to apply it manually when processing it.
  • The archived data has been first processed in September 2020, therefore, all the historic data will use the metadata (if found), from that date.
  • Any future change in our API or the format of our data, will not affect the archived data. Hence, it might require a manual migration on your side. We will keep track of the evolution in the documentation.

Delete recurring archive request

Delete a recurring archive request

path Parameters
deviceId
required
string

The ID of the device

requestId
required
string

The ID of the request

Responses

Get operation

Get an operation

path Parameters
operationId
required
string

The ID of the operation

Responses

Response samples

Content type
application/json
{
  • "operationId": "string",
  • "requestDetails": {
    },
  • "status": "NEW",
  • "startedAt": "2019-08-24T14:15:22Z",
  • "finishedAt": "2019-08-24T14:15:22Z",
  • "requestedBy": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

List archive requests

List archive requests for a device

path Parameters
deviceId
required
string

The ID of the device

query Parameters
type
string (DeviceArchiveRequestType)
Enum: "ONE_TIME" "RECURRING"

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List operations

List all operations for a specific device

query Parameters
deviceId
required
string

The ID of the device

status
string (OperationStatus)
Enum: "NEW" "STARTED" "ENDED" "FAILED"

The status of the operation

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Request an archive

Request an archive for a device

path Parameters
deviceId
required
string

The ID of the device

Request Body schema: application/json
required
type
string
deviceId
required
string
format
string
Enum: "JSON" "CSV" "XLSX"
object
propertyIds
Array of strings
sendTo
string
Deprecated

only for backward compatibility

recipients
required
Array of strings
dateTimeZone
string
fromDate
required
string <date>
untilDate
required
string <date>
id
required
string
createdAt
string <date-time>
updatedAt
string <date-time>

Responses

Request samples

Content type
application/json
Example
{
  • "type": "ONE_TIME",
  • "deviceId": "string",
  • "format": "JSON",
  • "transformation": {
    },
  • "propertyIds": [
    ],
  • "sendTo": "string",
  • "recipients": [
    ],
  • "dateTimeZone": "Europe/Paris",
  • "fromDate": "2019-08-24",
  • "untilDate": "2019-08-24",
  • "id": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
Example
{
  • "type": "ONE_TIME",
  • "deviceId": "string",
  • "format": "JSON",
  • "transformation": {
    },
  • "propertyIds": [
    ],
  • "sendTo": "string",
  • "recipients": [
    ],
  • "dateTimeZone": "Europe/Paris",
  • "fromDate": "2019-08-24",
  • "untilDate": "2019-08-24",
  • "id": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Request an archive Deprecated

Request an archive for a device.

Note: This endpoint is deprecated and will be removed in a future release. Use this endpoint instead.

Request Body schema: application/json
required
type
string
deviceId
required
string
format
string
Enum: "JSON" "CSV" "XLSX"
object
propertyIds
Array of strings
sendTo
string
Deprecated

only for backward compatibility

recipients
required
Array of strings
dateTimeZone
string
fromDate
required
string <date>
untilDate
required
string <date>
id
required
string
createdAt
string <date-time>
updatedAt
string <date-time>

Responses

Request samples

Content type
application/json
Example
{
  • "type": "ONE_TIME",
  • "deviceId": "string",
  • "format": "JSON",
  • "transformation": {
    },
  • "propertyIds": [
    ],
  • "sendTo": "string",
  • "recipients": [
    ],
  • "dateTimeZone": "Europe/Paris",
  • "fromDate": "2019-08-24",
  • "untilDate": "2019-08-24",
  • "id": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "operationId": "string",
  • "requestDetails": {
    },
  • "status": "NEW",
  • "startedAt": "2019-08-24T14:15:22Z",
  • "finishedAt": "2019-08-24T14:15:22Z",
  • "requestedBy": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

Update recurring archive request

Update a recurring archive request

path Parameters
deviceId
required
string

The ID of the device

requestId
required
string

The ID of the request

Request Body schema: application/json
required
name
string
recipients
Array of strings (Email)
endAt
string
propertyIds
Array of strings

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "recipients": [
    ],
  • "endAt": "string",
  • "propertyIds": [
    ]
}

Response samples

Content type
application/json
Example
{
  • "type": "ONE_TIME",
  • "deviceId": "string",
  • "format": "JSON",
  • "transformation": {
    },
  • "propertyIds": [
    ],
  • "sendTo": "string",
  • "recipients": [
    ],
  • "dateTimeZone": "Europe/Paris",
  • "fromDate": "2019-08-24",
  • "untilDate": "2019-08-24",
  • "id": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Commands

Get a command

Get the information about a command

path Parameters
deviceId
required
string
commandId
required
string

Responses

Response samples

Content type
application/json
{
  • "commandId": "string",
  • "deviceId": "string",
  • "commandType": "string",
  • "status": "NEW",
  • "timestamp": 0,
  • "lastUpdateTimestamp": 0,
  • "schedulingPayload": { },
  • "valuePayload": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

List commands

List all the commands sent by the user or the platform to the box.

path Parameters
deviceId
required
string
query Parameters
commandType
string
status
string (CommandStatus)
Enum: "NEW" "SENT" "RECEIVED" "RETRY_SEND" "RETRY_CALLBACK" "ERROR_NOT_RECEIVED" "ERROR_NOT_SENT" "ERROR_TIMEOUT" "ERROR_INVALID_VALUE" "SCHEDULED" "WAITING_FOR_HARDWARE_CONNECTION" "ERROR_RATE_LIMIT" "ERROR_ALREADY_IN_PROGRESS"
propertyId
string
createdBy
string
since
integer <int64>
until
integer <int64>
page
integer >= 1
Default: 1

One-based page index (1..N)

size
integer >= 1
Default: 20

The size of the page to be returned

sort
Array of strings
Default: "timestamp,DESC"

Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Events

List device events

List all the events related to a specific device, i.e. the events sent by a device. This include:

  • 0 to 999: generic
  • 1000 to 1999: platform configuration
  • 1001: No such item (config file doesn't exist)
  • 1002: Syntax error (invalid json)
  • 1003: Invalid type (a field has an invalid type)
  • 1004: Invalid value (a field value is invalid)
  • 1005: Item with ID already exists
  • 1006: Not supported (for example when a protocol is not supported)
  • 2000 to 2999: network configuration
  • 2001: No such item (config file doesn't exist)
  • 2002: Syntax error (invalid json)
  • 2003: Invalid type (a field has an invalid type)
  • 2004: Invalid value (a field value is invalid)
  • 2005: Item with ID already exists
  • 2006: Not supported (for example when a protocol is not supported)
  • 3000 to 3999: data configuration
  • 3001: No such item (config file doesn't exist)
  • 3002: Syntax error (invalid json)
  • 3003: Invalid type (a field has an invalid type)
  • 3004: Invalid value (a field value is invalid)
  • 3005: Item with ID already exists
  • 4000 to 4999: properties
  • 4001: Read error (property could not be read)
  • 4002: Unknown property (property is not known)
  • 4003: Write error (property could not be written)
  • 4004: Property writing Acknowledgement
path Parameters
deviceId
required
string

The ID of the device

query Parameters
codeFrom
integer <int32>

Filter the events by their code

codeTo
integer <int32>

Filter the events by their code

code
integer <int32>

Filter the events by their code

property
string

The propertyId to filter the event

equipmentId
string

The equipmentId to filter the event used only for the status and equipment activation event

since
integer <int64>

The starting date for the events to recover, defaults to 1 day in the past

until
integer <int64>

The end date for the events to recover, defaults to current

page
integer >= 1
Default: 1

One-based page index (1..N)

size
integer >= 1
Default: 20

The size of the page to be returned

sort
Array of strings
Default: "timestamp,DESC"

Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Alarms

API for managing alarms

Create alarm

Create an alarm

path Parameters
deviceId
required
string

The ID of the device

Request Body schema: application/json
required
name
required
string

The name of the alarm

description
string

The description of the alarm

required
object (AlarmConfig)

The conditions to trigger the alarm

object (TemporalConstraints)

The temporal constraints of the alarm

required
Array of objects (AlarmNotificationConfig) non-empty

The type of notifications to send when the alarm is triggered

enableTemporization
boolean

Indicates if the alarm must be close automatically when the alarm conditions returns to normal

object

The tags of the alarm

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "alarmConfig": {
    },
  • "temporalConstraints": {
    },
  • "alarmNotifications": [
    ],
  • "enableTemporization": true,
  • "tags": {
    }
}

Response samples

Content type
application/json
{
  • "alarmId": "string",
  • "deviceId": "string",
  • "name": "string",
  • "description": "string",
  • "temporalConstraints": {
    },
  • "alarmConfig": {
    },
  • "alarmNotifications": [
    ],
  • "tags": {
    },
  • "status": "ACKNOWLEDGED",
  • "globalPriority": "CRITICAL",
  • "lastTriggeredAt": 0,
  • "enableTemporization": true,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

Delete alarm

Delete an alarm

path Parameters
deviceId
required
string

The ID of the device

alarmId
required
string

Responses

Response samples

Content type
application/json
{
  • "alarmId": "string",
  • "deviceId": "string",
  • "name": "string",
  • "description": "string",
  • "temporalConstraints": {
    },
  • "alarmConfig": {
    },
  • "alarmNotifications": [
    ],
  • "tags": {
    },
  • "status": "ACKNOWLEDGED",
  • "globalPriority": "CRITICAL",
  • "lastTriggeredAt": 0,
  • "enableTemporization": true,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

Get alarm

Get an alarm

path Parameters
deviceId
required
string
alarmId
required
string

Responses

Response samples

Content type
application/json
{
  • "alarmId": "string",
  • "deviceId": "string",
  • "name": "string",
  • "description": "string",
  • "temporalConstraints": {
    },
  • "alarmConfig": {
    },
  • "alarmNotifications": [
    ],
  • "tags": {
    },
  • "status": "ACKNOWLEDGED",
  • "globalPriority": "CRITICAL",
  • "lastTriggeredAt": 0,
  • "enableTemporization": true,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

Get alarm history

Get a specific alarm history

path Parameters
deviceId
required
string

The ID of the device

alarmId
required
string
historyId
required
string

Responses

Response samples

Content type
application/json
{
  • "alarmHistoryId": "string",
  • "alarmId": "string",
  • "deviceId": "string",
  • "triggeringStatus": {
    },
  • "details": {
    },
  • "tags": {
    },
  • "triggeredAt": 0
}

Get alarm with history

Get an alarm with history

path Parameters
deviceId
required
string
alarmId
required
string

Responses

Response samples

Content type
application/json
{
  • "alarmResponse": {
    },
  • "lastHistory": {
    }
}

List alarm history

List alarm history for a specific alarm

path Parameters
deviceId
required
string

The ID of the device

alarmId
required
string
query Parameters
from
integer <int64>
to
integer <int64>
type
string (TypeOfAlarm)
Enum: "PROPERTY_MEASUREMENT" "EQUIPMENT_STATUS"
page
integer >= 1
Default: 1

One-based page index (1..N)

size
integer >= 1
Default: 20

The size of the page to be returned

sort
Array of strings
Default: "triggeredAt,DESC"

Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List alarm schedule states

List the schedule states of an alarm

path Parameters
deviceId
required
string
alarmId
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List alarms

List alarms based on the provided criteria

query Parameters
organizationId
string <uuid>

ID of the organization

type
string (TypeOfAlarm)
Enum: "PROPERTY_MEASUREMENT" "EQUIPMENT_STATUS"

Type of the alarm

status
string (AlarmStatus)
Enum: "ACKNOWLEDGED" "OPEN" "CLOSED" "DISABLED" "ARCHIVED"

Status of the alarm

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List alarms for device

List alarms for a device

path Parameters
deviceId
required
string

The ID of the device

query Parameters
type
string (TypeOfAlarm)
Enum: "PROPERTY_MEASUREMENT" "EQUIPMENT_STATUS"
propertyIds
Array of strings
equipmentIds
Array of strings
status
string (AlarmStatus)
Enum: "ACKNOWLEDGED" "OPEN" "CLOSED" "DISABLED" "ARCHIVED"
priority
string (AlarmLevel)
Enum: "CRITICAL" "STANDARD"
tags
Array of strings
page
integer >= 1
Default: 1

One-based page index (1..N)

size
integer >= 1
Default: 20

The size of the page to be returned

sort
Array of strings
Default: "updatedAt,DESC"

Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update alarm

Update an alarm

path Parameters
deviceId
required
string

The ID of the device

alarmId
required
string
Request Body schema: application/json
required
name
string

The name of the alarm

description
string

The description of the alarm

object (AlarmConfigUpdateRequest)

The conditions to trigger the alarm

object (TemporalConstraints)

The temporal constraints of the alarm

Array of objects (AlarmNotificationConfig)

The type of notifications to send when the alarm is triggered

enableTemporization
boolean

Indicates if the alarm must be close automatically when the alarm conditions returns to normal

object
status
string (AlarmStatus)
Enum: "ACKNOWLEDGED" "OPEN" "CLOSED" "DISABLED" "ARCHIVED"

Indicates the status of the alarm

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "alarmConfig": {
    },
  • "temporalConstraints": {
    },
  • "alarmNotifications": [
    ],
  • "enableTemporization": true,
  • "tags": {
    },
  • "status": "ACKNOWLEDGED"
}

Response samples

Content type
application/json
{
  • "alarmId": "string",
  • "deviceId": "string",
  • "name": "string",
  • "description": "string",
  • "temporalConstraints": {
    },
  • "alarmConfig": {
    },
  • "alarmNotifications": [
    ],
  • "tags": {
    },
  • "status": "ACKNOWLEDGED",
  • "globalPriority": "CRITICAL",
  • "lastTriggeredAt": 0,
  • "enableTemporization": true,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

Update alarm constraints

Update constraints of an alarm

path Parameters
deviceId
required
string
alarmId
required
string
Request Body schema: application/json
required
constraintType
required
string (ConfigConstraintType)
Value: "PROPERTY_ALARM"
scheduleId
string
Array of objects (ConstraintsConfigRequest)
removeConstraintIds
Array of strings

Responses

Request samples

Content type
application/json
{
  • "constraintType": "PROPERTY_ALARM",
  • "scheduleId": "string",
  • "newConstraints": [
    ],
  • "removeConstraintIds": [
    ]
}

Response samples

Content type
application/json
{
  • "alarmId": "string",
  • "deviceId": "string",
  • "name": "string",
  • "description": "string",
  • "temporalConstraints": {
    },
  • "alarmConfig": {
    },
  • "alarmNotifications": [
    ],
  • "tags": {
    },
  • "status": "ACKNOWLEDGED",
  • "globalPriority": "CRITICAL",
  • "lastTriggeredAt": 0,
  • "enableTemporization": true,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

Update alarm history

Update a specific alarm history

path Parameters
deviceId
required
string

The ID of the device

alarmId
required
string
historyId
required
string
Request Body schema: application/json
required
priority
string (AlarmLevel)
Enum: "CRITICAL" "STANDARD"
message
string
status
string (AlarmStatus)
Enum: "ACKNOWLEDGED" "OPEN" "CLOSED" "DISABLED" "ARCHIVED"
applyStatusOnAlarm
boolean
updateStatusOfPreviousAlarms
boolean

Responses

Request samples

Content type
application/json
{
  • "priority": "CRITICAL",
  • "message": "string",
  • "status": "ACKNOWLEDGED",
  • "applyStatusOnAlarm": true,
  • "updateStatusOfPreviousAlarms": true
}

Response samples

Content type
application/json
{
  • "alarmHistoryId": "string",
  • "alarmId": "string",
  • "deviceId": "string",
  • "triggeringStatus": {
    },
  • "details": {
    },
  • "tags": {
    },
  • "triggeredAt": 0
}

Update alarm status

Update the status of an alarm

path Parameters
deviceId
required
string

The ID of the device

alarmId
required
string
Request Body schema: application/json
required
status
required
string (AlarmStatus)
Enum: "ACKNOWLEDGED" "OPEN" "CLOSED" "DISABLED" "ARCHIVED"

Responses

Request samples

Content type
application/json
{
  • "status": "ACKNOWLEDGED"
}

Response samples

Content type
application/json
{
  • "alarmId": "string",
  • "deviceId": "string",
  • "name": "string",
  • "description": "string",
  • "temporalConstraints": {
    },
  • "alarmConfig": {
    },
  • "alarmNotifications": [
    ],
  • "tags": {
    },
  • "status": "ACKNOWLEDGED",
  • "globalPriority": "CRITICAL",
  • "lastTriggeredAt": 0,
  • "enableTemporization": true,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

Configuration management

The Configuration Management API helps you to track the revisions (history) of configurations of your device. We, also, track the revision status:

  • DRAFT, there can be only at maximum only one revision in draft mode
  • CURRENT, there can be only at maximum only one revision set as current
  • ERROR, is used for revisions that have raised errors when being deployed on the device
  • ARCHIVED, all past revisions will be archived. You are limited to 30 archived revisions per device. Any new archived revision over 30 will automatically delete the oldest ARCHIVED revision
  • DISCARDED, a draft that the user wanted to remove. Discarded revisions are removed after 30 days from being discarded

Every device has a set of configurations:

  • Equipment defines what are the equipments this device is connected to.
  • Properties defines what properties (points) of an equipment are accessible (in read and/or write) on the device.
  • Networks defines how to access the equipments.
  • Connectors defines how the equipments are connected (physical port configuration) to the device.

Configuring a Wattsense box goes through multiple steps, as shown in the following diagram (this is not a physical connection schema). The arrows in the diagram define the dependencies, which defines the order in which the configuration should be done:

  1. Define the equipment you want to interact with, configure which protocol to use to communicate with these equipments.
  2. Define the properties that you want to acquire, or to set, on the previous equipment. Depending on the protocol, the property will be configured differently, therefore ensure that you are using the same protocol. Don't worry if you make a mistake, the platform will ensure that the protocols are the same.
  3. Configure the physical connector used to connect the Wattsense box to the equipment. Depending on the connector, this configuration can be either optional (e.g. ip) or mandatory (eg. serial).
  4. Define the networks (driver configuration) that the Wattsense box will use to communicate with the equipment. This configuration needs to have a protocol defined, it has to match the one used on the equipment (the platform will ensure that it's the case). Some protocols (such as MODBUS_IP) do not need a connector to be specified in the network configuration.

Note

Editing is limited to DRAFT revision only. Therefore, when creating or updating a resource configuration, the platform checks if there is a draft or not. If not, we will automatically create a draft revision for you based on the current config revision.

Check the corresponding API.

Equipment
Equipment
Network
(MODBUS SERIAL)
<div>Network<br></div>(MODBUS SERIAL)
Property
Property
Property
Property
Property
Property
Equipment
Equipment
Connector
(SERIAL)
[Not supported by viewer]
Network
(BACNET/IP)
Network<br>(BACNET/IP)
Equipment
Equipment
Property
Property
Connector
(IP)
Connector<br>(IP)
Network
(BACNET/IP)
Network<br>(BACNET/IP)
Equipment
Equipment
Property
Property

Create a new draft config revision

This endpoint allows to create a new config revision, either from the current revision (default) or from a specific revision (using parentRevisionId).

Common use cases:

  • To create a new draft revision from the current revision, one can do the POST with an empty json body.
  • To create a new draft revision from an older revision, the attribute parentRevisionId has to be set to the exact revision id.
  • To publish a previous revision, the attribute publish has to be set to true. Combined with parentRevisionId, one can publish any revision. In this case the resulting revision will skip the draft stage.
path Parameters
deviceId
required
string

The ID of the device

Request Body schema: application/json
required
parentRevisionId
string <uuid>

A revision to use as a basis. By default we use the current revision.

If a value is set, we copy the config revision whose id is parentRevisionId and generate a new config revision. The new config revision will inherit all the configurations (properties, networks, and networkInterfaces).

This has no effect if fromScratch is set to true.

fromScratch
boolean

Create a new revision from scratch by passing any older configuration. This will not keep any link with previous revisions. Any property created for this revision will not be linked to a previous property.

Use this option only if you really want to restart from scratch.

notes
string

A description of this revision. Useful for listing the changes the user made in this revision

publish
boolean

Whether to publish immediately the revision after creation or not. This is useful when we want to re-publish an old revision. For more about publishing a revision see Publish the draft revision.

Note

Some configuration changes will not trigger a send to device. Like changing the name, the slug, the units, transformations, and tags.

object

An object to tag this revision. This value will override the existing tags, you have to send all the tags you want to set.

Responses

Request samples

Content type
application/json
{
  • "parentRevisionId": "1fb68043-00cb-4434-923f-6cf26adb0f19",
  • "fromScratch": true,
  • "notes": "string",
  • "publish": true,
  • "tags": {
    }
}

Response samples

Content type
application/json
{
  • "revisionId": "bae12d01-48af-47b3-9304-b09ef0081cd6",
  • "deviceId": "string",
  • "parentRevisionId": "1fb68043-00cb-4434-923f-6cf26adb0f19",
  • "notes": "string",
  • "status": "DRAFT",
  • "errors": [
    ],
  • "properties": [
    ],
  • "equipments": [
    ],
  • "networks": [
    ],
  • "gatewayInterfaces": [
    ],
  • "connectors": {
    },
  • "pinnedResources": {
    },
  • "commandId": "string",
  • "tags": {
    },
  • "scheduler": {
    },
  • "timeZone": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

Discard or archive the draft revision

Discarding the draft means that the draft is no longer useful for you. The status of the revision will change to DISCARDED. Discarded draft will be definitively removed after 30 days from being discarded.

Archiving the draft means that you no longer need to work on this revision for the moment and might come back to it later on. The status will change to ARCHIVED.

The endpoint returns the discarded/archived revision with its id. To restore a discarded revision, one has to create a new draft using this revisionId as source.

path Parameters
deviceId
required
string

The ID of the device

query Parameters
archive
boolean

Responses

Response samples

Content type
application/json
{
  • "revisionId": "bae12d01-48af-47b3-9304-b09ef0081cd6",
  • "deviceId": "string",
  • "parentRevisionId": "1fb68043-00cb-4434-923f-6cf26adb0f19",
  • "notes": "string",
  • "status": "DRAFT",
  • "errors": [
    ],
  • "properties": [
    ],
  • "equipments": [
    ],
  • "networks": [
    ],
  • "gatewayInterfaces": [
    ],
  • "connectors": {
    },
  • "pinnedResources": {
    },
  • "commandId": "string",
  • "tags": {
    },
  • "scheduler": {
    },
  • "timeZone": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

Export differences between two configurations

Export the equipment and properties differences between two configurations

path Parameters
deviceId
required
string

The ID of the device

query Parameters
source
string (RevisionStatus)
Default: "DRAFT"
Enum: "DRAFT" "SENT" "CURRENT" "DISCARDED" "ERROR" "ARCHIVED"

The status of the revision. The possible values are :

Status Meaning
DRAFT The revision the draft for this device
SENT The revision has been sent to the device
CURRENT The revision is the current one, and is on the device
DISCARDED The draft revision was discarded by the user
ERROR The revision is in error
ARCHIVED Old revision that previously was in status CURRENT
target
string (RevisionStatus)
Default: "CURRENT"
Enum: "DRAFT" "SENT" "CURRENT" "DISCARDED" "ERROR" "ARCHIVED"

The status of the revision. The possible values are :

Status Meaning
DRAFT The revision the draft for this device
SENT The revision has been sent to the device
CURRENT The revision is the current one, and is on the device
DISCARDED The draft revision was discarded by the user
ERROR The revision is in error
ARCHIVED Old revision that previously was in status CURRENT

Responses

Response samples

Content type
application/json
"string"

Get config revision

Get a specific config revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

Responses

Response samples

Content type
application/json
{
  • "revisionId": "bae12d01-48af-47b3-9304-b09ef0081cd6",
  • "deviceId": "string",
  • "parentRevisionId": "1fb68043-00cb-4434-923f-6cf26adb0f19",
  • "notes": "string",
  • "status": "DRAFT",
  • "errors": [
    ],
  • "properties": [
    ],
  • "equipments": [
    ],
  • "networks": [
    ],
  • "gatewayInterfaces": [
    ],
  • "connectors": {
    },
  • "pinnedResources": {
    },
  • "commandId": "string",
  • "tags": {
    },
  • "scheduler": {
    },
  • "timeZone": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

Get data points count

Get data points count for a specific revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

Responses

Response samples

Content type
application/json
{
  • "current": 0,
  • "max": 0,
  • "hourlyBasedComputation": true
}

Get virtual properties count

Get virtual properties count for a specific revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

Responses

Response samples

Content type
application/json
{
  • "current": 0,
  • "max": 0
}

Import config

Import a config to the draft revision

path Parameters
deviceId
required
string

The ID of the device

query Parameters
force
boolean

If there exists another configuration this parameter force it to override it

Request Body schema: application/json
required
revisionId
required
string <uuid>

The id of the revision

deviceId
required
string

The device id associated with the revision

parentRevisionId
string <uuid>

The id of the parent revision

notes
string

A description of the revision

status
required
string (RevisionStatus)
Enum: "DRAFT" "SENT" "CURRENT" "DISCARDED" "ERROR" "ARCHIVED"

The status of the revision. The possible values are :

Status Meaning
DRAFT The revision the draft for this device
SENT The revision has been sent to the device
CURRENT The revision is the current one, and is on the device
DISCARDED The draft revision was discarded by the user
ERROR The revision is in error
ARCHIVED Old revision that previously was in status CURRENT
errors
Array of strings

This contains the error messages coming from the device when we deploy the configuration

required
Array of objects (Property)

A list of properties configurations

required
Array of objects (Equipment)

A list of equipment configurations

required
Array of objects (Network)

A list of networks configurations

required
Array of objects (GatewayInterface)

A list of gateway interfaces configurations

required
object

An object containing the configured connectors, the key is the connector name, and the value is its configuration

required
object

Resources associated with the revision

commandId
string

The identifier of the command created to send the configuration to the box. Use the Command API to track the status

required
object

The tags of the revision

required
object (Scheduler)

The associated schedulers configurations

timeZone
required
string

Responses

Request samples

Content type
application/json
{
  • "revisionId": "bae12d01-48af-47b3-9304-b09ef0081cd6",
  • "deviceId": "string",
  • "parentRevisionId": "1fb68043-00cb-4434-923f-6cf26adb0f19",
  • "notes": "string",
  • "status": "DRAFT",
  • "errors": [
    ],
  • "properties": [
    ],
  • "equipments": [
    ],
  • "networks": [
    ],
  • "gatewayInterfaces": [
    ],
  • "connectors": {
    },
  • "pinnedResources": {
    },
  • "commandId": "string",
  • "tags": {
    },
  • "scheduler": {
    },
  • "timeZone": "string"
}

Response samples

Content type
application/json
{
  • "revisionId": "bae12d01-48af-47b3-9304-b09ef0081cd6",
  • "deviceId": "string",
  • "parentRevisionId": "1fb68043-00cb-4434-923f-6cf26adb0f19",
  • "notes": "string",
  • "status": "DRAFT",
  • "errors": [
    ],
  • "properties": [
    ],
  • "equipments": [
    ],
  • "networks": [
    ],
  • "gatewayInterfaces": [
    ],
  • "connectors": {
    },
  • "pinnedResources": {
    },
  • "commandId": "string",
  • "tags": {
    },
  • "scheduler": {
    },
  • "timeZone": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

List config revisions

List all config revisions

path Parameters
deviceId
required
string

The ID of the device

query Parameters
status
Array of strings (RevisionStatus)
Items Enum: "DRAFT" "SENT" "CURRENT" "DISCARDED" "ERROR" "ARCHIVED"
since
integer <int64>

The timestamp (in millis) from which to start querying (default is one day ago timestamp)

until
integer <int64>

The timestamp (in millis) to which to end querying (default is now timestamp)

page
integer >= 1
Default: 1

One-based page index (1..N)

size
integer >= 1
Default: 2

The size of the page to be returned

sort
Array of strings
Default: "createdAt,DESC"

Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update/Publish the draft revision

This endpoint allows to update and to send the configurations to the device.

To send the configuration to the device and then setting the configuration as current, one has to set the boolean publish to true. All changes in Equipments, Properties, Networks and Connectors will be sent to the device. Once the device confirms that the configurations are valid, with no issues, we set the revision as current and restart the services on the device (this is not a reboot of the device).

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to CURRENT. After a confirmation from the device, the platform will send a RESTART command so that the embedded software take into account the changes.

If the Wattsense box does not acknowledge, we retry 3 times to send the configuration. If it fails, the revision goes back to the status DRAFT.

The revision with status CURRENT, will still be considered as the current one until the acknowledgment from the device. Once the new revision is flagged as CURRENT the previous revision changes to ARCHIVED.

If the published configurations errors out on the box, it will still be set to CURRENT with an additional flag error = true. The list of errors will be in the list errors.

Note

Some configuration changes will not trigger a send to device. Like changing the name, the slug, the units, transformations, and tags. In this case, the revision will be marked as current.

path Parameters
deviceId
required
string

The ID of the device

Request Body schema: application/json
required
notes
string

A description of this revision. Useful for listing the changes the user made in this revision

publish
boolean

Whether to publish immediately the revision after creation or not. This is useful when we want to re-publish an old revision. For more about publishing a revision see Publish the draft revision.

Note

Some configuration changes will not trigger a send to device. Like changing the name, the slug, the units, transformations, and tags.

object

An object to tag this revision. This value will override the existing tags, you have to send all the tags you want to set.

Responses

Request samples

Content type
application/json
{
  • "notes": "string",
  • "publish": true,
  • "tags": {
    }
}

Response samples

Content type
application/json
{
  • "revisionId": "bae12d01-48af-47b3-9304-b09ef0081cd6",
  • "deviceId": "string",
  • "parentRevisionId": "1fb68043-00cb-4434-923f-6cf26adb0f19",
  • "notes": "string",
  • "status": "DRAFT",
  • "errors": [
    ],
  • "properties": [
    ],
  • "equipments": [
    ],
  • "networks": [
    ],
  • "gatewayInterfaces": [
    ],
  • "connectors": {
    },
  • "pinnedResources": {
    },
  • "commandId": "string",
  • "tags": {
    },
  • "scheduler": {
    },
  • "timeZone": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

Equipment configuration

Create equipment

Create a new equipment in the draft config revision

path Parameters
deviceId
required
string

The ID of the device

query Parameters
validateOnly
boolean

If set to true, will only validate the configuration

Request Body schema: application/json
required
name
required
string non-empty

Name of the equipment

description
string

Description of the equipment

required
object (EquipmentConfiguration)

Configuration of the equipment

object

Tags associated with the equipment

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "config": {
    },
  • "tags": {
    }
}

Response samples

Content type
application/json
{
  • "equipmentId": "string",
  • "name": "string",
  • "description": "string",
  • "config": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "tags": {
    }
}

Create multiple equipment

Create multiple new equipment in the draft config revision

path Parameters
deviceId
required
string

The ID of the device

query Parameters
validateOnly
boolean
Request Body schema: application/json
required
required
Array of objects (EquipmentCreationRequest)

Responses

Request samples

Content type
application/json
{
  • "insert": [
    ]
}

Response samples

Content type
application/json
{
  • "equipments": [
    ]
}

Delete equipment

Delete an equipment in the draft config revision. If the equipment has properties or a network linked to it, one has to remove those properties beforehand.

The only exception is when the network is connected to more than one equipment. In that case, the last equipment of that network cannot be removed until that network is removed.

path Parameters
deviceId
required
string

The ID of the device

equipmentId
required
string

The ID of the equipment

query Parameters
updateDependentNetworks
boolean

Whether or not to update dependent networks

Responses

Response samples

Content type
application/json
{
  • "equipmentId": "string",
  • "name": "string",
  • "description": "string",
  • "config": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "tags": {
    }
}

Delete multiple equipment

Delete multiple equipment in the draft config revision

path Parameters
deviceId
required
string

The ID of the device

Request Body schema: application/json
required
equipments
required
Array of strings

Responses

Request samples

Content type
application/json
{
  • "equipments": [
    ]
}

Response samples

Content type
application/json
{
  • "deleted": [
    ]
}

Get equipment

Get an equipment in a specific revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

equipmentId
required
string

The ID of the equipment

Responses

Response samples

Content type
application/json
{
  • "equipmentId": "string",
  • "name": "string",
  • "description": "string",
  • "config": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "tags": {
    }
}

Get equipment properties statuses

Get the statuses of all properties of an equipment

Note: this endpoint is deprecated and should be replaced by the getEquipmentStatus endpoint

path Parameters
deviceId
required
string

The ID of the device

equipmentId
required
string

The ID of the equipment

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get equipment status

Get an equipment status

path Parameters
deviceId
required
string

The ID of the device

equipmentId
required
string

The ID of the equipment

Responses

Response samples

Content type
application/json
{
  • "equipmentId": "string",
  • "protocol": "MODBUS_SERIAL",
  • "status": "DOWN",
  • "equipmentDownInfo": {
    },
  • "lastDataPointReceivedAt": 0,
  • "lorawanStatusInfo": {
    },
  • "reportedAt": 0,
  • "equipmentDataSummary": {
    }
}

List equipment

List equipment in a specific revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

query Parameters
protocol
string (EquipmentProtocol)
Enum: "MODBUS_SERIAL" "MODBUS_IP" "MBUS" "BACNET_IP" "LON_IP852" "LORAWAN_V1_0" "LPB" "KNX"

Filter the equipments by their communication protocol

tag
string

Filter the results by a Tag key and/or a tag value. The filter has to be in the format tagName[:tagValue]. For example, to filter only by the existence of a tag (useful for markers), one can use ?tag=boiler to filter an equipment with the marker "boiler". To filter by a specific value of a tag use ?tag=season:summer.

Multiple filters can be used, by repeating the query as in ?tag=rooftop&tag=ahu&tag=backup:b:true. In the latter tag filter backup:b:true, the key is backup and value b:true (an example of a haystack-style boolean tagging).

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List equipment statuses

List all equipment statuses

path Parameters
deviceId
required
string

The ID of the device

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update equipment

Update an equipment in the draft config revision

path Parameters
deviceId
required
string

The ID of the device

equipmentId
required
string

The ID of the equipment

query Parameters
validateOnly
boolean

If set to true, will only validate the configuration

forceLorawanCodecUpdate
boolean

Forces LoRaWAN codec updates (codec changes are not allowed by default)

applyChangesToGateways
boolean

Whether or not to reflect name changes to redirected properties in gateways

Request Body schema: application/json
required
name
string

Name of the equipment

description
string

Description of the equipment

object (EquipmentConfiguration)

Configuration of the equipment

object

Tags associated with the equipment

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "config": {
    },
  • "tags": {
    }
}

Response samples

Content type
application/json
{
  • "equipmentId": "string",
  • "name": "string",
  • "description": "string",
  • "config": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "tags": {
    }
}

Update multiple equipment

Update multiple equipment in the draft config revision

path Parameters
deviceId
required
string

The ID of the device

query Parameters
validateOnly
boolean

If set to true, will only validate the configuration

forceLorawanCodecUpdate
boolean

Forces LoRaWAN codec updates (codec changes are not allowed by default)

applyChangesToGateways
boolean

Whether or not to reflect name changes to redirected properties in gateways

Request Body schema: application/json
required
required
Array of objects (BulkEquipmentUpdateItem)

Responses

Request samples

Content type
application/json
{
  • "update": [
    ]
}

Response samples

Content type
application/json
{
  • "equipments": [
    ]
}

Gateway interface configuration

A Gateway Interface allows you to use the box as a gateway. You can, for instance, define a BACnet Gateway interface, which will make the box act as a BACnet server, and redirect data from other one or many networks defined on the box.

Create gateway interface

Create a new gateway interface in the draft config revision

path Parameters
deviceId
required
string

The ID of the device

Request Body schema: application/json
required
name
required
string non-empty

A name for this gateway interface

description
string

A short description of this gateway interface. For BACnet gateway interfaces, this value is used as a description of the BACnet device.

required
object (GatewayInterfaceConfiguration)
interFrameDelay
integer <int64> [ 0 .. 1000000 ]

The delay in micro seconds to wait after a frame is sent

responseTimeout
integer <int64> [ 100 .. 1000000 ]

Request response timeout in micro seconds

retryNumber
integer <int32> [ 0 .. 1000000 ]

The number of retries if the request was lost

object

Tags associated with the gateway interface

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "config": {
    },
  • "interFrameDelay": 1000000,
  • "responseTimeout": 100,
  • "retryNumber": 1000000,
  • "tags": {
    }
}

Response samples

Content type
application/json
{
  • "gatewayInterfaceId": "string",
  • "name": "string",
  • "description": "string",
  • "config": {
    },
  • "interFrameDelay": 1000000,
  • "responseTimeout": 100,
  • "retryNumber": 1000000,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "tags": {
    }
}

Delete gateway interface

Delete a gateway interface in the draft config revision

path Parameters
deviceId
required
string

The ID of the device

gatewayInterfaceId
required
string

The ID of the gateway interface

Responses

Response samples

Content type
application/json
{
  • "gatewayInterfaceId": "string",
  • "name": "string",
  • "description": "string",
  • "config": {
    },
  • "interFrameDelay": 1000000,
  • "responseTimeout": 100,
  • "retryNumber": 1000000,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "tags": {
    }
}

Get gateway interface

Get a specific gateway interface from a specific config revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

gatewayInterfaceId
required
string

The ID of the gateway interface

Responses

Response samples

Content type
application/json
{
  • "gatewayInterfaceId": "string",
  • "name": "string",
  • "description": "string",
  • "config": {
    },
  • "interFrameDelay": 1000000,
  • "responseTimeout": 100,
  • "retryNumber": 1000000,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "tags": {
    }
}

List gateway interfaces

List all gateway interfaces present in a specific config revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

query Parameters
connector
string

Filter the gateway interfaces by the connector they're connected to

protocol
string (GatewayProtocol)
Enum: "BACNET_IP_GATEWAY" "MODBUS_IP_GATEWAY" "MQTT_GATEWAY" "PLUGIN_GATEWAY"

Filter the gateway interfaces by their communication protocol

tag
string

Filter the results by a Tag key and/or a tag value. The filter has to be in the format tagName[:tagValue]. For example, to filter only by the existence of a tag (useful for markers), one can use ?tag=boiler to filter an equipment with the marker "boiler". To filter by a specific value of a tag use ?tag=season:summer.

Multiple filters can be used, by repeating the query as in ?tag=rooftop&tag=ahu&tag=backup:b:true. In the latter tag filter backup:b:true, the key is backup and value b:true (an example of a haystack-style boolean tagging).

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update gateway interface

Update a gateway interface in the draft config revision

Note

Editing a gateway interface is limited to draft configuration revisions. Therefore, when creating a new gateway, the platform checks if the current configuration revision is in draft mode or not. If it's the latter, we will automatically create a draft revision for you based on the current config revision.

Check the corresponding API.

path Parameters
deviceId
required
string

The ID of the device

gatewayInterfaceId
required
string

The ID of the gateway interface

Request Body schema: application/json
required
name
string

A name for this gateway interface

description
string

A short description of this gateway interface. For BACnet gateway interfaces, this value is used as a description of the BACnet device.

object (GatewayInterfaceConfiguration)
interFrameDelay
integer <int64> [ 0 .. 1000000 ]

The delay in micro seconds to wait after a frame is sent

responseTimeout
integer <int64> [ 100 .. 1000000 ]

Request response timeout in micro seconds

retryNumber
integer <int32> [ 0 .. 1000000 ]

The number of retries if the request was lost

object

Tags associated with the gateway interface

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "config": {
    },
  • "interFrameDelay": 1000000,
  • "responseTimeout": 100,
  • "retryNumber": 1000000,
  • "tags": {
    }
}

Response samples

Content type
application/json
{
  • "gatewayInterfaceId": "string",
  • "name": "string",
  • "description": "string",
  • "config": {
    },
  • "interFrameDelay": 1000000,
  • "responseTimeout": 100,
  • "retryNumber": 1000000,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "tags": {
    }
}

Property configuration

A property, also called "point" in the BMS jargon, can be either a read source (eg. sensor), write target (eg. actuator), or read and write.

The Wattsense box will get (or set, in case of write) a property's values from the equipment using a predefined network.

Each property has two attributes that are used to define the direction in which data flows:

  • accessType defines whether data is read / written from Wattsense or stays locally on the box.
    • REMOTE_READ_ONLY and REMOTE_WRITE_ONLY are used respectively to read data and send it to Wattsense cloud, and to send data from Wattsense cloud to the box
    • LOCAL is used to avoid accessing the data remotely from Wattsense cloud platform.
  • redirectToProperties this is used to send data to other properties in addition to the behavior defined by the accessType. When used with REMOTE_xxx data flows to/from Wattsense cloud to the target property, and also flows from the property itself to other properties. When used with LOCAL, data only flows out-of the property.

Some examples of how to use the access type and redirections:

  • Write / Read data to an equipment or gateway interface:

    +-----------+        +----------+             +-----------+
    |equipment A+------->+property A+------------>+ Wattsense |
    +-----------+        +----+-----+             +---+-------+
                                                      |
                                                      |
                              +-----------------------+
                              |
    +-----------+        +----v-----+
    |gateway int+<-------+property B|
    +-----------+        +----------+
    

    Here, property A is in read and sending data to Wattsense cloud and property B is in write, taking data Wattsense and writing it to the target gateway interface. Notice that you can read and write data to/from equipments or gateway interfaces.

    The used configuration is:

    • property A: accessType = REMOTE_READ_ONLY
    • property B: accessType = REMOTE_WRITE_ONLY
  • Redirect a REMOTE_READ_ONLY property from one equipment to a LOCAL property linked to another equipment:

    +-----------+        +----------+             +-----------+
    |equipment A+------->+property A+------------>+ Wattsense |
    +-----------+        +----+-----+             +-----------+
                              |
                              |
    +-----------+        +----v-----+
    |equipment B+<-------+property B|
    +-----------+        +----------+
    

    Here, property A is defined as REMOTE_READ_ONLY with a redirectToProperties containing property B. Data will be read every timer seconds, forwarded to the Wattsense cloud and also to the property B, which will send it to the equipment equipment B

    The used configuration is:

    • property A: accessType = REMOTE_READ_ONLY and redirectToProperties = [property B]
    • property B: accessType = LOCAL
  • Redirect a REMOTE_READ_ONLY property to a LOCAL property linked to a gateway interface

     +-----------+        +----------+             +-----------+
     |equipment A+------->+property A+------------>+ Wattsense |
     +-----------+        +----+-----+             +-----------+
                               |
                               |
    +------------+        +----v-----+
    |gateway int.+<-------+property B|
    +------------+        +----------+
    

    Here, property A is defined as REMOTE_READ_ONLY with a redirectToProperties containing property B. Data will be read every timer seconds, forwarded to the Wattsense cloud and also to the property B, which will send it to the gateway interface gateway int.

    The used configuration is:

    • property A: accessType = REMOTE_READ_ONLY and redirectToProperties = [property B]
    • property B: accessType = LOCAL
  • A more complex, non-realistic case, that shows how far we can combine properties:

    +--------------+        +----------+
    |gateway int. C+------->+property C|
    +--------------+        +----------+
                                 |
                                 |
       +-----------+        +----v-----+             +-----------+
       |equipment A+<-------+property A+<------------+ Wattsense |
       +-----------+        +----------+             +-----------+
                                 |
                                 |
    +--------------+        +----v-----+
    |gateway int. B+<-------+property B|
    +--------------+        +----------+
    

    Here, property A is defined as REMOTE_WRITE_ONLY with a redirectToProperties containing property B:

    • Whenever data is written to property A, data will be sent to the equipment equipment A
    • At the same time, this data will also be written to the property property B, that will make it available on the gateway interface gateway int. B
    • If data is written to the property property C through the gateway interface gateway int. C, its data will also be forwarded to the property property A, which in turn will write it to the equipment equipment A.

    The used configuration is:

    • property A: accessType = REMOTE_WRITE_ONLY and redirectToProperties = [property B]
    • property B: accessType = LOCAL
    • property C: accessType = LOCAL and redirectToProperties = [property A]
  • One can also make data exchange fully local:

    +--------------+        +----------+
    |gateway int. C+------->+property C|
    +--------------+        +----------+
                                 |
                                 |
       +-----------+        +----v-----+
       |equipment A+<-------+property A|
       +-----------+        +----------+
                                 |
                                 |
    +--------------+        +----v-----+
    |gateway int. B+<-------+property B|
    +--------------+        +----------+
    

    In this case, the property property A is defined as a LOCAL property.

    The used configuration is:

    • property A: accessType = LOCAL and redirectToProperties = [property B]
    • property B: accessType = LOCAL
    • property C: accessType = LOCAL and redirectToProperties = [property A]

Create properties in bulk

Create properties in bulk, return the created properties

path Parameters
deviceId
required
string

The ID of the device

Request Body schema: application/json
required
required
Array of objects (PropertyCreationRequest)

Responses

Request samples

Content type
application/json
{
  • "insert": [
    ]
}

Response samples

Content type
application/json
{
  • "inserted": [
    ]
}

Create property

Create a new property in the draft config revision

path Parameters
deviceId
required
string

The ID of the device

Request Body schema: application/json
required
equipmentId
string

The equipment this property is linked to. This is mutually exclusive with the gatewayInterfaceId. You should provide either of those.

gatewayInterfaceId
string

The id of the gateway interface this property is linked to. This is mutually exclusive with the equipmentId. You should provide either of those. NOTE: Not used for virtual properties.

name
required
string non-empty

The name of the property

slug
required
string^[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*$

A unique (per device) keyword used to query this property. The possible values are:

  • lower case letters ([a-z])
  • upper case letters ([A-Z])
  • numbers ([0-9])
  • dashes (minus sign) (-)
  • underscore (_)

If two properties have the same slug, the API will respond with a conflict 409 response. Moreover, the slug must not be in conflict with the propertyId.

The slug is used to request the property values via the api /v1/devices/{deviceId}/properties/{slug}. As this slug is user managed (i.e. can change if the user wants to), we also provide the api to query the property values using the id via /v1/devices/{deviceId}/properties/{propertyId}

description
string

A short description

disabled
boolean

If set to true, the property will not be sent to the box

redirectToProperties
Array of strings

Contains a list of propertyIds to which redirect incoming data. You can redirect data to any property, the only limit is that the receiving property is not of access type REMOTE_READ_ONLY. As a read property is not supposed be written to. See Property configuration for examples. NOTE: Not used for virtual properties.

accessType
required
string (PropertyAccessType)
Enum: "REMOTE_READ_ONLY" "REMOTE_WRITE_ONLY" "REMOTE_READ_WRITE" "LOCAL"

Defines how the property behaves:

  • REMOTE_READ_ONLY: the property is meant to read data and forward it to the Wattsense cloud
  • REMOTE_WRITE_ONLY: the property is meant to receive data (write) from the Wattsense cloud and write it to an equipment
  • REMOTE_READ_WRITE (technical preview): the property will read data and forward it to Wattsense cloud and also takes data from Wattsense cloud and write it to an equipment. For the moment, only modbus and bacnet protocols are accepted. This is an experimental feature.
  • LOCAL: the property does not send / receive any data (see redirectToProperty for more information).
    • For it to redirect data somewhere it has to be combined with redirectToProperties, in which case it will read data (given the timer) and send them to another property
    • For it to receive data from another property, it has to be listed in redirectToProperties of the source property.

See Property configuration for examples.

timer
integer <int32> >= 1

The number of seconds between two polls of data. This is used by the device when reading data from an equipment NOTE: Not used for virtual properties, as virtual properties are computed each time a new value is emitted for the related properties.

required
object (PropertyConfiguration)

The configuration of the property to read from or write to an equipment or a gateway interface

unit
string

The engineering unit of this property

object (ValueTransformation)

An operation to apply on the property value received through the API, Webhooks and MQTT, on read. The data is transformed only when the user read from the platform. The scaling is a slope-intercept formula a*x + b where x is the payload. This scaling is only applied for numeric payloads, and the result is always a Double.

object

Tags for this resource. Keys and Values have to be strings.

kind
string (PropertyValueKindType)
Enum: "NONE" "date" "date-time" "date-time-range" "free-form-date-time" "daily-schedule" "synco-exception-period" "weekly-schedule" "bacnet-schedule" "bacnet-calendar" "bacnet-exception-schedule"

Defines how the data is to be interpreted and encoded on the equipment.

kind Description
date a date in the format yyyy-MM-dd
date-time a date time in the format `yyyy-MM-ddTHH:mm:ss
free-form-date-time a json with all date time entries being optional
daily-schedule the definition of a schedule to apply for a single day
synco-exception-period a single synco exception (start - end period)
bacnet-schedule the definition of a Bacnet schedule for whole week

NOTES:

  • Only BACnet, RVL and Synco devices support this field
  • Only devices with software version >= 5.7.0 support this field
  • Not used for virtual properties.

Responses

Request samples

Content type
application/json
{
  • "equipmentId": "string",
  • "gatewayInterfaceId": "string",
  • "name": "string",
  • "slug": "string",
  • "description": "string",
  • "disabled": true,
  • "redirectToProperties": [
    ],
  • "accessType": "REMOTE_READ_ONLY",
  • "timer": 1,
  • "config": {
    },
  • "unit": "string",
  • "scaling": {
    },
  • "tags": {
    },
  • "kind": "NONE"
}

Response samples

Content type
application/json
{
  • "propertyId": "string",
  • "equipmentId": "string",
  • "gatewayInterfaceId": "string",
  • "redirectToProperties": [
    ],
  • "accessType": "REMOTE_READ_ONLY",
  • "disabled": true,
  • "name": "string",
  • "slug": "string",
  • "description": "string",
  • "timer": 1,
  • "config": {
    },
  • "scaling": {
    },
  • "unit": "string",
  • "kind": "NONE",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "tags": {
    }
}

Delete properties in bulk

Delete properties in bulk, return the deleted properties

path Parameters
deviceId
required
string

The ID of the device

Request Body schema: application/json
required
delete
required
Array of strings

A list of properties to delete

force
required
boolean

Whether to force the deletion if it is still in use

Responses

Request samples

Content type
application/json
{
  • "delete": [
    ],
  • "force": true
}

Response samples

Content type
application/json
{
  • "deleted": [
    ]
}

Delete property

Delete a property in the draft config revision

path Parameters
deviceId
required
string
propertyId
required
string
query Parameters
force
boolean

Responses

Response samples

Content type
application/json
{
  • "propertyId": "string",
  • "equipmentId": "string",
  • "gatewayInterfaceId": "string",
  • "redirectToProperties": [
    ],
  • "accessType": "REMOTE_READ_ONLY",
  • "disabled": true,
  • "name": "string",
  • "slug": "string",
  • "description": "string",
  • "timer": 1,
  • "config": {
    },
  • "scaling": {
    },
  • "unit": "string",
  • "kind": "NONE",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "tags": {
    }
}

Get property

Get a property configuration from a specific config revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

propertyId
required
string

The ID of the property

Responses

Response samples

Content type
application/json
{
  • "propertyId": "string",
  • "equipmentId": "string",
  • "gatewayInterfaceId": "string",
  • "redirectToProperties": [
    ],
  • "accessType": "REMOTE_READ_ONLY",
  • "disabled": true,
  • "name": "string",
  • "slug": "string",
  • "description": "string",
  • "timer": 1,
  • "config": {
    },
  • "scaling": {
    },
  • "unit": "string",
  • "kind": "NONE",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "tags": {
    }
}

List properties

List all properties present in a specific config revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

query Parameters
protocol
string (PropertyProtocol)
Enum: "MODBUS_SERIAL" "MODBUS_IP" "MBUS" "BACNET_IP" "LON_IP852" "LORAWAN_V1_0" "LPB" "KNX" "VIRTUAL" "BACNET_IP_GATEWAY" "MODBUS_IP_GATEWAY" "MQTT_GATEWAY" "PLUGIN_GATEWAY"

Filter the properties by their communication protocol

gatewayInterfaceId
string
equipmentId
string
enabledOnly
boolean

List only enabled properties

tag
string

Filter the results by a Tag key and/or a tag value. The filter has to be in the format tagName[:tagValue]. For example, to filter only by the existence of a tag (useful for markers), one can use ?tag=boiler to filter an equipment with the marker "boiler". To filter by a specific value of a tag use ?tag=season:summer.

Multiple filters can be used, by repeating the query as in ?tag=rooftop&tag=ahu&tag=backup:b:true. In the latter tag filter backup:b:true, the key is backup and value b:true (an example of a haystack-style boolean tagging).

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update properties in bulk

Update properties in bulk, return the updated properties

path Parameters
deviceId
required
string

The ID of the device

query Parameters
applyChangesToGateways
boolean

Whether or not to reflect name changes to redirected properties in gateways

Request Body schema: application/json
required
required
Array of objects (BulkUpdatePropertyItem)

Responses

Request samples

Content type
application/json
{
  • "update": [
    ]
}

Response samples

Content type
application/json
{
  • "updated": [
    ]
}

Update property

Update a specific property configuration in the draft config revision

path Parameters
deviceId
required
string

The ID of the device

propertyId
required
string

The ID of the property

query Parameters
applyChangesToGateways
boolean

Whether or not to reflect name changes to redirected properties in gateways

Request Body schema: application/json
required
equipmentId
string

The equipment this property is linked to. This is mutually exclusive with the gatewayInterfaceId. You should provide either of those.

gatewayInterfaceId
string

The id of the gateway interface this property is linked to. This is mutually exclusive with the equipmentId. You should provide either of those. NOTE: Not used for virtual properties.

name
string

The name of the property

slug
string^[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*$

A unique (per device) keyword used to query this property. The possible values are:

  • lower case letters ([a-z])
  • upper case letters ([A-Z])
  • numbers ([0-9])
  • dashes (minus sign) (-)
  • underscore (_)

If two properties have the same slug, the API will respond with a conflict 409 response. Moreover, the slug must not be in conflict with the propertyId.

The slug is used to request the property values via the api /v1/devices/{deviceId}/properties/{slug}. As this slug is user managed (i.e. can change if the user wants to), we also provide the api to query the property values using the id via /v1/devices/{deviceId}/properties/{propertyId}

disabled
boolean

If set to true, the property will not be sent to the box

redirectToProperties
Array of strings

Contains a list of propertyIds to which redirect incoming data. You can redirect data to any property, the only limit is that the receiving property is not of access type REMOTE_READ_ONLY. As a read property is not supposed be written to. See Property configuration for examples. NOTE: Not used for virtual properties.

description
string

A short description

timer
integer <int32> >= 1

The number of seconds between two polls of data. This is used by the device when reading data from an equipment NOTE: Not used for virtual properties, as virtual properties are computed each time a new value is emitted for the related properties.

accessType
string (PropertyAccessType)
Enum: "REMOTE_READ_ONLY" "REMOTE_WRITE_ONLY" "REMOTE_READ_WRITE" "LOCAL"

Defines how the property behaves:

  • REMOTE_READ_ONLY: the property is meant to read data and forward it to the Wattsense cloud
  • REMOTE_WRITE_ONLY: the property is meant to receive data (write) from the Wattsense cloud and write it to an equipment
  • REMOTE_READ_WRITE (technical preview): the property will read data and forward it to Wattsense cloud and also takes data from Wattsense cloud and write it to an equipment. For the moment, only modbus and bacnet protocols are accepted. This is an experimental feature.
  • LOCAL: the property does not send / receive any data (see redirectToProperty for more information).
    • For it to redirect data somewhere it has to be combined with redirectToProperties, in which case it will read data (given the timer) and send them to another property
    • For it to receive data from another property, it has to be listed in redirectToProperties of the source property.

See Property configuration for examples.

object (PropertyConfiguration)

The configuration of the property to read from or write to an equipment or a gateway interface

unit
string

The engineering unit of this property

object (ValueTransformation)

An operation to apply on the property value received through the API, Webhooks and MQTT, on read. The data is transformed only when the user read from the platform. The scaling is a slope-intercept formula a*x + b where x is the payload. This scaling is only applied for numeric payloads, and the result is always a Double.

object

Tags for this resource. Keys and Values have to be strings.

kind
string (PropertyValueKindType)
Enum: "NONE" "date" "date-time" "date-time-range" "free-form-date-time" "daily-schedule" "synco-exception-period" "weekly-schedule" "bacnet-schedule" "bacnet-calendar" "bacnet-exception-schedule"

Defines how the data is to be interpreted and encoded on the equipment.

kind Description
date a date in the format yyyy-MM-dd
date-time a date time in the format `yyyy-MM-ddTHH:mm:ss
free-form-date-time a json with all date time entries being optional
daily-schedule the definition of a schedule to apply for a single day
synco-exception-period a single synco exception (start - end period)
bacnet-schedule the definition of a Bacnet schedule for whole week

NOTES:

  • Only BACnet, RVL and Synco devices support this field
  • Only devices with software version >= 5.7.0 support this field
  • Not used for virtual properties.

Responses

Request samples

Content type
application/json
{
  • "equipmentId": "string",
  • "gatewayInterfaceId": "string",
  • "name": "string",
  • "slug": "string",
  • "disabled": true,
  • "redirectToProperties": [
    ],
  • "description": "string",
  • "timer": 1,
  • "accessType": "REMOTE_READ_ONLY",
  • "config": {
    },
  • "unit": "string",
  • "scaling": {
    },
  • "tags": {
    },
  • "kind": "NONE"
}

Response samples

Content type
application/json
{
  • "propertyId": "string",
  • "equipmentId": "string",
  • "gatewayInterfaceId": "string",
  • "redirectToProperties": [
    ],
  • "accessType": "REMOTE_READ_ONLY",
  • "disabled": true,
  • "name": "string",
  • "slug": "string",
  • "description": "string",
  • "timer": 1,
  • "config": {
    },
  • "scaling": {
    },
  • "unit": "string",
  • "kind": "NONE",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "tags": {
    }
}

Connector configuration

There are a specific set of physical connectors on a Wattsense box. Each has a specific set of compatible communication protocols and the possibility to have one or many networks linked to it. Serial connectors support at max one network, whereas IP connectors have no specified limit.

Connector ID Compatible Network protocols Type Required before use in network Configurable
rs485_1 MODBUS_SERIAL Serial Yes Yes
rs485_2 MODBUS_SERIAL Serial Yes Yes
mbus MBUS Serial Yes Yes (since embedded software version 2.6)
eth1 MODBUS_IP, BACNET_IP IP No Yes (since embedded software version 2.5)
eth2 MODBUS_IP, BACNET_IP IP No Yes (since embedded software version 2.5)

In case of IP, some protocols support being run on the same connectors, and others do not require a connector to be set
Equipment
Equipment
Network
(BACNET/IP)
Network<br>(BACNET/IP)
Property
Property
Property
Property
Property
Property
Equipment
Equipment
Connector
Connector
IP
IP
Network
(BACNET/IP)
Network<br>(BACNET/IP)
Equipment
Equipment
Property
Property
Network
(MODBUS IP)
Network<br>(MODBUS IP)
Equipment
Equipment
no connector
needed
no connector<br>needed

In the case of Serial, only one network can be run by connector

Equipment
Equipment
Network
(MODBUS SERIAL)
<div>Network<br></div>(MODBUS SERIAL)
Property
Property
Property
Property
Property
Property
Equipment
Equipment
Connector
Connector
SERIAL
SERIAL
Network
(BACNET/MSTP)
Network<br>(BACNET/MSTP)
Equipment
Equipment
Property
Property
Connector
Connector

Create IPv4 route

Create an IPv4 route

path Parameters
deviceId
required
string

The ID of the device

physicalConnector
required
string (IpPhysicalConnector)
Enum: "eth1" "eth2"

The physical connector is the network interface used for this gateway interface

Network Interface value Meaning
"eth1" left ethernet port
"eth2" right ethernet port
Request Body schema: application/json
required
destination
required
string
gateway
required
string non-empty
metric
required
integer <int32> >= 1000

Responses

Request samples

Content type
application/json
{
  • "destination": "string",
  • "gateway": "string",
  • "metric": 1000
}

Response samples

Content type
application/json
{
  • "config": {
    },
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Delete IPv4 route

Delete an IPv4 route

path Parameters
deviceId
required
string

The ID of the device

physicalConnector
required
string (IpPhysicalConnector)
Enum: "eth1" "eth2"

The physical connector is the network interface used for this gateway interface

Network Interface value Meaning
"eth1" left ethernet port
"eth2" right ethernet port
routeId
required
string

Responses

Response samples

Content type
application/json
{
  • "config": {
    },
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Get connector

Get a connector in a specific revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

physicalConnector
required
string

The name of the connector to get

Responses

Response samples

Content type
application/json
Example
{
  • "config": {
    },
  • "networks": [
    ],
  • "gatewayInterfaces": [
    ],
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "id": "string",
  • "type": "HTTP",
  • "name": "string",
  • "authentication": {
    },
  • "tags": {
    },
  • "errorCount": 0,
  • "status": "ACTIVE",
  • "lastError": {
    },
  • "baseUrl": "string",
  • "routes": {
    },
  • "secretKey": "string"
}

List connectors

List connectors in a specific revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update connector

Update a connector in the draft revision

path Parameters
deviceId
required
string

The ID of the device

physicalConnector
required
string

The name of the connector to get

Request Body schema: application/json
required
physicalConnector
required
string
baudrate
required
integer <int32> [ 1200 .. 115200 ]
Enum: "1200" "1800" "2400" "4800" "9600" "19200" "38400" "57600" "115200"

Bits per seconds

parity
required
string (RSParity)
Enum: "NO_PARITY" "EVEN" "ODD"

The parity

numberDataBits
required
integer <int32> [ 5 .. 8 ]

The number of data bits

numberStopBits
required
integer <int32> [ 1 .. 2 ]

The number of stop bits

Responses

Request samples

Content type
application/json
Example
{
  • "physicalConnector": "rs485_1",
  • "baudrate": "1200",
  • "parity": "NO_PARITY",
  • "numberDataBits": 5,
  • "numberStopBits": 1
}

Response samples

Content type
application/json
{
  • "config": {
    },
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Update IPv4 route

Update an IPv4 route

path Parameters
deviceId
required
string

The ID of the device

physicalConnector
required
string (IpPhysicalConnector)
Enum: "eth1" "eth2"

The physical connector is the network interface used for this gateway interface

Network Interface value Meaning
"eth1" left ethernet port
"eth2" right ethernet port
routeId
required
string
Request Body schema: application/json
required
destination
required
string
gateway
required
string non-empty
metric
required
integer <int32> >= 1000

Responses

Request samples

Content type
application/json
{
  • "destination": "string",
  • "gateway": "string",
  • "metric": 1000
}

Response samples

Content type
application/json
{
  • "config": {
    },
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Network configuration

After having configured the equipments and connectors. The user can link them using a Network. Some networks do not work unless the connector has been correctly configured.

Create network

Create a new network in the draft config revision

path Parameters
deviceId
required
string

ID of the device

query Parameters
validateOnly
boolean

If set to true, will only validate the configuration

Request Body schema: application/json
required
name
required
string non-empty

The network name

description
string

A short description

equipments
Array of strings

The list of equipments connected through this network

required
object (NetworkConfiguration)

The configuration for this network entry

interFrameDelay
integer <int64> [ 0 .. 1000000000 ]

The delay in micro seconds to wait after a frame is sent

responseTimeout
integer <int64> [ 100 .. 1000000000 ]

Request response timeout in micro seconds

retryNumber
integer <int32> [ 0 .. 1000000 ]
object

Tags associated with the network

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "equipments": [
    ],
  • "config": {
    },
  • "interFrameDelay": 1000000000,
  • "responseTimeout": 100,
  • "retryNumber": 1000000,
  • "tags": {
    }
}

Response samples

Content type
application/json
{
  • "networkId": "string",
  • "name": "string",
  • "description": "string",
  • "equipments": [
    ],
  • "config": {
    },
  • "interFrameDelay": 1000000000,
  • "responseTimeout": 100,
  • "retryNumber": 1000000,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "tags": {
    }
}

Delete network

Delete a network in the draft config revision

path Parameters
deviceId
required
string

The ID of the device

networkId
required
string

The ID of the network

Responses

Response samples

Content type
application/json
{
  • "networkId": "string",
  • "name": "string",
  • "description": "string",
  • "equipments": [
    ],
  • "config": {
    },
  • "interFrameDelay": 1000000000,
  • "responseTimeout": 100,
  • "retryNumber": 1000000,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "tags": {
    }
}

Get network

Get a specific network configuration from a specific config revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

networkId
required
string

The ID of the network

Responses

Response samples

Content type
application/json
{
  • "networkId": "string",
  • "name": "string",
  • "description": "string",
  • "equipments": [
    ],
  • "config": {
    },
  • "interFrameDelay": 1000000000,
  • "responseTimeout": 100,
  • "retryNumber": 1000000,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "tags": {
    }
}

List network

List all network configurations available in the network configuration management interface

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

query Parameters
equipmentId
string

Filter the networks by the equipmentId they're connected to

connector
string

Filter the networks by the connector they're connected to

protocol
string (EquipmentProtocol)
Enum: "MODBUS_SERIAL" "MODBUS_IP" "MBUS" "BACNET_IP" "LON_IP852" "LORAWAN_V1_0" "LPB" "KNX"

Filter the networks by their communication protocol

tag
string

Filter the results by a Tag key and/or a tag value. The filter has to be in the format tagName[:tagValue]. For example, to filter only by the existence of a tag (useful for markers), one can use ?tag=boiler to filter an equipment with the marker "boiler". To filter by a specific value of a tag use ?tag=season:summer.

Multiple filters can be used, by repeating the query as in ?tag=rooftop&tag=ahu&tag=backup:b:true. In the latter tag filter backup:b:true, the key is backup and value b:true (an example of a haystack-style boolean tagging).

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update network

Update a network in the draft config revision

path Parameters
deviceId
required
string

ID of the device

networkId
required
string

ID of the network

query Parameters
validateOnly
boolean

If set to true, will only validate the configuration

Request Body schema: application/json
required
name
string

The network name

description
string

A short description

equipments
Array of strings

The list of equipments connected through this network

object (NetworkConfiguration)

The configuration for this network entry

interFrameDelay
integer <int64> [ 0 .. 1000000000 ]

The delay in micro seconds to wait after a frame is sent

responseTimeout
integer <int64> [ 100 .. 1000000000 ]

Request response timeout in micro seconds

retryNumber
integer <int32> [ 0 .. 1000000 ]
object

Tags associated with the network

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "equipments": [
    ],
  • "config": {
    },
  • "interFrameDelay": 1000000000,
  • "responseTimeout": 100,
  • "retryNumber": 1000000,
  • "tags": {
    }
}

Response samples

Content type
application/json
{
  • "networkId": "string",
  • "name": "string",
  • "description": "string",
  • "equipments": [
    ],
  • "config": {
    },
  • "interFrameDelay": 1000000000,
  • "responseTimeout": 100,
  • "retryNumber": 1000000,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "tags": {
    }
}

Scheduler configuration

Create application period

Create an application period in the draft configuration

path Parameters
deviceId
required
string

The ID of the device

Request Body schema: application/json
required
required
object (ApplicationPeriodDate)
required
object (ApplicationPeriodDate)

Responses

Request samples

Content type
application/json
{
  • "start": {
    },
  • "end": {
    }
}

Response samples

Content type
application/json
{
  • "applicationPeriodId": "string",
  • "start": {
    },
  • "end": {
    }
}

Create exception

Create an exception in the draft revision

path Parameters
deviceId
required
string

The ID of the device

Request Body schema: application/json
required
name
required
string non-empty
required
Array of objects (StateTimeSpan)
required
object (PeriodDateInterval)
description
string

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "daily": [
    ],
  • "period": {
    },
  • "description": "string"
}

Response samples

Content type
application/json
{
  • "exceptionId": "string",
  • "name": "string",
  • "daily": [
    ],
  • "period": {
    },
  • "description": "string"
}

Create schedule

Create a schedule in the draft revision

path Parameters
deviceId
required
string

The ID of the device

Request Body schema: application/json
required
name
required
string non-empty
description
string
required
object (ScheduleConfig)
required
Array of objects (PropertyStateValue)
required
object

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "config": {
    },
  • "drivenProperties": [
    ],
  • "tags": {
    }
}

Response samples

Content type
application/json
{
  • "scheduleId": "string",
  • "name": "string",
  • "description": "string",
  • "config": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "disabled": true,
  • "tags": {
    },
  • "drivenProperties": [
    ]
}

Create state

Create a state in the draft revision

path Parameters
deviceId
required
string

The ID of the device

Request Body schema: application/json
required
name
required
string non-empty
color
required
string non-empty

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "color": "string"
}

Response samples

Content type
application/json
{
  • "stateId": "string",
  • "name": "string",
  • "color": "string"
}

Delete exception

Delete an exception in the draft revision

path Parameters
deviceId
required
string

The ID of the device

exceptionId
required
string

Responses

Delete schedule

Delete a schedule in the draft revision

path Parameters
deviceId
required
string

The ID of the device

scheduleId
required
string

Responses

Delete state

Delete a state in the draft revision

path Parameters
deviceId
required
string

The ID of the device

stateId
required
string

Responses

Get exception

Get an exception for a specific revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

exceptionId
required
string

Responses

Response samples

Content type
application/json
{
  • "exceptionId": "string",
  • "name": "string",
  • "daily": [
    ],
  • "period": {
    },
  • "description": "string"
}

Get schedule

Get a schedule for a specific revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

scheduleId
required
string

Responses

Response samples

Content type
application/json
{
  • "scheduleId": "string",
  • "name": "string",
  • "description": "string",
  • "config": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "disabled": true,
  • "tags": {
    },
  • "drivenProperties": [
    ]
}

Get scheduler

Get the scheduler for a specific revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

Responses

Response samples

Content type
application/json
{
  • "schedules": [
    ],
  • "states": [
    ],
  • "applicationPeriods": [
    ],
  • "exceptions": [
    ]
}

Get state

Get a state for a specific revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

stateId
required
string

Responses

Response samples

Content type
application/json
{
  • "stateId": "string",
  • "name": "string",
  • "color": "string"
}

List application periods

List application periods in a specific revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List exceptions

List the exceptions for a specific revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

query Parameters
tag
string

Filter the results by a Tag key and/or a tag value. The filter has to be in the format tagName[:tagValue]. For example, to filter only by the existence of a tag (useful for markers), one can use ?tag=boiler to filter an equipment with the marker "boiler". To filter by a specific value of a tag use ?tag=season:summer.

Multiple filters can be used, by repeating the query as in ?tag=rooftop&tag=ahu&tag=backup:b:true. In the latter tag filter backup:b:true, the key is backup and value b:true (an example of a haystack-style boolean tagging).

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List schedules

List the schedules for a specific revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

query Parameters
tag
string

Filter the results by a Tag key and/or a tag value. The filter has to be in the format tagName[:tagValue]. For example, to filter only by the existence of a tag (useful for markers), one can use ?tag=boiler to filter an equipment with the marker "boiler". To filter by a specific value of a tag use ?tag=season:summer.

Multiple filters can be used, by repeating the query as in ?tag=rooftop&tag=ahu&tag=backup:b:true. In the latter tag filter backup:b:true, the key is backup and value b:true (an example of a haystack-style boolean tagging).

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List states

List the states for a specific revision

path Parameters
deviceId
required
string

The ID of the device

revisionId
required
string
Default: "current"

The revision id of the configuration to get. Two special cases:

  • current will return the currently published config revision, i.e. status equal to CURRENT
  • draft will return the current draft i.e. status equal to DRAFT or SENT

Note

Between the publish action and the acknowledgment. The draft revision will switch its status to SENT. While in that status, the revision will still be called "draft", but no update will be authorized. Therefore, trying to create a new draft will result in a conflict until the status changes to either CURRENT or ERROR.

query Parameters
tag
string

Filter the results by a Tag key and/or a tag value. The filter has to be in the format tagName[:tagValue]. For example, to filter only by the existence of a tag (useful for markers), one can use ?tag=boiler to filter an equipment with the marker "boiler". To filter by a specific value of a tag use ?tag=season:summer.

Multiple filters can be used, by repeating the query as in ?tag=rooftop&tag=ahu&tag=backup:b:true. In the latter tag filter backup:b:true, the key is backup and value b:true (an example of a haystack-style boolean tagging).

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update exception

Update an exception in the draft revision

path Parameters
deviceId
required
string

The ID of the device

exceptionId
required
string
Request Body schema: application/json
required
name
string non-empty
Array of objects (StateTimeSpan)
object (PeriodDateInterval)
description
string

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "daily": [
    ],
  • "period": {
    },
  • "description": "string"
}

Response samples

Content type
application/json
{
  • "exceptionId": "string",
  • "name": "string",
  • "daily": [
    ],
  • "period": {
    },
  • "description": "string"
}

Update schedule

Update a schedule in the draft revision

path Parameters
deviceId
required
string

The ID of the device

scheduleId
required
string
Request Body schema: application/json
required
name
string
description
string
object (ScheduleConfig)
Array of objects (PropertyStateValue)
object
disabled
boolean

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "config": {
    },
  • "drivenProperties": [
    ],
  • "tags": {
    },
  • "disabled": true
}

Response samples

Content type
application/json
{
  • "scheduleId": "string",
  • "name": "string",
  • "description": "string",
  • "config": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "disabled": true,
  • "tags": {
    },
  • "drivenProperties": [
    ]
}

Update state

Update a state in the draft revision

path Parameters
deviceId
required
string

The ID of the device

stateId
required
string
Request Body schema: application/json
required
name
string non-empty
color
string non-empty

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "color": "string"
}

Response samples

Content type
application/json
{
  • "stateId": "string",
  • "name": "string",
  • "color": "string"
}

Update time zone

Update the time zone in the draft configuration

path Parameters
deviceId
required
string

The ID of the device

Request Body schema: application/json
required
timeZone
required
string non-empty

Responses

Request samples

Content type
application/json
{
  • "timeZone": "string"
}

File resources management

Create file resource

Create a file resource

query Parameters
fileResourceType
required
string (FileResourceType)
Enum: "MQTT_CLIENT_CERTIFICATE" "MQTT_PRIVATE_KEY" "MQTT_CA_CERTIFICATE" "PLUGIN"

The type of resource he's creating

level
required
string (FileResourceVisibilityLevel)
Enum: "DEVICE" "ORGANIZATION"

The visibility of the resource

name
required
string

The name of the file resource

description
string

A short description of this resource

organizationId
string <uuid>

The ID of organization this resource will be visible to

deviceId
string

The ID of device unit this resource will be visible to

packageName
string

A globally unique slug for the resource

requiredOptions
Array of strings (RatePlanOption) unique
Items Enum: "HEATING_OPTIMISER" "MINI_BMS" "HOURLY_BASED_COMPUTATION" "FREE_LORAWAN_DL"

License options this resource will be visible to

Request Body schema: application/json
file
required
string <binary>

The content of the file to be uploaded. Has to be MultipartFile.

Responses

Request samples

Content type
application/json
{
  • "file": "string"
}

Response samples

Content type
application/json
{
  • "versionId": "string",
  • "fileResourceId": "string",
  • "fileResourceType": "MQTT_CLIENT_CERTIFICATE",
  • "packageName": "moving-average",
  • "visibility": {
    },
  • "sequenceNumber": 0,
  • "default": true,
  • "name": "string",
  • "description": "string",
  • "tags": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

Create new file resource version

Create a new file resource version. This will keep the same visibility level as the default file resource.

path Parameters
fileResourceId
required
string

The ID of the file resource to create a version for

query Parameters
versionId
string

The version id of this resource

name
string

The name of the file resource

description
string

A short description of this resource

default
boolean

Whether this version will be set as default

Request Body schema: application/json
file
required
string <binary>

The content of the file to be uploaded

Responses

Request samples

Content type
application/json
{
  • "file": "string"
}

Response samples

Content type
application/json
{
  • "versionId": "string",
  • "fileResourceId": "string",
  • "fileResourceType": "MQTT_CLIENT_CERTIFICATE",
  • "packageName": "moving-average",
  • "visibility": {
    },
  • "sequenceNumber": 0,
  • "default": true,
  • "name": "string",
  • "description": "string",
  • "tags": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

Delete file resource

Delete the file resource

path Parameters
fileResourceId
required
string

The ID of the file resource to delete

Responses

Response samples

Content type
application/json
{
  • "versionId": "string",
  • "fileResourceId": "string",
  • "fileResourceType": "MQTT_CLIENT_CERTIFICATE",
  • "packageName": "moving-average",
  • "visibility": {
    },
  • "sequenceNumber": 0,
  • "default": true,
  • "name": "string",
  • "description": "string",
  • "tags": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

Delete file resource version

Removes a specific version of a file resource. If this version is the default one, will mark the previous non-deleted resource as default.

path Parameters
fileResourceId
required
string

The ID of the file resource to delete the version for

versionId
required
string

The ID of the version to delete

Responses

Response samples

Content type
application/json
{
  • "versionId": "string",
  • "fileResourceId": "string",
  • "fileResourceType": "MQTT_CLIENT_CERTIFICATE",
  • "packageName": "moving-average",
  • "visibility": {
    },
  • "sequenceNumber": 0,
  • "default": true,
  • "name": "string",
  • "description": "string",
  • "tags": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

Get default file resource version

Get the default version of the file resource

path Parameters
fileResourceId
required
string

The ID of the file resource

Responses

Response samples

Content type
application/json
{
  • "versionId": "string",
  • "fileResourceId": "string",
  • "fileResourceType": "MQTT_CLIENT_CERTIFICATE",
  • "packageName": "moving-average",
  • "visibility": {
    },
  • "sequenceNumber": 0,
  • "default": true,
  • "name": "string",
  • "description": "string",
  • "tags": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

Get file resource version

Get a specific version of the file resource. If the versionId is "default", this will return the default version

path Parameters
fileResourceId
required
string

The ID of the file resource to get the version for

versionId
required
string

The ID of the version to get. If set to "default", will target the default version.

Responses

Response samples

Content type
application/json
{
  • "versionId": "string",
  • "fileResourceId": "string",
  • "fileResourceType": "MQTT_CLIENT_CERTIFICATE",
  • "packageName": "moving-average",
  • "visibility": {
    },
  • "sequenceNumber": 0,
  • "default": true,
  • "name": "string",
  • "description": "string",
  • "tags": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

List configs using a file resource

List all configs using this file resource. This lists only the the configs with status CURRENT, DRAFT and SENT.

path Parameters
fileResourceId
required
string

The ID of the file resource to list configs for

query Parameters
versionId
string

The ID of the version to list configs for

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List file resource versions

List all the versions of a file resource, sorted by sequenceNumber.

path Parameters
fileResourceId
required
string

The ID of the file resource to list versions for

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List file resources

List all the file resources one has access to

query Parameters
organizationId
string <uuid>
resourceType
string (FileResourceType)
Enum: "MQTT_CLIENT_CERTIFICATE" "MQTT_PRIVATE_KEY" "MQTT_CA_CERTIFICATE" "PLUGIN"

The type of resource. This determines the maximum visibility level (see visibility).

  • MQTT_CLIENT_CERTIFICATE: can be shared at DEVICE level only
  • MQTT_PRIVATE_KEY: can be shared at DEVICE level only
  • MQTT_CA_CERTIFICATE: can be shared up to ORGANIZATION level
  • PLUGIN: can be shared up to ORGANIZATION level
  • PLUGIN_CONFIG: can be shared up to ORGANIZATION level

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update file resource Version

Update metadata of a file resource version, or mark a version as the default one

path Parameters
fileResourceId
required
string

The ID of the file resource to update the version for

versionId
required
string

The ID of the version to update

Request Body schema: application/json
required
name
string non-empty

The new name

description
string

The new description

object

Tags for this resource

default
boolean

Mark this version as default

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "tags": {
    },
  • "default": true
}

Response samples

Content type
application/json
{
  • "versionId": "string",
  • "fileResourceId": "string",
  • "fileResourceType": "MQTT_CLIENT_CERTIFICATE",
  • "packageName": "moving-average",
  • "visibility": {
    },
  • "sequenceNumber": 0,
  • "default": true,
  • "name": "string",
  • "description": "string",
  • "tags": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "createdBy": "string",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "updatedBy": "string"
}

BACnet constants

Get a specific BACnet object

Return a specific BACnet object and all its corresponding properties

path Parameters
objectType
required
integer <int64>

The type of the object to get

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "identifier": 0,
  • "properties": [
    ]
}

List the BACnet data types

Return all available data types in BACnet, by default it returns only the supported ones

query Parameters
supportedOnly
boolean

Whether to filter by only the supported data types or not

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List the BACnet Engineering units

Return all available engineering units and their IDs

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List the BACnet objects

Return all available objects and their corresponding properties in BACnet

Responses

Response samples

Content type
application/json
[
  • {
    }
]

LON constants

Get a specific LON SNVT type

Get a specific SNVT type from LON including all the supported subfields

path Parameters
index
required
integer <int32>

The SNVT index to query

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List the LON SNVT types

Return all available SNVT types in LON, by default it returns only the supported ones

query Parameters
supportedOnly
boolean

Whether to filter by only the supported data types or not

Responses

Response samples

Content type
application/json
[
  • {
    }
]