Discovery
Discovery detects devices on the network that are not yet backed by a plugin instance and surfaces them as candidates for an operator to act on. Discovery never creates an instance or a device by itself, so nothing irreversible happens on a guess.
Model
A provider emits candidates into one table. Each row carries a provider type tag, an identifier stable for that source type, allowlisted metadata, first- and last-seen timestamps, a time-to-live, an optional suggested plugin type, and a dismissal timestamp. A background service calls every registered provider on a timer, and one provider throwing does not abort the scan. Candidates are ephemeral runtime data. A plugin claims candidates by declaring matchers; a matched candidate pre-fills a suggested plugin type so the operator creates the instance in one action.
The TTL slides forward on every observation: each scan advances LastSeenUtc and refreshes ExpiresAtUtc, including
when the candidate content has not changed. Unchanged allowlisted metadata is not rewritten to object storage.
| Provider | Type tag | Identifier | Requirement | Privacy note |
|---|---|---|---|---|
| mDNS | mdns |
Instance FQDN — stable across address changes | Backend process on the host network | Service text records are discarded |
| SSDP | ssdp |
Hash of the unique service name | Per-node discovery component, or host network | Name hashed; address and server string stored |
| USB | usb |
vendor:product:serial, else vendor:product:devpath |
Per-node component with the USB bus mounted | Hardware ids only |
| BLE | ble |
Hash of the advertised address | A Bluetooth adapter | Raw address never published; static-address devices remain trackable |
| DHCP | dhcp |
Client hardware address, hashed when masking is enabled | Per-node component with raw-socket capability | Hardware addresses of every device on the segment, phones included |
| Controller-sourced | plugin-chosen label | Client hardware address | A plugin instance with a reachable controller | Address, address block, hostname and connection type of every known client |
A plugin whose instance type also implements the discovery-provider interface is enumerated on every scan alongside the built-ins, with the same per-provider exception isolation, so a vendor can add a discovery source with no core change. The type tag such a plugin emits is a data label, not a matcher type the core understands.
Metadata allowlist
Raw service-announcement records are never persisted, because they routinely carry serial numbers, cloud account
identifiers and firmware fingerprints. Only these fields are stored, and anything else is dropped: host, port,
addresses, instanceName, serviceType, address, st, server, location, vendor, product, serial,
manufacturer, productName, devPath, rssi, name, manufacturerData, serviceUUIDs,
vendorClassIdentifier, hostname, parameterRequestList, messageType, mac, ip, connectionType and oui
(derived locally from the first three octets of the hardware address). Discovery audit entries record only the
type, the identifier and the suggested plugin type.
Matchers
A matcher declares an optional provider Type, a required non-empty Criteria map, and an optional Prefill map.
The index is built at plugin-load time and replaced, never mutated, when a native plugin is installed, updated or
uninstalled without a restart: the plugin's matchers are swapped for the new version's or dropped, and other plugins'
matchers stay, and the updated plugin keeps its place in the order. A stored candidate keeps its suggestion until
the next pass that sees it, which stores the match from the index at that time, or none. The index is per
replica, so during a rolling update replicas can match with different versions. A matcher that fails validation
rejects the whole plugin at load.
| Rule | Behaviour |
|---|---|
| Criteria combination | All criteria must match (AND). |
| Comparison | Case-insensitive string equality only — no prefix, regex or operator forms. |
| Typed matcher | Type must be one of mdns, ssdp, usb, ble, dhcp or bluetooth. A manifest with any other type is rejected. |
| Typeless matcher | Type null, empty or whitespace. Matches any candidate whose metadata satisfies the criteria, regardless of which source produced it. |
| Evaluation order | Typed matchers first, typeless after — regardless of declaration order. A typed match therefore wins for a candidate of that type. |
Typeless matchers are how a plugin claims candidates from a source the core has no built-in knowledge of: key the matcher on whatever metadata that source emits, such as a hardware-address block.
API and configuration
All endpoints require the integrations.manage permission.
| Method | Path | Notes |
|---|---|---|
| GET | /api/discovery/candidates |
Filters: ?type=, ?dismissed=true (include dismissed candidates) |
| POST | /api/discovery/candidates/{id}/dismiss |
Kept until the time-to-live expires |
| POST | /api/discovery/scan |
Manual scan; 202 Accepted with a job id. Rate-limited to 5 per hour per user. |
The candidate list defaults to showing only candidates a matcher claimed; its empty state offers a switch to the unfiltered view when devices were found but none are claimed.
"Discovery": {
"IntervalSeconds": 300, "CandidateTtlMinutes": 60, "InventoryTtlMinutes": 10080, "MaxCandidates": 1000,
"Mdns": { "ServiceTypes": ["_esphomelib._tcp.local", "_hap._tcp.local", "_googlecast._tcp.local", "_workstation._tcp.local"] }
}
The values shown are the defaults. InventoryTtlMinutes is how long a hardware-inventory row counts as present.
MaxCandidates is a hard cap; the oldest rows are evicted when it is exceeded. Setting Mdns.ServiceTypes to []
disables multicast discovery entirely. The health check reports healthy when the last scan finished within twice the
interval, degraded when it is older or no scan has run.
Traps
| Symptom | Cause and fix |
|---|---|
| Discovery finds nothing on a clustered deployment | Multicast does not traverse pod network overlays. Use the per-node discovery component, put the backend on the host network on a single-node install, or disable the multicast service types and configure instances by hand. |
| Discovery finds devices but the list looks empty | The list defaults to claimed candidates only. Switch to the unfiltered view. |
| The same phone or wearable reappears endlessly as a new candidate | Most modern devices rotate their Bluetooth address every few minutes and cannot be resolved without the bonding key. Dismiss them, or bond the device through the plugin's pairing flow. |
| A matcher never fires despite an obviously matching value | Comparison is equality only. A substring, prefix or pattern will never match. |
| A typeless matcher is shadowed | Typed matchers for that candidate's type are always tried first. Declaration order does not change it. |