---
title: "Things 모델과 MQTT"
description: "Home Assistant, MQTT 및 다른 스마트홈 플랫폼을 위해, 서버를 기능을 가진 기기들로 보는 플랫폼 중립적인 관점입니다."
url: https://vigiora.com/ko/docs/home-assistant/things-and-mqtt
updated: 2026-11-04T04:25:55.000Z
---

# Things 모델과 MQTT

> Home Assistant, MQTT 및 다른 스마트홈 플랫폼을 위해, 서버를 기능을 가진 기기들로 보는 플랫폼 중립적인 관점입니다.

**Things 모델**은 Vigiora 서버를 스마트홈 플랫폼이 생각하는 방식으로 설명합니다. 즉, *기능(capability)*을 가진 기기(*thing*)들이며, 각 기능에는 상태, 명령, 이벤트가 있습니다. Home Assistant용 Vigiora 연동은 이 모델 위에 만들어졌고, 다른 어떤 플랫폼도 자체 매핑 테이블만 있으면 이 모델을 사용할 수 있습니다.

API 1.18부터 [공개 API v1](https://vigiora.com/docs/developers/api-v1)의 일부입니다(카탈로그 1.1은 API 1.25부터). 두 번째 API가 아니라 API v1 위의 어댑터입니다. 키가 볼 수 있는 것과 명령이 할 수 있는 일은 기존 작업이 스코프, 역할, 카메라 권한, 요청 한도, 감사, [Human in the loop](https://vigiora.com/docs/developers/human-in-the-loop) 등급과 함께 결정합니다.

## 엔드포인트

| 엔드포인트 | 스코프 | 제공 내용 |
| --- | --- | --- |
| `GET /api/v1/thing-capabilities` | 모든 키 | 카탈로그: 종류, 기능, 상태 스키마, 명령, 이벤트. |
| `GET /api/v1/things` | `cameras:read` | 키가 볼 수 있는 모든 thing과 각 기능의 상태. `?kind=`로 필터링합니다. |
| `GET /api/v1/things/{thing_id}` | `cameras:read` | thing 하나. |
| `POST /api/v1/things/{thing_id}/commands/{capability}.{command}` | 실행하는 작업의 스코프 | 명령을 실행합니다. 본문에 매개변수를 담습니다. |
| `GET /api/v1/events/stream?format=things` | `events:read` | Things 봉투 형식의 실시간 이벤트(Server-Sent Events). |
| `GET /api/v1/server` | 모든 키 | 서버 식별 정보와 `features`. 서버가 무엇을 지원하는지 감지하는 데 씁니다. |

## Things

| 종류 | ID | 설명 |
| --- | --- | --- |
| `server` | `server` | Vigiora 서버. |
| `camera` | `camera:<id>` | 카메라. |
| `microphone` | `microphone:<id>` | USB 마이크. |
| `speaker` | `speaker:<id>` | 스피커 출력(관리자와 운영자). |
| `room` | `room:<id>` | 방. |
| `area` | `area:<id>` | 분석 구역(`analytics:read`). |
| `external` | `ha:<entity_id>` | [브리지](https://vigiora.com/docs/home-assistant/bridge)를 통해 Vigiora와 공유된 Home Assistant 기기(`devices:read`, 관리자와 운영자). 카탈로그 1.1. |

각 thing에는 `id`, `kind`, `name`, `source`(`vigiora` 또는 `home-assistant`), `parent_id`, `site_id`, `room_ids`, `online`(`true`, `false`, 알 수 없으면 `null`), `manufacturer`, `model`, `capabilities`가 있습니다.

## 기능

| 기능 | 대상 | 명령 |
| --- | --- | --- |
| `device` | server, camera, microphone | 없음(online과 offline 이벤트) |
| `video_stream` | camera | `get_url`: 서명된 짧은 유효 기간의 HLS 링크 |
| `snapshot` | camera | `get_url`: 서명된 사진 링크 |
| `motion` | 움직임 감지가 있는 camera | 없음(`started`, `ended` 이벤트) |
| `presence` | camera | 없음(`changed` 이벤트) |
| `object_detection` | camera | 없음(`detected` 이벤트) |
| `alert` | server, camera, microphone | `acknowledge` |
| `recording` | camera, microphone | `turn_on`, `turn_off` |
| `ai_guardian` | camera | `turn_on`, `turn_off` |
| `ai_mode` | room | `set`(live, guardian, both) |
| `ptz` | PTZ가 있는 camera | `move`, `stop`, `goto_preset` |
| `speak` | 스피커가 있는 camera, speaker, room | `say` |
| `describe` | camera | `run` |
| `detect_objects` | camera | `run` |
| `occupancy` | area | 없음(count, capacity, free) |
| `counter` | area | 없음(오늘의 in과 out) |

Home Assistant 기기는 `contact`, `value`, `onoff`, `brightness`, `lock`, `alarm_mode`, `siren`, `notify`를 추가합니다. [기기 종류별로 할 수 있는 일](https://vigiora.com/docs/home-assistant/bridge#what-each-kind-of-device-can-do)을 참고하세요.

카탈로그는 모든 명령에 대해 실행하는 작업, 스코프와 역할, `hitl` 등급을 나열합니다. `confirm`은 Human in the loop가 켜져 있는 동안 AI 에이전트가 사람의 승인을 받아야 한다는 뜻입니다.

## 명령

명령은 호출자 자격으로 기존 작업 하나를 정확히 실행합니다. 예:

```bash
curl -s -X POST https://yourname.vigiora.com/api/v1/things/camera:12/commands/speak.say \
  -H "Authorization: Bearer vgk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello"}'
```

이 명령은 `POST /api/v1/cameras/12/actions/speak`을 실행하고 `thing_id`, `command`, `operation_id`와 작업 자체의 `result`로 응답합니다. 오류는 작업 자체의 오류 그대로입니다. thing이 제공하지 않는 명령은 `404 not_found`로 응답합니다.

명령 엔드포인트는 REST 전용이며 MCP 도구가 아닙니다. AI 에이전트는 작업을 직접 호출하며, 거기서 Human in the loop가 적용됩니다.

## 이벤트

`GET /api/v1/events/stream?format=things`는 각 이벤트를 [CloudEvents 1.0](https://cloudevents.io) 봉투로 보냅니다.

```json
{
  "specversion": "1.0",
  "id": "01JC0Z8Q4M1V6N3B7X2K5T9W0A",
  "source": "vigiora://<server id>/things/camera:12",
  "type": "vigiora.motion.started",
  "subject": "camera:12",
  "time": "2026-11-02T13:05:00.123Z",
  "datacontenttype": "application/json",
  "dataschema": "vigiora:things:1.0:vigiora.motion.started",
  "data": { "started_at": "2026-11-02T13:05:00.120Z" },
  "vigioracapability": "motion",
  "vigioracatalogversion": "1.0",
  "vigioraeventtype": "motion.started"
}
```

유형은 `vigiora.<capability>.<event>` 형식입니다. 예를 들어 `vigiora.presence.changed`, `vigiora.alert.created`, `vigiora.ai_guardian.observed`입니다. 공유된 Home Assistant 기기는 subject `ha:<entity_id>`로 `vigiora.<capability>.changed`를 보냅니다. `?types=`는 여전히 일반 API v1 이벤트 유형으로 필터링합니다. `data` 안의 사진 링크는 읽는 사람을 위해 서명되며 15분간 유효합니다.

## 직접 어댑터 만들기

1. thing과 카탈로그를 나열합니다. 각 thing의 `id`를 플랫폼의 고유 ID로 사용합니다.
2. 각 기능을 플랫폼의 엔티티 유형 하나에 테이블로 매핑합니다. 기능마다 한 행씩, 읽는 상태 필드와 보내는 명령을 적습니다.
3. `?format=things`를 구독하고 `type`과 `subject`로 상태를 업데이트합니다.
4. 서명된 영상 링크(`video_stream.get_url`)는 만료 전에 갱신합니다.
5. 먼저 `GET /api/v1/server`의 `features`를 확인합니다. `things`와 `things_event_format`이 있으면 서버가 이 모델을 지원합니다. 거기서 `404`가 나오면 API 1.17보다 오래된 서버입니다.

### MQTT 예시

이 모델이 Home Assistant 자체 연동에 묶여 있지 않다는 것을 보여 주기 위해, 서버에는 같은 모델 위에 두 번째 어댑터가 있습니다. 버전 1.6.15부터 Vigiora는 각 thing을 MQTT 브로커에 게시합니다. Home Assistant **MQTT 디스커버리**, 유지(retained) 상태, 이벤트, 그리고 허용하면 명령까지 지원합니다. 내장 기능이므로 **System → Integrations → MQTT**에서 설정합니다. 설정과 토픽은 [연동](https://vigiora.com/docs/admin/integrations#mqtt)을 참고하세요.

## 관련 페이지

- [Vigiora와 Home Assistant](https://vigiora.com/docs/home-assistant/overview)
- [Vigiora에서 Home Assistant 기기 사용하기](https://vigiora.com/docs/home-assistant/bridge)
- [공개 API v1](https://vigiora.com/docs/developers/api-v1)
- [웹훅과 이벤트](https://vigiora.com/docs/developers/webhooks-and-events)
- [연동](https://vigiora.com/docs/admin/integrations)

---

Source: https://vigiora.com/ko/docs/home-assistant/things-and-mqtt · Last updated 4 Nov 2026, 04:25 UTC
