Retrieving readings

By entityID:

GET ${THINGOO_INSTANCE}/api/entities/{entityId}/readings

By entityKey and deviceKey:

GET ${THINGOO_INSTANCE}/api/readings/?device_key=deviceKey&entity_key=entityKey

Example response:

[
    {
        "id": 1,
        "value": "25.0",
        "timestamp": "2021-02-26T22:42:47.151571"
    },
    {
        "id": 2,
        "value": "25.0",
        "timestamp": "2021-02-28T21:14:39.84793"
    },
    {
        "id": 3,
        "value": "25.1",
        "timestamp": "2021-03-01T22:58:31.085412"
    }
]

Adding new reading

1. HTTP (deprecated)

POST ${THINGOO_INSTANCE}/api/readings

Request body (example):

{
    "deviceKey": "deviceKey",
    "entityKey": "entityKey",
    "value": "24.1"
}

2. MQTT (recommended)

MQTT

To add a new reading, send an MQTT message (QoS 1 if possible, QoS 0 otherwise) to the reading topic

/devices/${deviceKey}/entities/${*entityKey*}/reading
${deviceKey} <- variable
${*entityKey*} <- variable

with the reading's value as plain text.

Example:

24.1