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:
Illuminance.GetConfigto obtain the component's configurationIlluminance.SetConfigto update the component's configurationIlluminance.GetStatusto obtain the component's status
Methods
Illuminance.SetConfig
Properties:
| Property | Type | Description |
|---|---|---|
| number | Id of the Illuminance component instance |
| object | Configuration that the method takes |
Find more about the config properties in config section
Illuminance.GetConfig
| Property | Type | Description |
|---|---|---|
| number | Id of the Illuminance component instance |
Find the Illuminance.GetConfig response properties in config section
Illuminance.GetStatus
Properties:
| Property | Type | Description |
|---|---|---|
| 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:
| Property | Type | Description |
|---|---|---|
| number | Id of the Illuminance component instance |
| string | Name of the Illuminance instance. |
| number | Threshold in lux. Accepted range is device-specific |
| number |
|
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:
| Property | Type | Description |
|---|---|---|
| number | Id of the Illuminance component instance |
| number or null | Illuminance in lux ( |
| string or null | Illuminance level interpreted according to |
| array of type string | Shown only if at least one error is present. May contain |
Webhook Events
There is one event related to the Illuminance component that can trigger webhooks:
illuminance.change- produced whenillumination(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 todark_thr/bright_thr
Examples
Illuminance.SetConfig example
- Illuminance.SetConfig HTTP GET Request
- Illuminance.SetConfig Curl Request
- Illuminance.SetConfig Mos Request
http://192.168.33.1/rpc/Illuminance.SetConfig?id=0&config={"name":"Illuminance0"}
curl -X POST -d '{"id":1,"method":"Illuminance.SetConfig","params":{"id":0,"config":{"name":"Illuminance0"}}}' http://${SHELLY}/rpc
mos --port ${PORT} call Illuminance.SetConfig '{"id":0,"config":{"name":"Illuminance0"}}'
Illuminance.GetConfig example
- Illuminance.GetConfig HTTP GET Request
- Illuminance.GetConfig Curl Request
- Illuminance.GetConfig Mos Request
http://192.168.33.1/rpc/Illuminance.GetConfig?id=0
curl -X POST -d '{"id":1,"method":"Illuminance.GetConfig","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call Illuminance.GetConfig '{"id":0}'
Response
- Illuminance.GetConfig HTTP GET Response
- Illuminance.GetConfig Curl Response
- Illuminance.GetConfig Mos Response
{
"id": 0,
"name": null,
"dark_thr": 200,
"bright_thr": 300
}
{
"id": 1,
"src": "shellypro4pm-f008d1d8b8b8",
"params": {
"id": 0,
"name": null,
"dark_thr": 200,
"bright_thr": 300
}
}
{
"id": 0,
"name": null,
"dark_thr": 200,
"bright_thr": 300
}
Illuminance.GetStatus example
- Illuminance.GetStatus HTTP GET Request
- Illuminance.GetStatus Curl Request
- Illuminance.GetStatus Mos Request
http://192.168.33.1/rpc/Illuminance.GetStatus?id=0
curl -X POST -d '{"id":1,"method":"Illuminance.GetStatus","params":{"id":0}}' http://${SHELLY}/rpc
mos --port ${PORT} call Illuminance.GetStatus '{"id":0}'
Response
- Illuminance.GetStatus HTTP GET Response
- Illuminance.GetStatus Curl Response
- Illuminance.GetStatus Mos Response
{
"id": 0,
"lux": 350,
"illumination": "bright",
"errors": [
"out_of_range"
]
}
{
"id": 1,
"src": "shellypro4pm-f008d1d8b8b8",
"params": {
"id": 0,
"lux": 350,
"illumination": "bright",
"errors": [
"out_of_range"
]
}
}
{
"id": 0,
"lux": 350,
"illumination": "bright",
"errors": [
"out_of_range"
]
}