---
title: Driver reference
project: IoT Platform
version: 1.0
section: development
language: es
translation: missing
license: Total.js Enterprise
url: https://totaljs.es/docs/es/iot/1-0/development/driver-api/
updated: 2026-11-20T06:56:13.114Z
---

# Driver reference

> Every property and function a driver sets on exports.

A driver sets these properties and functions on `exports` in its `<script total>` part. Entries of type **property** are values you set, entries of type **event** are functions you define and the stream calls.

## API

### exports.id = 'demoweather';

Type: `property`

The identifier of the driver.

Lower-case letters and digits only. A driver saved with an existing id replaces that driver. The id is also the start of the sensor ids, such as `demoweather_temperature`.

### exports.name = 'Demo weather station';

Type: `property`

The name of the driver, shown in Drivers and when people create a device.

A new device gets this name until people change it.

### exports.manufacturer = 'Example Ltd.';

Type: `property`

The maker of the device.

### exports.icon = 'ti ti-temperature';

Type: `property`

The icon of the driver, a Tabler icon class.

### exports.color = '#3B82F6';

Type: `property`

The color of the driver in the app.

### exports.author = 'Jane Doe';

Type: `property`

The author, shown in the device detail.

### exports.version = '1';

Type: `property`

The version of the driver, shown when people choose a driver.

### exports.extension = true;

Type: `property`

Makes the driver an extension that runs once for the whole stream.

Extensions are listed under **Extensions** and are not offered when people create a device. See [Receiving data](../receiving-data/).

### exports.outputs = [{ id, name, type, format, decimals, stats, offline, category }];

Type: `property`

The values the device measures. Each output becomes a sensor of every device.

See [Outputs and history](../outputs-and-history/) for the properties.

Example: Temperature in degrees
```js
exports.outputs = [{ id: 'temperature', type: 'number', name: 'Temperature', format: '{0} °C', decimals: 1, stats: 'hourly' }];
```

### exports.offline = '2 hours';

Type: `property`

How long a sensor stays online without a new value.

The default for outputs without their own `offline`.

### exports.inputs = [{ id, name, html }];

Type: `property`

The inputs of the driver. Inputs with `html` are commands.

See [Commands](../commands/).

Example: A command with one field
```js
exports.inputs = [{ id: 'input', name: 'Input' }, { id: 'interval', name: 'Change interval', html: '<ui-component name="input" path="?.minutes" config="type:number">Minutes</ui-component>' }];
```

### exports.config = { offset: 0 };

Type: `property`

The default configuration of a new device.

People change it with **Configure** when the driver has a `<settings>` part. See [Settings and options](../settings-and-options/).

### exports.options = [{ id, type, name, value }];

Type: `property`

The options of the whole driver, with their default values.

People set them with **Drivers > ... > Settings**. Read them in `com.options` or `instance.module.options`.

Example: A token
```js
exports.options = [{ id: 'token', type: 'string', name: 'Token', value: '' }];
```

### exports.storage = [{ id, name, columns: [{ id, name, type }] }];

Type: `property`

The database tables of the driver.

See [Storage](../storage/).

### exports.install = function(com) {}

Type: `event`

Runs when the stream loads the driver and when a changed driver is loaded again.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `com` | `Object` | yes |  | The driver in the stream. `com.id` is its id, `com.options` its options and `com.main.meta.flow` all running instances. |

Create routes here and keep them on `com` so that `exports.uninstall` can remove them.

Example: Create a route
```js
exports.install = function(com) {
	com.route = ROUTE('POST /demoweather/', function($) {
		$.success();
	});
};
```

### exports.uninstall = function(com) {}

Type: `event`

Runs before a changed driver is loaded again and when the driver is removed.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `com` | `Object` | yes |  | The driver in the stream. |

Remove what `exports.install` created.

Example: Remove the route
```js
exports.uninstall = function(com) {
	com.route && com.route.remove();
};
```

### exports.make = function(instance, config) {}

Type: `event`

Runs for each device of the driver and defines how it processes data.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `instance` | `Object` | yes |  | The device in the stream. |
| `config` | `Object` | yes |  | The configuration of the device, including `sn`. |

For an extension it runs once. Define `instance.message` here. See [Instance reference](../instance-api/).
