Overview
Sight Machine is a Manufacturing Data Platform. It models plant data as machines, cycles, downtime, parts and production lines, and computes KPIs such as OEE, quality and availability. This connector connects the Coreflux broker to the REST API of your Sight Machine tenant, so plant logic on MQTT can read production data, KPI results, recipe recommendations and dashboard values without custom code.- SightMachineApi (
SightMachineRestApi.lot) is a client connector onhttps://YOUR_TENANT.sightmachine.iowith 24 events.
404 and wrong methods return 405 (see Status).
Tenant host
Each customer gets its own tenant athttps://<tenant>.sightmachine.io. Replace YOUR_TENANT in BASE_ADDRESS with your tenant name, with no trailing slash. For a private or dedicated deployment, use the host Sight Machine gave you.
Authentication
- In your tenant, open User Profile (top right), scroll to Security and click Create API Key. Copy the API key and secret.
- Every event takes
"api_key_id"and"api_secret"in its MQTT payload. The connector sends them asX-SM-API-Key-IdandX-SM-API-Secret.ListFactories(legacy/api) also sendsX-SM-API-Keywith the secret, like the SDK does.
SIGHTMACHINE_API_KEY_ID and SIGHTMACHINE_API_SECRET. A missing or wrong key returns 401 with {"error":"unauthenticated","description":"Not logged in or invalid API key provided"}.
Edge API keys (the CONNECT menu) are a different credential. FactoryTX uses them to upload data. If your tenant uses workspaces, the SDK selects one with an
X-Sm-Workspace-Id header. This template does not send that header, so add it to the events if you need it.Payload conventions
- Queries. The
/v1/datatab/..., estimate, KPI, Data Viz, line Data Viz and cookbook current-value events are read-onlyPOSTqueries. Each one sends"body"unchanged. The body is the SDK query object:asset_selection,select,where(name,op,value),order_by,time_selection(relative or absolute),offset,limitanddb_mode("sql"). See the SDK reference for every field. - Names. Use system names in queries:
machine_source(for exampleOven_1),machine_type(Oven), field names fromGetMachineTypeFields, and part types fromListPartTypes.ListMachinesandListMachineTypesmap display names to system names. - Query strings. Events with
?{query}take a pre-encoded query string. Send""for none.ListMachinestakeslimitpluswhere,order_byandselectas URL-encoded JSON. - Paging. Data table events return up to
limitrows (at most 50000) underresults. Page withoffset. - Asynchronous Data Viz.
SubmitDataVizTaskandSubmitLineVizTaskreturnresponse.task_id. PollGetDataVizTaskorGetLineVizTaskuntilresponse.stateisSUCCESS, then readresponse.meta.results.FAILUREandREVOKEDmean the query failed.
Assets and metadata
ListMachines (
mes/sight-machine/machine/list)
mes/sight-machine/machine-type-field/list)
Production data (cycles, downtime, parts, lines, raw data)
QueryCycles (
mes/sight-machine/cycle/query)
mes/sight-machine/downtime/query)
mes/sight-machine/raw-data/query)
Counts
EstimateCycleCount (
mes/sight-machine/cycle-count/get)
KPIs and Data Viz
ListKpisForAsset (
mes/sight-machine/kpi-asset/list)
mes/sight-machine/datavis-task/create)
mes/sight-machine/datavis-task/get)
Cookbooks (recipes)
GetCookbookCurrentValues (
mes/sight-machine/cookbook-current-value/get)
Dashboards
GetDashboardValues (
mes/sight-machine/dashboard-values/get)
panels, with id, name, type (single or table), status and data. Only Data Visualization and Single Value widgets set to background loading return data. The others report unsupported type, background loading not enabled or no completed jobs found. The dashboard id is the last part of the dashboard URL.
Sending plant data to Sight Machine
Sight Machine takes plant data in through FactoryTX, its edge data layer, not through a public REST write. Its upload endpoints are not published, so this template has no ingest event. To send Coreflux data to Sight Machine, point a FactoryTX MQTT Data Receiver at the Coreflux broker. Sight Machine documents no webhooks, so this template has no receiver connector either.Examples
Helper actions (docs-helper-actions.lot): an OEE Data Viz query every 15 minutes with polling of the task, the dashboard values every hour, sent on to a plant topic, and current lever values every 5 minutes.
The helper actions read the key and secret with
GET SECRET on every call. Restrict the mes/sight-machine/# request topics with broker ACLs, because the payloads carry the secret.Writes
Write events: CreateShareLink.CreateShareLink saves a Data Viz chart state on the tenant and returns a share link. Every other event is read-only, including the POST query events. No preset deletes anything.
Not packaged
Data ingest (FactoryTX upload and RDPv3 endpoints are not published), password and SSO login (/auth/password/login sets a browser session cookie, so use API keys), the ODBC / JDBC connector (SQL, not REST), legacy /api cycle, part, machine and downtime endpoints (replaced by /v1), workspace selection (X-Sm-Workspace-Id), and any endpoint that appears only in the tenant’s login-gated API reference.
Status
Technical preview, blocked on the authenticated live test. On the live tenantdemo.sightmachine.io, all 24 events return 401 unauthenticated for an invalid key, unknown paths return 404 and wrong methods return 405 before auth. A tenant API key is still needed to check real responses.
