Optional_Event emitter for accessory lifecycle events.
Only available for external accessories published via api.matter?.publishExternalAccessories().
This property is undefined for accessories registered via api.matter?.registerPlatformAccessories().
The event emitter is created automatically when the accessory is published and allows plugins to listen for the 'ready' event (fired when the Matter server starts).
HAP Equivalent: Similar to accessing events on PlatformAccessory._associatedHAPAccessory
const accessory: MatterAccessory = { ... };
api.matter?.publishExternalAccessories('plugin', [accessory]);
// Listen for when the accessory is ready on the network
accessory._eventEmitter?.on(MatterAccessoryEventTypes.READY, (port) => {
console.log(`Accessory ready on port ${port}`);
// Safe to start device integration, polling, webhooks, etc.
});
OptionalclustersInitial cluster states Key is the cluster name, value is an object of attribute name -> value
Known clusters (onOff, levelControl, colorControl, etc.) provide full autocomplete.
Unknown clusters are still supported with the fallback Record<string, unknown> type.
Plugin developer storage - persists across restarts
This is a way for plugin developers to store custom data with their accessory
Similar to PlatformAccessory.context for HAP accessories
Matter device type (e.g., OnOffLightDevice, DimmableLightDevice, etc.)
Display name for the accessory
OptionalfirmwareFirmware revision (optional)
OptionalgetOptional: Get current state handler Called when a Matter controller reads an attribute If not provided, the last set value is returned
Cluster name (e.g., 'onOff', 'levelControl')
Attribute name to read
Current value of the attribute
OptionalhandlersHandlers for Matter commands (Home app -> Device)
These handlers are called when a user controls the accessory via the Home app. Use handlers to send commands to your actual device (cloud API, local network, etc.).
Known clusters (onOff, levelControl, colorControl, etc.) provide full autocomplete for handler method names and argument types.
OptionalhardwareHardware revision (optional)
Manufacturer name
Model name/identifier
OptionalpartsOptional: Array of child endpoints (parts) for composed devices
Use this to create devices with multiple independent subcomponents, such as:
Each part appears as a separate device in the Home app and can be controlled independently.
Example:
parts: [
{
id: 'outlet-1',
displayName: 'Outlet 1',
deviceType: api.matter!.deviceTypes.OnOffOutlet,
clusters: { onOff: { onOff: false } },
handlers: {
onOff: {
on: async (args, context) => {
console.log(`Part ${context.partId} turned on`)
await controlOutlet(1, true)
}
}
}
},
// ... more outlets
]
Serial number for the device
OptionalsoftwareSoftware version (optional)
Unique identifier for this accessory (must be unique across all accessories)
Matter Accessory - Plugin API Interface
This is the main interface that plugin developers use to register Matter accessories with Homebridge.
For composed devices (devices with multiple subcomponents), use the
partsarray to define child endpoints. Each part appears as a separate device in the Home app.