> ## 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.

# Structure Monitoring System

> Connect Structure Monitoring System to KODE OS for leak detection data

> Connect Structure Monitoring System to KODE OS for leak detection data integration

## Overview

Use this integration to connect Structure Monitoring System leak detection to KODE OS. You discover assets, collect sensor readings, and ingest related records over REST with historical collection.

| Property            | Value          |
| ------------------- | -------------- |
| **System Type**     | Leak Detection |
| **Communication**   | REST           |
| **Collection**      | Pull           |
| **Collection Mode** | HISTORICAL     |

## Supported Capabilities

* Discover Devices & Points
* Collect Sensor Data
* Collect Non-Sensor Data

## Prerequisites

* An active account with Structure Monitoring System and access to their API or developer portal
* Username and password credentials for the Structure Monitoring System
* KODE OS environment with access to Data Sources

## Configure Connector in KODE OS

1. Navigate to **Data Sources** in your building
2. Click **API Catalog** and search for **Structure Monitoring System**
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 Building ID** | Yes      | text     | The building or source identifier in the external system |
| **Username**        | Yes      | text     | The username for authenticating with the external system |
| **Password**        | Yes      | password | The password for authenticating with the external system |

## Discover Devices and Points

After configuring the connector, click **Discover** on the connector detail page. KODE OS will query the Structure Monitoring 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).

## Devices and Points

When you discover devices from Structure Monitoring System, KODE OS maps them to the following device types and data points:

### Leak Sensor

Canonical Type: `default`

| # | Point      | Description                                                    | Unit       | Writable | Ontology Field         | Collection |
| - | ---------- | -------------------------------------------------------------- | ---------- | -------- | ---------------------- | ---------- |
| 1 | `Moisture` | Humidity reading (%)                                           | %          | No       | `soil_humidity_sensor` | Polling    |
| 2 | `Voltage`  | Voltage reading (microVolts)                                   | microVolts | No       | --                     | Polling    |
| 3 | `alarm`    | **True** -- alarm is active / **False** -- alarm is not active | --         | No       | --                     | Polling    |

## What Data You Get

### Point History

Time-series readings including Moisture, Voltage, alarm, collected at regular intervals from connected devices

### Alarms

Alert and fault notifications including alarm name, priority, status, timestamps, device association, and acknowledgment state

KODE OS maps Structure Monitoring System data to these standard fields:

| KODE Field       | Source Field                            | Notes |
| ---------------- | --------------------------------------- | ----- |
| **id**           | `sensorID + String.valueOf(collectTime` | --    |
| **name**         | `alarmName`                             | --    |
| **description**  | `(formatted)`                           | --    |
| **priority**     | `alarmColor`                            | --    |
| **status**       | `input`                                 | --    |
| **deviceId**     | `sensorID`                              | --    |
| **deviceName**   | `sensorName`                            | --    |
| **createdAt**    | `collectTime`                           | --    |
| **customFields** | `getCustomField(`                       | --    |

### Polling Schedule

* **Point History** -- Default polling: 425 seconds (min: 425 seconds, max: 1 hours)

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

## Use Cases

Once connected, this integration enables you to:

* Receive real-time alerts when water leaks or abnormal flow is detected
* Track leak event history and response times for compliance reporting
* Correlate water consumption data with leak detection sensors

## Troubleshooting

<AccordionGroup>
  <Accordion title="Authentication or connection error">
    Verify that the credentials are correct and have not expired. Check that the URL is reachable from the KODE OS environment. Verify the username and password are correct and the account has not been locked in the Structure Monitoring System.
  </Accordion>

  <Accordion title="Discovery returns no devices">
    Verify the connector credentials have sufficient permissions in the Structure Monitoring 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 Structure Monitoring System API.
  </Accordion>
</AccordionGroup>
