Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregator Device not showing properly and Device Type is showing as TYPE_UNKNOWN #220

Open
mahadev-0007 opened this issue Sep 15, 2024 · 0 comments

Comments

@mahadev-0007
Copy link

I made a aggregrator endpoint device (Bridge Node) with matter.js and the device connects but device type is not recognised and functions are not showing properly

But I made an onOff light and it works perfectly

Aggregrator Code ------

const server = await ServerNode.create({
    // Required: Give the Node a unique ID which is used to store the state of this node
    id: uniqueId,

    // Provide Network relevant configuration like the port
    // Optional when operating only one device on a host, Default port is 5540
    network: {
      port: port,
    },

    // Provide Commissioning relevant settings
    // Optional for development/testing purposes
    commissioning: {
      passcode: passcode,
      discriminator: discriminator,
    },

    // Provide Node announcement settings
    // Optional: If Ommitted some development defaults are used
    productDescription: {
      name: productName,
      deviceType: AggregatorEndpoint.deviceType,
    },

    // Provide defaults for the BasicInformation cluster on the Root endpoint
    // Optional: If Omitted some development defaults are used
    basicInformation: {
      vendorName,
      vendorId: VendorId(vendorId),
      nodeLabel: productName,
      productName,
      productLabel: productName,
      productId,
      serialNumber: `matterjs-${uniqueId}`,
      uniqueId,
    },
  });

  const aggregator = new Endpoint(AggregatorEndpoint, { id: "aggregator" });

  await server.add(aggregator);

  const name = `OnOff Socket 1`;

  const endpoint = new Endpoint(
    OnOffPlugInUnitDevice.with(BridgedDeviceBasicInformationServer),
    {
      id: `onoff-socket-1`,
      bridgedDeviceBasicInformation: {
        nodeLabel: name,
        productName: name,
        productLabel: name,
        serialNumber: `node-matter-5678-3`,
        reachable: true,
      },
    }
  );
  await aggregator.add(endpoint);

  endpoint.events.identify.startIdentifying.on(() => {
    console.log(
      `Run identify logic for ${name}, ideally blink a light every 0.5s ...`
    );
  });

  endpoint.events.identify.stopIdentifying.on(() => {
    console.log(`Stop identify logic for ${name} ...`);
  });

  endpoint.events.onOff.onOff$Changed.on((value) => {
    executeCommand(value ? `on${i}` : `off${i}`);
    console.log(`${name} is now ${value ? "ON" : "OFF"}`);
  });

  await server.start();

Is there any problem with the device type I am mentioning or this app havent implemented bridge yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant