Property
A property is a single data point on an entity. Its type drives the UI component.
Purpose
Describe data semantics (meaning), not pixel layout. The runtime infers the right component.
Types
| Class | type | Key params |
|---|---|---|
Number | number | unit, min, max, max_rate, deadband, step |
Boolean | boolean | writable |
Enum | enum | options, writable |
String | string | max_length |
Location | location | lat, lng (map widget) |
Signature
python
Number(unit=None, min=None, max=None, max_rate=None, deadband=None, step=None,
writable=False, view=None, label=None, configurable=None, automation=None)
Boolean(writable=False, view=None, label=None, configurable=None, automation=None)
Enum(options=[], writable=False, view=None, label=None, configurable=None, automation=None)
String(max_length=None, writable=False, view=None, label=None, configurable=None, automation=None)
Location(lat=None, lng=None)Common metadata
label— human-readable display name; frontend auto title-cases the key otherwise (fill_valve→ "Fill Valve")configurable={"warning": True}— user can set a warning threshold on this propertyautomation={"allow_set": True}— automation rules may set this property (developer-controlled boundary: manual write ≠ automation write)
Minimal example
python
Number(unit="°C")Complete example
python
Number(
unit="bar",
min=0,
max=10,
view="slider", # presentation hint
label="Pressure", # human-readable name
writable=True,
max_rate=2, # emit ≤ 2 updates/sec
deadband=0.1, # skip changes < 0.1
configurable={"warning": True},
automation={"allow_set": True},
)Constraints
max_rateanddeadbandonly apply toNumberviewmust be one of: metric, gauge, trend, status, switch, select, text, slider, progress, alarm, input, badge, image, table, log, mapdeadband/max_ratereduce runtime→frontend emission only, never upstream ingestion
Common mistakes
- Setting
min/maxbut expecting them to clamp values — they only inform the widget - Using
writable=Truewithout anon_writehandler → value updates optimistically - Forgetting
automation={"allow_set": True}on writable properties that automation rules should control
Generated schema
json
{
"type": "number",
"unit": "bar",
"min": 0,
"max": 10,
"writable": true,
"label": "Pressure",
"presentation": { "preferred": "slider" },
"configurable": { "warning": true },
"automation": { "allow_set": true }
}