---
title: "The Things model and MQTT"
description: "A platform-neutral view of your server as devices with capabilities, for Home Assistant, MQTT and other smart-home platforms."
url: https://vigiora.com/docs/home-assistant/things-and-mqtt
updated: 2026-11-03T11:33:27.000Z
---

# The Things model and MQTT

> A platform-neutral view of your server as devices with capabilities, for Home Assistant, MQTT and other smart-home platforms.

The **Things model** describes a Vigiora server the way smart-home platforms think: as devices (*things*) with *capabilities*, each with a state, commands and events. The Vigiora integration for Home Assistant is built on it, and any other platform can use it with a mapping table of its own.

It is part of the [public API v1](https://vigiora.com/docs/developers/api-v1) from API 1.18 (catalogue 1.1 from API 1.25). It is an adapter over API v1, not a second API: what a key sees, and what a command may do, are decided by the existing operations, with their scopes, roles, camera permissions, rate limits, audit and [human in the loop](https://vigiora.com/docs/developers/human-in-the-loop) class.

## Endpoints

| Endpoint | Scope | What it gives |
| --- | --- | --- |
| `GET /api/v1/thing-capabilities` | Any key | The catalogue: kinds, capabilities, state schemas, commands, events. |
| `GET /api/v1/things` | `cameras:read` | Every thing the key may see, with its capabilities' state. `?kind=` filters. |
| `GET /api/v1/things/{thing_id}` | `cameras:read` | One thing. |
| `POST /api/v1/things/{thing_id}/commands/{capability}.{command}` | The scope of the operation it runs | Runs a command. The body holds its parameters. |
| `GET /api/v1/events/stream?format=things` | `events:read` | Live events in the Things envelope (Server-Sent Events). |
| `GET /api/v1/server` | Any key | Server identity and `features`, to detect what the server supports. |

## Things

| Kind | Id | What it is |
| --- | --- | --- |
| `server` | `server` | The Vigiora server. |
| `camera` | `camera:<id>` | A camera. |
| `microphone` | `microphone:<id>` | A USB microphone. |
| `speaker` | `speaker:<id>` | A speaker output (admins and operators). |
| `room` | `room:<id>` | A room. |
| `area` | `area:<id>` | An Analytics area (`analytics:read`). |
| `external` | `ha:<entity_id>` | A Home Assistant device shared with Vigiora through the [bridge](https://vigiora.com/docs/home-assistant/bridge) (`devices:read`, admins and operators). Catalogue 1.1. |

Each thing has an `id`, `kind`, `name`, `source` (`vigiora` or `home-assistant`), `parent_id`, `site_id`, `room_ids`, `online` (`true`, `false` or `null` when unknown), `manufacturer`, `model` and `capabilities`.

## Capabilities

| Capability | On | Commands |
| --- | --- | --- |
| `device` | server, camera, microphone | none (online and offline events) |
| `video_stream` | camera | `get_url`: a signed, short-lived HLS link |
| `snapshot` | camera | `get_url`: a signed picture link |
| `motion` | camera with motion detection | none (`started`, `ended` events) |
| `presence` | camera | none (`changed` event) |
| `object_detection` | camera | none (`detected` event) |
| `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` | camera with PTZ | `move`, `stop`, `goto_preset` |
| `speak` | camera with a speaker, speaker, room | `say` |
| `describe` | camera | `run` |
| `detect_objects` | camera | `run` |
| `occupancy` | area | none (count, capacity, free) |
| `counter` | area | none (in and out today) |

Home Assistant devices add `contact`, `value`, `onoff`, `brightness`, `lock`, `alarm_mode`, `siren` and `notify`. See [What each kind of device can do](https://vigiora.com/docs/home-assistant/bridge#what-each-kind-of-device-can-do).

The catalogue lists, for every command, the operation it runs, its scope and roles, and its `hitl` class: `confirm` means an AI agent needs the person's approval while human in the loop is on.

## Commands

A command runs exactly one existing operation as the caller. For example:

```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"}'
```

This runs `POST /api/v1/cameras/12/actions/speak` and answers with `thing_id`, `command`, `operation_id` and the operation's own `result`. Errors are the operation's own, unchanged. A command the thing doesn't offer answers `404 not_found`.

The commands endpoint is REST only, not an MCP tool: AI agents call the operations themselves, where human in the loop applies.

## Events

`GET /api/v1/events/stream?format=things` sends each event as a [CloudEvents 1.0](https://cloudevents.io) envelope:

```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"
}
```

Types are `vigiora.<capability>.<event>`, for example `vigiora.presence.changed`, `vigiora.alert.created` or `vigiora.ai_guardian.observed`. A shared Home Assistant device sends `vigiora.<capability>.changed` with the subject `ha:<entity_id>`. `?types=` still filters by the plain API v1 event types. Picture links in `data` are signed for the reader and valid for 15 minutes.

## Write your own adapter

1. List the things and the catalogue. Use each thing's `id` as your platform's unique id.
2. Map each capability to one of your platform's entity types with a table: one row per capability, with the state field it reads and the command it sends.
3. Subscribe to `?format=things` and update the state from `type` and `subject`.
4. Renew signed video links (`video_stream.get_url`) before they expire.
5. Check `features` in `GET /api/v1/server` first: `things` and `things_event_format` mean the server supports this model. A `404` there means a server older than API 1.17.

### The MQTT example

To show that the model is not tied to Home Assistant's own integration, the server has a second adapter over the same model: from version 1.6.15, Vigiora publishes each thing to an MQTT broker, with Home Assistant **MQTT discovery**, retained state, events and, if you allow it, commands. It is built in: set it up under **System → Integrations → MQTT**. See [Integrations](https://vigiora.com/docs/admin/integrations#mqtt) for the settings and topics.

## Related pages

- [Vigiora and Home Assistant](https://vigiora.com/docs/home-assistant/overview)
- [Use Home Assistant devices in Vigiora](https://vigiora.com/docs/home-assistant/bridge)
- [Public API v1](https://vigiora.com/docs/developers/api-v1)
- [Webhooks and events](https://vigiora.com/docs/developers/webhooks-and-events)
- [Integrations](https://vigiora.com/docs/admin/integrations)

---

Source: https://vigiora.com/docs/home-assistant/things-and-mqtt · Last updated 3 Nov 2026, 11:33 UTC
