---
updatedAt: 2025-09-17T00:08:26.000Z
agentTools:
  projectIndex: https://docs.api.everactive.com/llms.txt
---

# MQTT Subscription

# Everactive Edge MQTT Subscriptions 1.0.0 documentation

The Everactive Edge IoT Platform allows you to create MQTT subscriptions to publish the data to an MQTT broker. The connection will use the client id provided when the subscription is created or one will be assigned using the "everactive-`{random UUID}`" string.

The messages are published with the QoS defined in the subscription request (either 0 or 1). The destination topic names are assembled following this convention:

```
{prefix}/{projectid}/sensor_reading/{schema}/{version}/reading/{mac}
```

Example:

```
my/tree/fdbc6d04-dba4-48cf-9b8e-fc4bbb38e001/sensor_reading/temperature-humidity/v1/reading/bc:5e:a1:00:00:00:2a:f1
```

**Strict Topics**

Some services, like Azure IoT Hub, have a more restrictive topic model for receiving messages. For cases like this one, if the topic prefix begins with `strict:` the messages will be published to that specific topic path plus the mac address of the sensor.

Example:

For a prefix

```
strict:devices/eversensor-data-01/messages/events
```

Messages are published to

```
devices/eversensor-data-01/messages/events/`{mac address}`
```

##### Specification tags

| Name            | Description | Documentation |
| --------------- | ----------- | ------------- |
| Sensor Readings | -           | -             |

## Table of Contents

* [Servers](#servers)
  * [customer](#customer-server)
* [Operations](#operations)
  * [PUB \[prefix/\]`{projectid}`/sensor\_reading/`{schema}`/`{version}`/reading/`{mac}`](#pub-prefixprojectidsensor_readingschemaversionreadingmac-operation)

## Servers

### `customer` Server

* URL: `mqtt://target.mqtt.server.com:8883`
* Protocol: `mqtt`

The customer specific MQTT broker to receive the sensor data.

## Operations

### PUB `[prefix/]{projectid}/sensor_reading/{schema}/{version}/reading/{mac}` Operation

*The MQTT subscription publishes to this topic when new sensor data arrives.*

* Operation ID: `onSensorData`

##### Operation tags

| Name            | Description | Documentation |
| --------------- | ----------- | ------------- |
| Sensor Readings | -           | -             |

#### Parameters

| Name      | Type   | Description                                                                     | Value                                                         | Constraints | Notes        |
| --------- | ------ | ------------------------------------------------------------------------------- | ------------------------------------------------------------- | ----------- | ------------ |
| prefix    | string | Optional topic segment defined by the user.                                     | allowed (`"mqtt topic"`, `null`), examples (`"my/topic"`)     | -           | **required** |
| projectid | string | UUID of the Everactive Edge Platform project                                    | examples (`"fdbc6d04-dba4-48cf-9b8e-fc4bbb38e001"`)           | -           | **required** |
| schema    | string | Designates the type of message eg. temperature-humidity or vibration-electrical | examples (`"temperature-humidity"`, `"vibration-electrical"`) | -           | **required** |
| version   | string | Schema version                                                                  | examples (`"v1"`)                                             | -           | **required** |
| mac       | string | Sensor MAC address                                                              | examples (`"bc:5e:a1:00:00:00:2a:f1"`)                        | -           | **required** |

#### `mqtt` Operation specific information

| Name         | Type | Description | Value                                | Constraints | Notes |
| ------------ | ---- | ----------- | ------------------------------------ | ----------- | ----- |
| cleanSession | -    | -           | `"true"`                             | -           | -     |
| clientId     | -    | -           | `"{clientid_prefix}\|{random UUID}"` | -           | -     |
| qos          | -    | -           | `"0 or 1"`                           | -           | -     |
| retain       | -    | -           | `"false"`                            | -           | -     |

#### Message `sensor_reading`

*Refer to <https://docs.api.everactive.com/reference/eversensors-overview#sensor-readings-data-schema>*

* Content type: [application/json](https://www.iana.org/assignments/media-types/application/json)

A sensor reading message in Json format