-
|
ANSWER: Add endpoints to an aggregator first, then start the server. Never remove & re-add endpoints while running. Apple considers these as removed/new endpoints. I'm having trouble maintaining my Endpoints, which are attached to an AggregatorEndpoint, in the same room in Apple Home. They get re-added to the default room. Similarly, in Google Home, the message that a new device has been added. I keep using the same IDs everywhere. Am I missing something? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 14 replies
-
|
With the info above I can imagine two reasons: Matter.js maintains the structure and endpoint assignment by the "id" you set on the endpoints, so basically this matter.js "internal string based id". In fact you also see the endpoint number in the log. When endpoint numbers increase with every start then likely you somehow mix up. the Ids. 2.) You bring up the node before all existing endpoints are added. So if it happens that you start the node and add endpoints afterwards then the ecosystems see the bridge without the endpoints, so they remove them on their side, then you add them ad so they get readded, but for the ecosystems they are new then. Basically provide a debug level log from matter,js from two starts in a row wit a small shutdown and pause where exactly that effect happened and I can have a look and maybe guess more. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you, as always! ^.^ It seems that #2, starting the server after adding the endpoints, has indeed solved the issue. I would have never figured this out on my own. Thank you so much! |
Beta Was this translation helpful? Give feedback.
-
|
On another note; I often cannot change the Matter.js-paired devices' room in the Apple Home app. It errors with So I wonder if there's something missing in my or Matter.js' implementation to respond to such an event maybe? I would find it strange, because managing rooms shouldn't be part of Matter, but who knows... |
Beta Was this translation helpful? Give feedback.
-
|
Our users have pinpointed when it happens here: athombv/com.athom.matter-bridge#11 (comment) This executes the following code while the server was already running: // uninit
await deviceEndpoint.delete();
// re-init
deviceEndpoint = new Endpoint(BridgedNodeEndpoint, {
id: device.id,
bridgedDeviceBasicInformation: {
nodeLabel: ellipseString(device.name),
vendorName: ellipseString(driver?.ownerName ?? 'Unknown'),
productName: ellipseString(driver?.name ?? 'Unknown'),
serialNumber: ellipseString(device.id.replaceAll('-', '')), // Max length is 32, so if we remove the dashes from the UUIDv4, it fits!
},
});
await this.aggregatorEndpoint.add(deviceEndpoint);Then Apple Home probably thinks it's a new device, regardless of the What would you recommend, @Apollon77 , to re-initiate a device without calling these methods? Maybe remove and re-init all OnOff etc. endpoints from the 'deviceEndpoint' Endpoint? |
Beta Was this translation helpful? Give feedback.
-
|
I cannot seem to figure out how to remove an @Apollon77, maybe you know how? |
Beta Was this translation helpful? Give feedback.
With the info above I can imagine two reasons:
1.) "Endpoint IDs" get somehow mixed up
What exactly you mean with "the same IDs everywhere?
Matter.js maintains the structure and endpoint assignment by the "id" you set on the endpoints, so basically this matter.js "internal string based id". In fact you also see the endpoint number in the log. When endpoint numbers increase with every start then likely you somehow mix up. the Ids.
2.) You bring up the node before all existing endpoints are added. So if it happens that you start the node and add endpoints afterwards then the ecosystems see the bridge without the endpoints, so they remove them on their side, then you add them ad so they get …