Computed Sensors & Telemetry
Create custom computed sensors with JavaScript, use templates, test in the playground, and monitor live telemetry data.
Last updated April 17, 2026
Computed Sensors Overview
Computed sensors allow you to create custom data transformations using JavaScript code that runs against raw device telemetry. Each sensor processes incoming data and produces a computed value displayed on the vehicle detail view.
Sensor Templates
| Template | Unit | Description |
|---|---|---|
| Speed km/h | km/h | Converts raw speed to kilometers per hour |
| Speed mph | mph | Converts raw speed to miles per hour |
| Ignition | On/Off | Binary ignition state from device data |
| Fuel % | % | Fuel level as percentage from analog sensor |
| Temp C | °C | Temperature reading in Celsius from sensor input |
The templates list shows available pre-built sensors. Click the "Use" button to apply a template, and a "Template applied" notification confirms the action.
Sensor Form
| Field | Validation | Description |
|---|---|---|
| Sensor Name | Required, min chars (nameMin) | Display name for the sensor |
| Sensor Code | Required, min chars (codeMin) | JavaScript code that computes the sensor value |
| Unit | Optional | Display unit (unitValue); 'No unit' (noUnit) or 'None' (unitNone) if not set |
| Icon | Optional | Visual icon selected from the icon picker |
Icon Picker
- chooseIcon — opens the icon selection dialog
- useSelected — confirms the selected icon
- searchIcons — search input to filter available icons
- noIconsMatch — displayed when search yields no results
- copyLabel — copies the icon identifier to clipboard
Sensor Playground
The playground provides a "Sensor JS" editor where you write JavaScript code. Use the Run button to execute the code against sample or live data. States include: running (execution in progress), run failed (error occurred), and "click run to preview" (initial prompt).
Data Panel
| Feature | Description |
|---|---|
| Live Telemetry Info | Displays the most recent telemetry packet for the vehicle |
| First 200 Attributes | Shows the first 200 attribute keys from the telemetry payload |
| Invalid Payload Warning | Displayed when the payload structure is not valid JSON |
| Payload No Keys | Message when the payload contains no parseable attributes |
| Editable Payload Toggle | Switch between live data and sample data for testing |
| Insert Button | Inserts a selected attribute key into the sensor code editor |
| Inserted Notification | Confirmation message after successful attribute insertion |
Sensor Status Indicators
| Status | Description |
|---|---|
| liveValue | Current computed value from the latest telemetry data |
| Updated Timestamp | When the sensor value was last recalculated |
| OK | Sensor is functioning correctly and producing valid values |
| Error | Sensor code threw an exception or returned invalid data |
| N/A | No telemetry data available for computation |
CRUD Operations
- createSensor — opens the sensor creation form with empty fields
- editSensor — opens the sensor for editing with pre-populated fields
- deleteSensorTitle / deleteSensorDesc — confirmation dialog for sensor deletion
- deletingLabel — loading state during the delete operation