Skip to main content

Binary sensor entity

A binary sensor is a sensor that can only have two states. Derive entity platforms from homeassistant.components.binary_sensor.BinarySensorEntity



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

is_onbool | NoneNoneRequired. If the binary sensor is currently on or off.
device_classBinarySensorDeviceClass | NoneNoneType of binary sensor.

Available device classes

BinarySensorDeviceClass.BATTERYOn means low, Off means normal.
BinarySensorDeviceClass.BATTERY_CHARGINGOn means charging, Off means not charging.
BinarySensorDeviceClass.COOn means carbon monoxide detected, Off means no carbon monoxide (clear).
BinarySensorDeviceClass.COLDOn means cold, Off means normal.
BinarySensorDeviceClass.CONNECTIVITYOn means connected, Off means disconnected.
BinarySensorDeviceClass.DOOROn means open, Off means closed.
BinarySensorDeviceClass.GARAGE_DOOROn means open, Off means closed.
BinarySensorDeviceClass.GASOn means gas detected, Off means no gas (clear).
BinarySensorDeviceClass.HEATOn means hot, Off means normal.
BinarySensorDeviceClass.LIGHTOn means light detected, Off means no light.
BinarySensorDeviceClass.LOCKOn means open (unlocked), Off means closed (locked).
BinarySensorDeviceClass.MOISTUREOn means wet, Off means dry.
BinarySensorDeviceClass.MOTIONOn means motion detected, Off means no motion (clear).
BinarySensorDeviceClass.MOVINGOn means moving, Off means not moving (stopped).
BinarySensorDeviceClass.OCCUPANCYOn means occupied, Off means not occupied (clear).
BinarySensorDeviceClass.OPENINGOn means open, Off means closed.
BinarySensorDeviceClass.PLUGOn means plugged in, Off means unplugged.
BinarySensorDeviceClass.POWEROn means power detected, Off means no power.
BinarySensorDeviceClass.PRESENCEOn means home, Off means away.
BinarySensorDeviceClass.PROBLEMOn means problem detected, Off means no problem (OK).
BinarySensorDeviceClass.RUNNINGOn means running, Off means not running.
BinarySensorDeviceClass.SAFETYOn means unsafe, Off means safe.
BinarySensorDeviceClass.SMOKEOn means smoke detected, Off means no smoke (clear).
BinarySensorDeviceClass.SOUNDOn means sound detected, Off means no sound (clear).
BinarySensorDeviceClass.TAMPEROn means tampering detected, Off means no tampering (clear)
BinarySensorDeviceClass.UPDATEOn means update available, Off means up-to-date. The use of this device class should be avoided, please consider using the update entity instead.
BinarySensorDeviceClass.VIBRATIONOn means vibration detected, Off means no vibration.
BinarySensorDeviceClass.WINDOWOn means open, Off means closed.