Vigiora

Den här sidan finns ännu inte på Svenska. Den visas på engelska.

The Things model and MQTTSedan 1.6.13

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

Endpoints#

EndpointScopeWhat it gives
GET /api/v1/thing-capabilitiesAny keyThe catalogue: kinds, capabilities, state schemas, commands, events.
GET /api/v1/thingscameras:readEvery thing the key may see, with its capabilities' state. ?kind= filters.
GET /api/v1/things/{thing_id}cameras:readOne thing.
POST /api/v1/things/{thing_id}/commands/{capability}.{command}The scope of the operation it runsRuns a command. The body holds its parameters.
GET /api/v1/events/stream?format=thingsevents:readLive events in the Things envelope (Server-Sent Events).
GET /api/v1/serverAny keyServer identity and features, to detect what the server supports.

Things#

KindIdWhat it is
serverserverThe Vigiora server.
cameracamera:<id>A camera.
microphonemicrophone:<id>A USB microphone.
speakerspeaker:<id>A speaker output (admins and operators).
roomroom:<id>A room.
areaarea:<id>An Analytics area (analytics:read).
externalha:<entity_id>A Home Assistant device shared with Vigiora through the 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#

CapabilityOnCommands
deviceserver, camera, microphonenone (online and offline events)
video_streamcameraget_url: a signed, short-lived HLS link
snapshotcameraget_url: a signed picture link
motioncamera with motion detectionnone (started, ended events)
presencecameranone (changed event)
object_detectioncameranone (detected event)
alertserver, camera, microphoneacknowledge
recordingcamera, microphoneturn_on, turn_off
ai_guardiancameraturn_on, turn_off
ai_moderoomset (live, guardian, both)
ptzcamera with PTZmove, stop, goto_preset
speakcamera with a speaker, speaker, roomsay
describecamerarun
detect_objectscamerarun
occupancyareanone (count, capacity, free)
counterareanone (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.

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:

Terminal
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 envelope:

A motion event
{
  "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 for the settings and topics.

Redigera sidan på GitHub