Custom Data Sources
DataSourceDefinitions let you map robot telemetry to named attributes displayed in dashboards. They are configured through the ConfigAPI.
Overview
The data flow for custom data sources:
- Robot agent publishes custom data via MQTT (
CustomDataMessage) - Ingest
CustomDataModulestores it in MongoDB - A
DataSourceDefinitionmaps stored data to a named attribute - Widgets display the attribute value on dashboards
CustomData Widget Types
The CustomData widget supports three display formats:
KeyValue
Displays named key-value pairs in a table:
Battery Level: 87%
Speed: 1.2 m/s
Mode: Autonomous
The robot agent publishes these as repeated Value fields in a CustomDataMessage.
Text
Renders arbitrary text content published by the agent. Useful for logs, diagnostic messages, or status descriptions.
Image
Displays images (JPEG) published by the robot agent. Common use cases include camera feeds, visual inspection results, or diagnostic screenshots.
Defining Data Sources via ConfigAPI
Use the apply endpoint to create a DataSourceDefinition:
curl -X POST \
-H "x-auth-api-key: YOUR_KEY" \
-H "Content-Type: application/json" \
http://localhost:3000/api/configuration/apply \
-d '{
"kind": "DataSourceDefinition",
"apiVersion": "v0.1",
"metadata": {
"id": "my-custom-source"
},
"spec": {
"label": "Battery",
"source": { "keyValue": { "key": "battery" } }
}
}'
Listing Configured Data Sources
# Short format (IDs only)
curl -H "x-auth-api-key: YOUR_KEY" \
"http://localhost:3000/api/configuration/list?kind=DataSourceDefinition"
# Full format (complete spec, re-applicable)
curl -H "x-auth-api-key: YOUR_KEY" \
"http://localhost:3000/api/configuration/list?kind=DataSourceDefinition&format=full"
Removing a Data Source
curl -X POST \
-H "x-auth-api-key: YOUR_KEY" \
-H "Content-Type: application/json" \
http://localhost:3000/api/configuration/clear \
-d '{
"kind": "DataSourceDefinition",
"metadata": {
"id": "my-custom-source"
}
}'
Querying Attribute Values
Once a DataSourceDefinition is configured, the computed attribute can be queried via the REST API:
curl -H "x-auth-api-key: YOUR_KEY" \
http://localhost:3000/api/robots/{robotId}/attributes/{attributeId}
See the Attributes API for details.
Next Steps
- ConfigAPI Reference — full API documentation
- Attributes & Status — how attributes and status work together
- Custom Widgets — build widgets that consume your data sources