Skip to content

@camera.ui/sdk / manager / SensorManager

Interface: SensorManager

Defined in: manager/index.ts:156

Sensor manager for standalone sensors: devices that are not part of a camera's hardware (smart plugs, imported smart-home devices, hubs).

The host persists each sensor as its own entity: the user assigns it to cameras, renames it and decides whether it is exported or not. Sensors that belong to a camera's hardware are registered via camera.addSensor() instead.

Accessed via api.sensorManager in plugins.

Example

typescript
const lock = new LockControl('Front Door', { nativeId: 'lock.front_door' });
await api.sensorManager.addSensor(lock);

Methods

addSensor()

addSensor(sensor): Promise<void>

Defined in: manager/index.ts:167

Register a standalone sensor with the host.

The host reconciles it against the persisted entity by (pluginId, nativeId), or by (type, name) when no nativeId is set, and replaces the sensor's provisional id with the persistent entity id. Camera assignment is the user's decision and happens in the UI.

Parameters

sensor

Sensor<any, any, any>

Sensor instance to register

Returns

Promise<void>


getSensors()

getSensors(): Sensor<any, any, any>[]

Defined in: manager/index.ts:182

Get all sensors this plugin has registered in this session.

Returns

Sensor<any, any, any>[]

Sensor instances owned by this plugin


removeSensor()

removeSensor(sensor): Promise<void>

Defined in: manager/index.ts:175

Unregister a sensor. The persisted entity stays (shows disconnected) unless the user deletes it in the UI.

Parameters

sensor

Sensor<any, any, any>

Sensor instance to unregister

Returns

Promise<void>