# Motion Detection

{% hint style="warning" %}
This event is only applicable to Heatic 2+ sensors.
{% endhint %}

{% hint style="info" %}
A **PIR Motion** event is triggered when the Heatic 2+ sensor detects movement in a room, transitioning from a no-motion state to a motion-detected state. This event is only sent when a change in state occurs, ensuring that updates are meaningful and not repeatedly sent while motion is continuously detected.
{% endhint %}

## Payload

The PIR Motion event follows a standardized JSON structure:

```json
{
  "id": "event_2oUBiSXgx48RtbZKXHm5ekpAzFe",
  "type": "PIR_MOTION",
  "timestamp": 1727735832000,
  "version": "v1.0.0",
  "metadata": {
    "org_id": "org_2oUBiRES2AmpczNM5yLu7pChz8o",
    "site_id": "site_2oUBkdxF0lLJZxyWVix09ZTsMNV",
    "building_id": "building_2oUBkaFkcYwDzo7HLXpPh8bP4cD",
    "floor_id": "space_2oUBnI7YL51GNemTvKIxEgSZ8gx",
    "room_id": "room_2oUDDps5iKHHo6RwlMgGVihmTlq",
    "floor_custom_id": "2tZStWPtxqpmb3w0PoJDm7AnfIX", // (optional)
    "room_custom_id": "2tZSGplhA4CZ58wFlTf7wAeKMVo",  // (optional)
    "org_name": "Murphy Group",
    "site_name": "Los Angeles",
    "building_name": "Bergnaum Building",
    "floor_name": "1st Floor",
    "room_name": "Cherry Falls"
  }
}
```

### Field Descriptions

#### Event Metadata

<table><thead><tr><th width="130">Field</th><th width="95">Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>string</td><td>Unique event identifier</td></tr><tr><td>type</td><td>string</td><td>Event type (e.g., "PIR_MOTION")</td></tr><tr><td>timestamp</td><td>number</td><td>Timestamp of the event (in milliseconds)</td></tr><tr><td>version</td><td>string</td><td>Event version (e.g., "v1.0.0")</td></tr></tbody></table>

#### Organization and Location Metadata

<table><thead><tr><th width="179">Field</th><th width="155">Type</th><th>Description</th></tr></thead><tbody><tr><td>org_id</td><td>string</td><td>Unique organization identifier</td></tr><tr><td>site_id</td><td>string</td><td>Unique site identifier</td></tr><tr><td>building_id</td><td>string</td><td>Unique building identifier</td></tr><tr><td>floor_id</td><td>string</td><td>Unique floor identifier</td></tr><tr><td>room_id</td><td>string</td><td>Unique room identifier</td></tr><tr><td>floor_custom_id</td><td>string (optional)</td><td>Customer's unique floor identifier</td></tr><tr><td>room_custom_id</td><td>string (optional)</td><td>Customer's unique room identifier</td></tr><tr><td>org_name</td><td>string</td><td>Organization name</td></tr><tr><td>site_name</td><td>string</td><td>Site name</td></tr><tr><td>building_name</td><td>string</td><td>Building name</td></tr><tr><td>floor_name</td><td>string</td><td>Floor name</td></tr><tr><td>room_name</td><td>string</td><td>Room name</td></tr></tbody></table>
