machineUptimeReportSchema in @bbrandslab/maihue-street-protocol, and the
component catalogue as MACHINE_COMPONENT_CATALOG.
Endpoint
404 otherwise). The
permission is maihue-street-machine:uptime.
Component catalogue
The catalogue is closed: Horizon only knows the components below. Three critical layers and their parts, each reported by itsinternal.
A layer is the program (controller, interface, MCU firmware); its parts are
what that program drives. Report every layer and every part in every
heartbeat, even when a layer is down.
Bodies per device
{ "device": "<device>" } is valid for every device. For the
Raspberry it means “alive, no component report”: nothing about the
components changes.
Component fields
A heartbeat carries at most 64 components, never the same
internal twice,
and no other field: unknown fields are rejected (400) and the whole
heartbeat with them.
Error codes
code is free text in lowercase snake_case. Use these when they fit:
The snapshot is complete
components is the full state of the machine in every heartbeat:
- A component that is not installed is simply not sent. Optional parts (for example the pressure or bottle dispenser sub-boards) only exist on the totems that have them; Horizon never expects them elsewhere.
- A component Horizon already knows on this machine and that is left out
turns off: Horizon marks it
failedwith codenot_reported, records the event and opens its alert. To stop showing a part a totem no longer has, an operator deactivates it on the machine (Horizon → machine → Componentes). "components": []is a full snapshot with nothing in it: every known component turns off. Leavingcomponentsout is not the same: it reports nothing about them.
Response
accepted: components applied (catalogued and linked to an active link).changed: components whose status changed with this heartbeat, including the ones that turned off for being left out.unknown_components: internals missing from the catalogue. They are ignored, never rejected.
What Horizon does with it
- Links: a catalogued component the machine reports for the first time is linked to it automatically (“Detected”). Deactivating a layer on a machine deactivates its parts there too; reactivating the layer leaves them as they are.
- History: one event is stored only when a component’s status changes.
- Alerts: a component that turns
failedopens one alert (high severity for a layer, medium for a part); reportingokagain resolves it. While a layer has an open alert its parts record their failures without opening alerts of their own; when the layer recovers, each part still failing opens its own. - Verdict: the machine reads Con problemas when a layer failed, Degradado when any part is degraded or failed, Operativo when every component is ok, and Sin reportes when the machine has not reported its components within the offline window (10 minutes by default).
- Realtime: each status change is published as
component:statuson the machine’s totem channel. - Touch version: a Touch heartbeat with
app_versionstores it in the machine’stouch_app_version, and the time of that heartbeat intouch_app_version_at, in the same update asuptime_at_touch. A heartbeat withoutapp_versionkeeps the last one. The machine list and detail (GET /api/v3/maihue-street/machine[/{document_id}]) return both fields; the value is client-reported and only displayed.