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

# Density

> Connect Density to KODE OS for occupancy data

> Connect Density to KODE OS for occupancy data integration

## Overview

Use this integration to connect your Density occupancy sensors to KODE OS. You can discover traffic counters and presence sensors, then collect real-time people counts and space utilization data across your building.

| Property            | Value     |
| ------------------- | --------- |
| **System Type**     | Occupancy |
| **Communication**   | REST      |
| **Collection**      | Pull      |
| **Collection Mode** | SNAPSHOT  |

## Supported Capabilities

* Discover Devices & Points
* Collect Sensor Data

## Prerequisites

To integrate with the Density API, ensure you have the following details:

* An active account in [https://atlas.density.io](https://atlas.density.io) with the appropriate access permissions.
* Valid username and password credentials for the Atlas platform.

### Vendor Onboarding References

Use these official vendor resources to verify API access, credentials, and permission prerequisites:

* [Density API quick start](https://developers.density.io/quick_start)
* [Density API reference](https://developers.density.io/docs/)

## Generate API Credentials

* Log in to the atlas.density.io using your username and password
* Click the gear icon on the bottom-left corner
* Select Developer
* Click on the desired token to copy it to your clipboard
* If you do not see the desired token, click Add Token at the top right
* Input the required information and select if it will be a read-only or a read-write token, and then click Save
  After completing the steps above, your API Token will be used in the next step.

## Configure Connector in KODE OS

1. Navigate to **Data Sources** in your building
2. Click **API Catalog** and search for **Density**
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         |
| **Token** | Yes      | password | The API token 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 Density 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 Density, KODE OS maps them to the following device types and data points:

### Traffic Counter

Canonical Type: `trafficCounter`

| # | Point      | Description                                | Unit  | Writable | Collection |
| - | ---------- | ------------------------------------------ | ----- | -------- | ---------- |
| 1 | `status`   | **True** -- active / **False** -- inactive | --    | No       | Polling    |
| 2 | `entrance` | Cumulative count of people entering        | count | No       | Polling    |
| 3 | `exit`     | Cumulative count of people exiting         | count | No       | Polling    |

### Presence / Occupancy Sensor

Canonical Type: `presenceDetection`

| # | Point           | Description                   | Unit  | Writable | Collection |
| - | --------------- | ----------------------------- | ----- | -------- | ---------- |
| 1 | `capacity`      | Maximum capacity of the space | count | No       | Polling    |
| 2 | `current_count` | Cumulative count of events    | count | No       | Polling    |

## What Data You Get

### Point History

Time-series readings including status, entrance, exit, capacity, current\_count, collected at regular intervals from connected devices

### Polling Schedule

* **Point History** -- Default polling: 5 minutes (min: 5 minutes, max: 5 minutes)

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:

* Track real-time space utilization rates across floors and zones
* Optimize HVAC and lighting schedules based on actual occupancy patterns
* Generate utilization reports to inform space planning and real estate decisions

## 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. Ensure the API key or token is valid and has not been revoked or expired in the Density platform.
  </Accordion>

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