Skip to main content
Version: 1.0

Illuminance

The Illuminance component handles the monitoring of device's illuminance sensors. Illuminance components are identified with illuminance:<id> in objects containing multiple component payloads.

The Illuminance component uses Illuminance as RPC namespace and implements the minimal component interface:

Methods

Illuminance.SetConfig

Properties:

PropertyTypeDescription

id

number

Id of the Illuminance component instance

config

object

Configuration that the method takes

Find more about the config properties in config section

Illuminance.GetConfig

PropertyTypeDescription

id

number

Id of the Illuminance component instance

Find the Illuminance.GetConfig response properties in config section

Illuminance.GetStatus

Properties:

PropertyTypeDescription

id

number

Id of the Illuminance component instance

Find more about the status response properties in status section

Configuration

The configuration of the Illuminance component allows to adjust the illumination thresholds (dark_thr / bright_thr). To Get/Set the configuration of the Illuminance component its id must be specified.

Properties:

PropertyTypeDescription

id

number

Id of the Illuminance component instance

name

string

Name of the Illuminance instance. name length should not exceed 64 chars

dark_thr

number

Threshold in lux. Accepted range is device-specific

bright_thr

number

bright threshold in lux. Accepted range is device-specific

Status

The status of the Illuminance component represents the measurement of the associated illuminance sensor. To obtain the status of the Illuminance component its id must be specified.

Properties:

PropertyTypeDescription

id

number

Id of the Illuminance component instance

lux

number or null

Illuminance in lux (null if valid value could not be obtained) (if applicable)

illumination

string or null

Illuminance level interpreted according to dark_thr/bright_thr (null if valid value could not be obtained): lux below dark_thr is interpreted as dark, lux between dark_thr and bright_thr is interpreted as twilight, lux above bright_thr is interpreted as bright

errors

array of type string

Shown only if at least one error is present. May contain out_of_range, read when there is problem reading sensor

Webhook Events

There is one event related to the Illuminance component that can trigger webhooks:

  • illuminance.change - produced when illumination (dark/twilight/bright) has changed between two measurements

illuminance.change support two attributes, that can be used to compose conditional webhooks:

  • lux: number, new illuminance in lux (if applicable)
  • illumination: string, new illuminance level interpreted according to dark_thr/bright_thr

Examples

Illuminance.SetConfig example

http://192.168.33.1/rpc/Illuminance.SetConfig?id=0&config={"name":"Illuminance0"}

Illuminance.GetConfig example

http://192.168.33.1/rpc/Illuminance.GetConfig?id=0

Response

{
"id": 0,
"name": null,
"dark_thr": 200,
"bright_thr": 300
}

Illuminance.GetStatus example

http://192.168.33.1/rpc/Illuminance.GetStatus?id=0

Response

{
"id": 0,
"lux": 350,
"illumination": "bright",
"errors": [
"out_of_range"
]
}