Sensor
sensor: - platform: ... # [!code highlight] name: 'My Sensor' id: ram_usage icon: mdi:memory device_class: data_size state_class: measurement unit_of_measurement: '%' accuracy_decimals: 2Attributes
Section titled “Attributes”Common attributes are documented in Common Component Properties.
| Property | Description | Example |
|---|---|---|
device_class | Home Assistant device classification for the sensor value. | data_size |
state_class | Home Assistant state class (for example measurement). | measurement |
unit_of_measurement | Unit shown in user interfaces (for example %, °C, Pa). | % |
accuracy_decimals | Number of decimals reported for the sensor value. | 2 |
Supported Filters
Section titled “Supported Filters”| Filter | Description |
|---|---|
round | Rounds numeric sensor values to the configured decimal precision. |
Supported Platforms
Section titled “Supported Platforms”| Platform | Notes |
|---|---|
| Shell | Reads sensor values from command output. |
| BME280 | Exposes temperature, pressure, and humidity as sensor components. |
| Illuminance | Exposes ambient light as a sensor component. |
For platform-specific configuration options, use the linked platform pages.
Similar to ESPHome: Sensor