Skip to content

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 ​

ClasstypeKey params
Numbernumberunit, min, max, max_rate, deadband, step
Booleanbooleanwritable
Enumenumoptions, writable
Stringstringmax_length
Locationlocationlat, 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 property
  • automation={"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_rate and deadband only apply to Number
  • view must be one of: metric, gauge, trend, status, switch, select, text, slider, progress, alarm, input, badge, image, table, log, map
  • deadband/max_rate reduce runtime→frontend emission only, never upstream ingestion

Common mistakes ​

  • Setting min/max but expecting them to clamp values — they only inform the widget
  • Using writable=True without an on_write handler → 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 }
}

Built for self-hosted IoT runtimes.