Inbox Rules for automatic approval?

Would it be useful to have a set of rules to automatically approve inbox items, turning them into Things? I’ve built this add-on but haven’t submitted it yet - unsure whether it’s something that’s needed.

Once the Things are created, one can create the corresponding items automatically using Yaml Composer’s dynamic Things feature.


Inbox Rules

Inbox Rules implements openHAB’s inbox auto-approval predicate using configurable string rules.
Matching discovery results are approved by the core inbox processor; supported actions are then applied to the new Thing through the Thing registry.

Configuration

Configure the add-on through Main UI under Settings → Add-on Settings → Inbox Rules, or set rules in ConfigAdmin. Each entry is one rule:

Set rulesEnabled to false to disable all rules; it defaults to true.

criteriaKey=value; actionKey=value

Rules are evaluated in order; the first matching rule approves the result.
A rule without action keys only approves it.
Lines beginning with # or // are comments.
Invalid rules are ignored.

Criteria

  • thingUid, bridgeUid, and label match the corresponding discovery result values.
  • representationProperty matches the value stored at the result’s representation property.
  • propertyMatch and configMatch accept comma-separated key=value or key:value comparisons against discovery properties.
  • Criteria support * (zero or more characters) and ? (one character).

Actions

  • setLabel changes the approved Thing’s label.
  • setLocation sets its location.
  • setProperties and setConfig accept comma-separated assignments, such as setProperties=room=Kitchen,source=${properties.id}.

Action values support ${label}, ${thingUID}, ${bridgeUID}, and ${properties.name} interpolation.
Unknown interpolation variables become empty strings.
Actions are applied once when the approved Thing is added to the registry.

Example:

# Approve a discovered device and enrich it
thingUid=zwave:device:*; label=Front Door Sensor; setLabel=${label}; setLocation=Ground Floor; setProperties=room=Entry,serial=${properties.serialNumber}