homebridge/homebridge · error

${pluginIdentifier}: All ${accessories.length} Matter access

Error message

${pluginIdentifier}: All ${accessories.length} Matter accessories failed validation

What it means

registerPlatformAccessories in MatterAPIImpl logs an error and returns when every accessory in the call failed validateMatterAccessory (validAccessories.length === 0). Nothing is registered. All passed objects were structurally invalid, not just one — typically missing UUID, displayName, or a valid Matter device type.

Source

Thrown at src/matter/MatterAPIImpl.ts:297

    platformName: PlatformName,
    accessories: MatterAccessory[],
  ): Promise<void> {
    if (accessories.length === 0) {
      log.warn(`${pluginIdentifier}: Attempted to register 0 Matter accessories`)
      return
    }

    this.assertMatterReady(`${pluginIdentifier}: Cannot register Matter accessories`)

    // Validate all accessories before registration
    const validAccessories = this.validateAccessories(
      accessories,
      `registerPlatformAccessories (${pluginIdentifier}/${platformName})`,
    )

    if (validAccessories.length === 0) {
      log.error(`${pluginIdentifier}: All ${accessories.length} Matter accessories failed validation`)
      return
    }

    if (validAccessories.length < accessories.length) {
      log.warn(
        `${pluginIdentifier}: ${accessories.length - validAccessories.length} of ${accessories.length} Matter accessories failed validation`,
      )
    }

    // Split accessories into normal (bridge) and external (standalone) based on device type
    const normalAccessories: MatterAccessory[] = []
    const externalAccessories: MatterAccessory[] = []

    for (const accessory of validAccessories) {
      if (requiresExternalBridge(accessory.deviceType)) {
        externalAccessories.push(accessory)
      } else {
        normalAccessories.push(accessory)
      }

View on GitHub (pinned to edf5493034)

Solutions

  1. Read the validator's per-accessory logs to see which required fields are missing.
  2. Construct accessories with the documented MatterAccessory shape and a device type helper (e.g. api.matter.switch.*).
  3. Pass MatterAccessory objects, not HAP PlatformAccessory objects.
  4. Align plugin and Homebridge versions so device-type helpers exist.

Example fix

// before
const accs = devices.map(d => ({ name: d.name }))
api.matter.registerPlatformAccessories(plugin, platform, accs)
// after
const accs = devices.map(d => ({
  UUID: hap.uuid.generate(d.id),
  displayName: d.name,
  ...api.matter.switch.createSwitchDevice(),
}))
api.matter.registerPlatformAccessories(plugin, platform, accs)
Defensive patterns

Strategy: type-guard

Validate before calling

function isWellFormedAccessory(a: unknown): boolean {
  const x = a as Partial<MatterAccessory>
  return typeof x.UUID === 'string' && typeof x.displayName === 'string' && x.device !== undefined
}
const accs = devices.map(toMatterAccessory).filter(isWellFormedAccessory)

Type guard

function isMatterAccessory(a: unknown): a is MatterAccessory {
  return (
    typeof a === 'object' && a !== null &&
    typeof (a as any).UUID === 'string' &&
    typeof (a as any).displayName === 'string' &&
    (a as any).device !== undefined
  )
}

Try / catch

try {
  await api.matter.registerPlatformAccessories(plugin, platform, accs)
} catch (err) {
  log.error('Matter registration failed', err)
}

Prevention

When it happens

Trigger: 1) Plugin passes plain objects missing required MatterAccessory fields. 2) HAP-style PlatformAccessory objects passed to the Matter API. 3) Device-type helpers misused so deviceType is undefined for all accessories.

Common situations: Plugins ported from HAP code paths; custom device objects missing required metadata; api.matter.switch.* helpers used incorrectly.

Related errors


AI-assisted analysis of homebridge/homebridge@edf5493034 (2026-08-30). Data as JSON: /api/errors/20b4190d812766f0. Report an issue: GitHub.