Skip to content

@camera.ui/sdk / sensor / SensorSemantics

Interface: SensorSemantics

Defined in: sensor/meta.ts:74

What a sensor means, independent of any transport: which property holds its state, which takes commands, its unit and state mapping. Consumers (MQTT discovery, the HA integration) render from this instead of their own switch.

Properties

brightness?

readonly optional brightness?: object

Defined in: sensor/meta.ts:92

Property carrying brightness, plus the scale factor a consumer applies to it.

property

readonly property: string

scale

readonly scale: number


commandProperty

readonly commandProperty: string

Defined in: sensor/meta.ts:80

Property that takes commands.


deviceClass?

readonly optional deviceClass?: string

Defined in: sensor/meta.ts:82

Device class, where one applies.


diagnostic?

readonly optional diagnostic?: boolean

Defined in: sensor/meta.ts:88

Whether consumers should file it under diagnostics instead of controls.


domain

readonly domain: SensorDomain

Defined in: sensor/meta.ts:76

Which kind of thing the sensor is.


icon?

readonly optional icon?: string

Defined in: sensor/meta.ts:86

Material Design icon name, e.g. mdi:door.


stateProperty

readonly stateProperty: string

Defined in: sensor/meta.ts:78

Property holding the sensor's state.


states?

readonly optional states?: Readonly<Record<string, number>>

Defined in: sensor/meta.ts:90

State-name to wire-value mapping for multi-state sensors.


unit?

readonly optional unit?: string

Defined in: sensor/meta.ts:84

Unit of the state value, e.g. % or °C.


volume?

readonly optional volume?: object

Defined in: sensor/meta.ts:94

Property carrying volume, plus the scale factor a consumer applies to it.

property

readonly property: string

scale

readonly scale: number