Sensor Entity

A sensor is a read-only entity that provides some information. Information has a value and optionally, a unit of measurement.

Properties

tip

Properties should always only return information from memory and not do I/O (like network requests). Implement update() or async_update() to fetch data.

NameTypeDefaultDescription
statestringRequiredThe value of the sensor.
unit_of_measurementstringNoneThe unit of measurement that the sensor is expressed in.
device_classstringNoneType of sensor.

Available device classes

If specifying a device class, your sensor entity will need to also return the correct unit of measurement.

TypeUnitDescription
battery%% of battery that is left.
humidity%% of humidity in the air.
illuminancelx/lmLight level.
signal_strengthdB/dBmSignal strength.
temperature°C/°FTemperature.
timestampISO8601Timestamp.
powerW,kWPower.
pressurehPa,mbarPressure.