Dart · Library · Apache-2.0

matter_dcl

A Dart package that looks up Matter vendor and product IDs in the CSA's Distributed Compliance Ledger and turns a pair like 4107/8580 into a name: WiZ P45.E27.

View on GitHub View on pub.dev

A Matter device carries two numbers, a vendor ID and a product ID. They appear in its DNS-SD TXT record (VP=4107+8580) or in its Basic Information cluster. Neither number says what the device is. matter_dcl looks both up in the Distributed Compliance Ledger, the public registry of every Matter vendor ID and certified product, which the Connectivity Standards Alliance maintains. One lookup therefore covers every brand.

The package is pure Dart. It runs in Flutter apps, on servers and on the command line.

Install

dart pub add matter_dcl

Flutter apps use flutter pub add matter_dcl instead.

Example

import 'package:matter_dcl/matter_dcl.dart';

final dcl = MatterDcl();

final vendor = await dcl.vendor(0x100B);         // MatterVendor(0x100B, Signify)
final product = await dcl.product(0x100B, 8580); // MatterProduct(4107/8580, WiZ P45.E27)
final name = await dcl.deviceName(0x100B, 8580); // "Signify WiZ P45.E27"

dcl.close();

The example in the package makes one more lookup, and its result is easy to misread:

The matter_dcl example program and its output: vendor 0x1423 prints as Feit, product 4107/8580 as WiZ P45.E27, and the device name as Signify WiZ P45.E27

Vendor 0x1423 comes back as Feit. LIFX lights use the vendor ID of Feit Electric, in the same way that WiZ lights are registered under Signify. The registered company is often a different name from the brand on the box, so the product name should be shown to users wherever it is available.

How it behaves

No lookup throws an exception. An unregistered ID, a timeout and a network error all return null, which means that a pairing screen is protected from a failed lookup. Results are cached, including “not registered”, and a lookup that has failed is tried again on the next call. When two lookups of the same ID are made at the same moment, a single request is shared between them.

The vendor name, the preferred and legal names of the company and its landing page are contained in MatterVendor. The product name and label, the part number, the device type, and the support, product and manual links are contained in MatterProduct. Decimal IDs are required by the REST API of the ledger (0x100B is 4107 in the URL), and this conversion is carried out by the package.

The test ledger can be queried with MatterDcl(baseUri: MatterDcl.testnet), and the default timeout of 3 seconds can be changed with timeout:. A custom package:http client can be passed with the httpClient: option, which is useful together with MockClient in tests.

Limits

A network connection is required. Since the endpoint of the ledger is public and unauthenticated, the cached results should be kept, and IDs should never be looked up in a loop. The names and links are only as complete as the information that each maker has registered.

Licence

Apache 2.0.

Read the announcement: matter_dcl: a Matter device lookup for Dart.

Hear when FirePod goes on saleGet the early-bird price

FirePod isn't on sale yet. Leave your email and we'll write when it is.

FirePod isn't on sale yet. Sign up and the early-bird price comes to your inbox when it is.