> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.kodelabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# KODE MQTT

> Connect KODE MQTT to KODE OS for other data

> Connect KODE MQTT to KODE OS for other data integration

## Overview

Use this integration to publish and subscribe to MQTT topics through KODE OS. You discover mapped devices, collect delta sensor streams, and use schedules and actions where your broker and topic layout allow.

| Property            | Value     |
| ------------------- | --------- |
| **System Type**     | Other     |
| **Communication**   | MQTT      |
| **Collection**      | Pull      |
| **Collection Mode** | DELTA     |
| **Schedules**       | Supported |
| **Actions**         | Supported |

## Supported Capabilities

* Discover Devices & Points
* Collect Sensor Data
* Discover Schedules
* Create Schedules
* Update Schedules
* Delete Schedules

## Prerequisites

* Access to the MQTT broker used by KODE MQTT
* Broker hostname, port, and credentials
* KODE OS environment with access to Data Sources

## Generate API Credentials

1. Log in to the KODE MQTT platform or admin console
2. Navigate to the API settings, developer section, or account settings
3. Generate a new API key or token
4. Copy the key and store it securely -- you will need it when configuring the connector in KODE OS

## Configure Connector in KODE OS

1. Navigate to **Data Sources** in your building
2. Click **API Catalog** and search for **KODE MQTT**
3. Click **+ Add Datasource**
4. Fill in the fields below and complete the three-page setup flow

| Field                            | Required    | Type     | Description                                             |
| -------------------------------- | ----------- | -------- | ------------------------------------------------------- |
| **URL**                          | Yes         | text     | The base URL or IP address of the external system       |
| **API Key**                      | Yes         | password | The API key for authenticating with the external system |
| **Metadata Topic**               | Yes         | text     | The MQTT topic for device metadata                      |
| **Telemetry Topic**              | Yes         | text     | The MQTT topic for telemetry data                       |
| **Command Topic**                | Yes         | text     | The MQTT topic for sending commands to devices          |
| **Schedule Configuration Topic** | No          | text     | The MQTT topic for schedule configuration messages      |
| **Schedule State Topic**         | Conditional | text     | The MQTT topic for schedule state messages              |
| **Schedule Command Topic**       | Conditional | text     | The MQTT topic for schedule command messages            |
| **Response Command Topic**       | Conditional | text     | The MQTT topic for command response messages            |

## Discover Devices and Points

After configuring the connector, click **Discover** on the connector detail page. KODE OS will query the KODE MQTT system and return a list of available devices and their data points.

Review the discovered items and select the devices you want to register in KODE OS.

For more details on the discovery process, see the [Discovery guide](/products/integrations/capabilities/discovery).

## What Data You Get

### Point History

Time-series sensor readings such as temperature, humidity, CO2, occupancy counts, energy consumption, light levels, and other measurable values from physical sensors

### Schedule Sync

Schedule state synchronization data between KODE OS and the external system's controller schedules

### Schedule Sync (Partial)

Partial schedule synchronization for incremental schedule updates

### Polling Schedule

* **Point History** -- Default polling: 30 seconds (min: 30 seconds, max: 10 minutes)

For more details on collection modes, see the [Data Collection guide](/products/integrations/capabilities/data-collection).

## Available Actions

This integration supports actions that allow you to send commands to the KODE MQTT system. Available actions are displayed on the device or entity detail page in KODE OS.

#### Example Request

```json theme={null}
{
  "action": "ActionName",
  "target": "entity-or-device-id",
  "parameters": {}
}
```

#### Expected Result

* KODE OS sends the action to the external API using the configured connector credentials
* The external system returns success (typically HTTP 2xx) and processes the requested operation

For more details on how actions work, see the [Actions guide](/products/integrations/capabilities/actions).

## Schedule Management

This integration supports discovering and managing schedules in the KODE MQTT system. You can discover existing schedules, create new ones, and sync schedule states between KODE OS and the external system.

For more details, see the [Schedules guide](/products/integrations/capabilities/schedules).

## Use Cases

Once connected, this integration enables you to:

* Centralize KODE MQTT data in your building operations dashboard
* Correlate data from this system with other building systems for comprehensive analytics

## Troubleshooting

<AccordionGroup>
  <Accordion title="No data arriving from MQTT broker">
    Verify the MQTT broker hostname, port, and credentials. Check that the topic patterns match the topics being published by the KODE MQTT devices. Ensure the MQTT client has subscribe permissions.
  </Accordion>

  <Accordion title="Discovery returns no devices">
    Verify the connector credentials have sufficient permissions in the KODE MQTT system to list devices. Run a test connection first to confirm connectivity. Some systems require specific API scopes or roles for device enumeration.
  </Accordion>

  <Accordion title="Data collection stops or gaps appear">
    Check the connector status on the Data Sources page. If the status shows an error, review the error logs on the connector detail page. Common causes include expired credentials, network changes, or rate limiting by the KODE MQTT API.
  </Accordion>
</AccordionGroup>
