Readonly
componentOne of the supported MQTT components, for instance binary_sensor
Optional
deviceInformation about the device this sensor belongs to
Optional
deviceSets the class of the device, changing the device state and icon that is displayed on the frontend.
Optional
enabledFlag which defines if the entity should be enabled when first added.
Optional
entityClassification of a non-primary entity.
Optional
expireIf 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.
Optional
forceSends update events even if the value hasn’t changed. Useful if you want to have meaningful value graphs in history.
Optional
iconIcon of the entity
The maximum value of the number (defaults to 100)
The maximum value of the number (defaults to 1)
Optional
modeControl how the number should be displayed in the UI. Can be set to box or slider to force a display mode.
Name of the sensor inside Home Assistant
Optional
objectSet this to generate the entity_id
in HA instead of using name
Optional
optimisticFlag that defines if switch works in optimistic mode. Default: true if no state_topic defined, else false.
Optional
payloadA special payload that resets the state to None when received on the state_topic.
Optional
qosThe maximum QoS level to be used when receiving messages.
Optional
retainIf the published message should have the retain flag on or not
Optional
stateThe MQTT topic subscribed to receive state updates.
Optional
stepStep value. Smallest acceptable value is 0.001. Defaults to 1.0.
Optional
uniqueSet this to enable editing sensor from the HA ui and to integrate with a device
Optional
unitDefines the unit of measurement of the sensor, if any. The unit_of_measurement can be null.
Generates a JSON object that can be used as an MQTT payload.
Protected
propertyMapping of class properties to MQTT payload keys.
Static
createStatic
wholeValidates that uniqueId
is set if device
is provided.
Information about the 'number' entity