ReadonlycomponentComponent type for binary sensor
OptionaldeviceInformation about the device this sensor belongs to
OptionaldeviceSets the class of the device, changing the device state and icon that is displayed on the frontend.
OptionalenabledFlag which defines if the entity should be enabled when first added.
OptionalentityClassification of a non-primary entity.
OptionalexpireIf set, it defines the number of seconds after the sensor’s state expires, if it’s not updated. After expiry, the sensor’s state becomes unavailable. Default the sensors state never expires.
OptionalforceSends update events even if the value hasn’t changed. Useful if you want to have meaningful value graphs in history.
OptionaliconIcon of the entity
Name of the sensor inside Home Assistant
OptionalobjectSet this to generate the entity_id in HA instead of using name
OptionaloffFor sensors that only send on state updates (like PIRs), this variable sets a delay in seconds after which the sensor's state will be updated back to off.
ReadonlypayloadPayload to send for the OFF state
ReadonlypayloadPayload to send for the ON state
OptionalqosThe maximum QoS level to be used when receiving messages.
OptionaluniqueSet this to enable editing sensor from the HA ui and to integrate with a device
Generates a JSON object that can be used as an MQTT payload.
ProtectedpropertyMapping of class properties to MQTT payload keys.
StaticcreateStaticwholeValidates that uniqueId is set if device is provided.
Binary sensor-specific information