Illuminance
OS Support:
The illuminance platform allows you to integrate a laptop ambient light sensors into UbiHome. It supports both Linux and Windows systems.
Supported Platforms
Section titled “Supported Platforms”- Uses Industrial I/O (IIO) framework (
/sys/bus/iio/devices/) - Supports auto-detection of light sensor devices
- Fallback support for alternative hardware monitor paths
- Common device locations:
/sys/bus/iio/devices/iio:deviceN/in_illuminance_raw/sys/bus/iio/devices/iio:deviceN/in_illuminance_input/sys/class/hwmon/hwmonN/device/als/sys/devices/platform/applesmc.768/light(Apple devices)
Windows
Section titled “Windows”- Native Windows Sensor API support using COM interfaces
- Automatic detection of ambient light sensors through Windows Sensor Manager
- Direct sensor data access without external dependencies
Configuration
Section titled “Configuration”Enable the platform:
illuminance: update_interval: 30s # Default update interval for all sensorsBasic Usage
Section titled “Basic Usage”sensor: - platform: illuminance name: 'Ambient Light' icon: mdi:brightness-6 unit_of_measurement: 'lx' device_class: illuminance state_class: measurementAdvanced Configuration with Manual Device Path
Section titled “Advanced Configuration with Manual Device Path”sensor: - platform: illuminance name: 'Ambient Light Sensor' device_path: '/sys/bus/iio/devices/iio:device0/in_illuminance_raw' update_interval: 15s icon: mdi:brightness-6 unit_of_measurement: 'lx' device_class: illuminance state_class: measurementConfiguration Options
Section titled “Configuration Options”Light Sensor Platform
Section titled “Light Sensor Platform”| Property | Type | Default | Description |
|---|---|---|---|
platform | string | Required | Must be illuminance |
name | string | Required | Display name for the sensor |
device_path | string | Optional | Manual device path (Linux only) |
update_interval | duration | 30s | How often to read the sensor |
icon | string | mdi:brightness-6 | Home Assistant icon |
device_class | string | illuminance | Home Assistant device class |
state_class | string | measurement | Home Assistant state class |
unit_of_measurement | string | lx | Unit of measurement |
Global Configuration
Section titled “Global Configuration”illuminance: update_interval: 30s # Default update interval for all sensors device_path: '/custom/path' # Default device path (Linux only)Troubleshooting
Section titled “Troubleshooting”-
No sensor detected: Check if your system has a light sensor:
Terminal window ls /sys/bus/iio/devices/find /sys -name "*illuminance*" 2>/dev/nullSpecify the exact path:
sensor:- platform: illuminancename: 'Light Sensor'device_path: '/sys/bus/iio/devices/iio:device0/in_illuminance_raw'