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

# Safeline

> Connect Safeline to KODE OS for elevator system data

> Connect Safeline to KODE OS for elevator system data integration

## Overview

Use this integration to stream Safeline elevator telemetry into KODE OS via webhooks. Push delivery keeps snapshot status and event data current without polling.

| Property            | Value           |
| ------------------- | --------------- |
| **System Type**     | Elevator System |
| **Communication**   | REST + Webhook  |
| **Collection**      | Push            |
| **Collection Mode** | SNAPSHOT        |

## Supported Capabilities

* Collect Sensor Data
* Receive Webhook Data

## Prerequisites

* An active account with Safeline and access to their API or developer portal
* KODE OS environment with access to Data Sources

## Configure Webhook

This integration uses webhooks for real-time data delivery. After creating the connector in KODE OS:

1. Copy the webhook URL provided on the connector detail page
2. In the Safeline platform, navigate to the webhook or notification settings
3. Add a new webhook endpoint using the KODE OS URL
4. Configure the authentication header as specified on the connector detail page
5. Save and enable the webhook

## Configure Connector in KODE OS

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

| Field               | Required | Type | Description                                              |
| ------------------- | -------- | ---- | -------------------------------------------------------- |
| **API Building ID** | Yes      | text | The building or source identifier in the external system |

## Devices and Points

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

### Elevator

Canonical Type: `default`

| # | Point              | Description                        | Unit | Writable | Collection |
| - | ------------------ | ---------------------------------- | ---- | -------- | ---------- |
| 1 | `velocity`         | Current travel velocity            | --   | No       | Webhook    |
| 2 | `currentFloor`     | Floor the elevator is currently on | --   | No       | Webhook    |
| 3 | `state`            | Current operating state            | --   | No       | Webhook    |
| 4 | `connectionStatus` | Device connectivity status         | --   | No       | Webhook    |

## What Data You Get

### Point History

Time-series readings including velocity, currentFloor, state, connectionStatus, 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 Safeline data to these standard fields:

| KODE Field       | Source Field                                                                                            | Notes       |
| ---------------- | ------------------------------------------------------------------------------------------------------- | ----------- |
| **name**         | `alarmName`                                                                                             | --          |
| **description**  | `SafelineConstants.EVENT_TYPE_DEVICE_ALARM_STATE`                                                       | --          |
| **id**           | `alarm.correlationId`                                                                                   | transformed |
| **status**       | `alarm.state`                                                                                           | transformed |
| **location**     | `site.name`                                                                                             | transformed |
| **deviceId**     | `device.id`                                                                                             | transformed |
| **deviceName**   | `device.serialNumber`                                                                                   | transformed |
| **createdAt**    | `DateUtils.getCollectTimeFromBuildingTz( Utils.getSafe(alarm, safelineAlarm -> safelineAlarm.timestamp` | transformed |
| **customFields** | `(custom fields)`                                                                                       | --          |
| **name**         | `alarmName`                                                                                             | --          |
| **description**  | `SafelineConstants.EVENT_TYPE_FACILITY_ALARM_STATE`                                                     | --          |
| **id**           | `alarm.correlationId`                                                                                   | transformed |
| **status**       | `alarm.state`                                                                                           | transformed |
| **location**     | `site.name`                                                                                             | transformed |
| **deviceId**     | `facility.id`                                                                                           | transformed |
| **deviceName**   | `facility.name`                                                                                         | transformed |
| **createdAt**    | `DateUtils.getCollectTimeFromBuildingTz( Utils.getSafe(alarm, safelineAlarm -> safelineAlarm.timestamp` | transformed |
| **customFields** | `(custom fields)`                                                                                       | --          |

### Polling Schedule

* **Point History**
* **Alarm**

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:

* Monitor elevator call counts, wait times, and operational status
* Track elevator service intervals and maintenance needs
* Correlate elevator usage patterns with building occupancy data

## 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. Double-check all credential fields match the values from the Safeline platform.
  </Accordion>

  <Accordion title="Webhook data not arriving">
    Verify the webhook URL is correctly registered in the Safeline platform. Check that the authentication header matches the value from the KODE OS connector detail page. Ensure the Safeline system can reach the KODE OS webhook endpoint over the network.
  </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 Safeline API.
  </Accordion>
</AccordionGroup>
