# ThingSpeak

> Read sensor feeds and status messages, write measurements, and watch for new ThingSpeak entries.

App · 9 actions. Web page: https://docs.lodol.com/docs/integrations/thingspeak

## Actions

### Get age of latest entry

Get age of latest entry.

**Inputs**: None.

**Outputs**

- `data` (object): The response from ThingSpeak.

**Example output**

```json
{
  "data": {
    "last_data_age": "example",
    "last_data_age_units": "example"
  }
}
```

### Get age of latest field entry

Get age of latest field entry.

**Inputs**

- Field number (`field_number`, text, required): Channel field to read. One of: `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`.

**Outputs**

- `data` (object): The response from ThingSpeak.

**Example output**

```json
{
  "data": {
    "last_data_age": "example",
    "last_data_age_units": "example"
  }
}
```

### Get latest channel entry

Get latest channel entry.

**Inputs**: None.

**Outputs**

- `data` (object): The response from ThingSpeak.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "entry_id": 1,
    "field1": "example",
    "field2": "example",
    "field3": "example",
    "field4": "example",
    "field5": "example",
    "field6": "example",
    "field7": "example",
    "field8": "example",
    "status": "example"
  }
}
```

### Get latest channel field entry

Get latest channel field entry.

**Inputs**

- Field number (`field_number`, text, required): Channel field to read. One of: `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`.

**Outputs**

- `data` (object): The response from ThingSpeak.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "entry_id": 1,
    "field1": "example",
    "field2": "example",
    "field3": "example",
    "field4": "example",
    "field5": "example",
    "field6": "example",
    "field7": "example",
    "field8": "example",
    "status": "example"
  }
}
```

### Get latest channel status

Get latest channel status.

**Inputs**: None.

**Outputs**

- `data` (object): The response from ThingSpeak.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "entry_id": 1,
    "field1": "example",
    "field2": "example",
    "field3": "example",
    "field4": "example",
    "field5": "example",
    "field6": "example",
    "field7": "example",
    "field8": "example",
    "status": "example"
  }
}
```

### List channel feed entries

List channel feed entries.

**Inputs**

- Results (`results`, number): Number of recent entries to return. From 1 to 8000.
- Start time (`start_time`, date and time): Only entries added on or after this UTC time.
- End time (`end_time`, date and time): Only entries added on or before this UTC time.

**Outputs**

- `data` (object): The response from ThingSpeak.

**Example output**

```json
{
  "data": {
    "channel": {
      "created_at": "example",
      "description": "example",
      "id": 1,
      "last_entry_id": 1,
      "name": "example",
      "updated_at": "example"
    },
    "feeds": [
      {
        "created_at": "example",
        "entry_id": 1,
        "field1": "example",
        "field2": "example",
        "field3": "example",
        "field4": "example",
        "field5": "example",
        "field6": "example",
        "field7": "example",
        "field8": "example",
        "status": "example"
      }
    ]
  }
}
```

### List channel field entries

List channel field entries.

**Inputs**

- Field number (`field_number`, text, required): Channel field to read. One of: `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`.
- Results (`results`, number): Number of recent entries to return. From 1 to 8000.
- Start time (`start_time`, date and time): Only entries added on or after this UTC time.
- End time (`end_time`, date and time): Only entries added on or before this UTC time.

**Outputs**

- `data` (object): The response from ThingSpeak.

**Example output**

```json
{
  "data": {
    "channel": {
      "created_at": "example",
      "description": "example",
      "id": 1,
      "last_entry_id": 1,
      "name": "example",
      "updated_at": "example"
    },
    "feeds": [
      {
        "created_at": "example",
        "entry_id": 1,
        "field1": "example",
        "field2": "example",
        "field3": "example",
        "field4": "example",
        "field5": "example",
        "field6": "example",
        "field7": "example",
        "field8": "example",
        "status": "example"
      }
    ]
  }
}
```

### List channel status messages

List channel status messages.

**Inputs**

- Results (`results`, number): Number of recent entries to return. From 1 to 8000.
- Start time (`start_time`, date and time): Only entries added on or after this UTC time.
- End time (`end_time`, date and time): Only entries added on or before this UTC time.

**Outputs**

- `data` (object): The response from ThingSpeak.

**Example output**

```json
{
  "data": {
    "channel": {
      "created_at": "example",
      "description": "example",
      "id": 1,
      "last_entry_id": 1,
      "name": "example",
      "updated_at": "example"
    },
    "feeds": [
      {
        "created_at": "example",
        "entry_id": 1,
        "field1": "example",
        "field2": "example",
        "field3": "example",
        "field4": "example",
        "field5": "example",
        "field6": "example",
        "field7": "example",
        "field8": "example",
        "status": "example"
      }
    ]
  }
}
```

### Write channel entry

Write channel entry.

**Inputs**

- Field1 (`field1`, text): Value to store in channel field 1.
- Field2 (`field2`, text): Value to store in channel field 2.
- Field3 (`field3`, text): Value to store in channel field 3.
- Field4 (`field4`, text): Value to store in channel field 4.
- Field5 (`field5`, text): Value to store in channel field 5.
- Field6 (`field6`, text): Value to store in channel field 6.
- Field7 (`field7`, text): Value to store in channel field 7.
- Field8 (`field8`, text): Value to store in channel field 8.
- Status (`status`, text): Status message to attach to the entry.
- Created at (`created_at`, date and time): Measurement time. Leave empty to use the current time.

**Outputs**

- `data` (object): The response from ThingSpeak.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "entry_id": 1,
    "field1": "example",
    "field2": "example",
    "field3": "example",
    "field4": "example",
    "field5": "example",
    "field6": "example",
    "field7": "example",
    "field8": "example",
    "status": "example"
  }
}
```
