mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-11-16 06:20:11 +00:00
1.1 KiB
1.1 KiB
title, sidebar_label, id, original_id
| title | sidebar_label | id | original_id |
|---|---|---|---|
| Sensor Entity | Sensor | version-0.80.0-entity_sensor | entity_sensor |
A sensor is a read-only entity that provides some information. Information has a value and optionally, a unit of measurement.
Properties
Properties should always only return information from memory and not do I/O (like network requests). Implement
update()orasync_update()to fetch data.
| Name | Type | Default | Description |
|---|---|---|---|
| state | string | Required | The value of the sensor. |
| unit_of_measurement | string | None |
The unit of measurement that the sensor is expressed in. |
| device_class | string | None |
Type of sensor. |
Available device classes
If specifying a device class, your sensor entity will need to also return the correct unit of measurement.
| Type | Unit | Description |
|---|---|---|
| battery | % | % of battery that is left. |
| humidity | % | % of humidity in the air. |
| illuminance | lx/lm | Light level. |
| temperature | C/F | Temperature. |
| pressure | hPa,mbar | Pressure. |