Matter Controller - UPDATE

I've published an update to node-red-matter-controller (node) - Node-RED with some significant improvements from contributors.

Firstly things should be a lot more stable, we're now catching most errors which should avoice node-red being in a restart loop.

Secondly thanks to @hardillb you can now directly commision devices via BLE onto your Thread or WiFi networks, this assumes you're running node-red on hardware with BLE on board, so far we've tested with Raspberry Pis so please feedback on other devices, I suspect this will be beyond the reach for Docker based instances for a while yet.

Finally there's an update to Matter.js 0.17.9 which brings a load of stablity and cluster support improvements that should be carried through.

The next change is to. move to matter.js 0.18.0 which has a brand new controller implementation but I wanted to get something as current as possible out with the old model before i attempt the switch.

As always I'd reccomend taking a backup of your system including the matter storage before attempting this update and also testing on a dev system before deploying to your production home, so as to avoid the wrath of family members :slight_smile:

If you're also running my node-red-matter-bridge on the same device please make sure you update that to 0.14.2 before trying the ble commisioning in this pacakge otherwise you'll have issues with the shared matter.js environment

I am obviously not doing something correctly.

I have loaded the Device Management Node, I have selected the Storage Location and not entered anything else, mostly as I have no idea what is required. (I did try the WiFi SSD & password of my network but it made no difference)

I then went to (I tried both Google Home & Alexa as they both chat to the device) add another assistant, got the 11 numbers and entered them into the node Pairing Code field (along with the device name) inject nothing and got an error code "Failure (Code 1).

I tried using msg.code & msg.label in the inject node (after change the entries in the Management node) with the same result.

What I am doing wrong, and if I need to complete any of the missing fields what am I supposed to put in them?

The annoying thing is that I did once have this working. (many months ago)

@Buckskin
So this depends if the matter device has already been commisioned to another controller like alexa or apple first.

The 11 digit code printed on the device will work for first time commisioning (or after a full reset) the first controller that you add the device to will also take care of sending the WiFi or Thread network details to the device over Bluetooth.

Once the device is on the Wifi/Thread network and has been commisioned to a controller that printed code won't work again, you need to go into the controller and set pairing mode on the device which will give you a new random code and open the pairing window on the device for ?15min.
You can then send that code as a commisioning message to the node-red matter controller.
Node red will then commision the device to its controller over the IP network without any bluetooth or updating of WiFi/Thread.

In previous versions the node red controller didn't support bluetooth so it always had to be a second controller, since 0.2.0 the node-red controller can act as the initial controller and send the wifi or thread credentials to the device over BLE.
This is enabled if you setup either one or both credentials (matter devices generally support thread or wifi not both)
If you don't set the network details it will still work for on-network commisioning in the usual way.

If you're still having issues put the controller into info level logging (debug is too noisey!) and try the commissioning again then send me the log.
Also let me know the device you're trying and where node-red is running.

I have a Raspberry 5 with Trixie and Node-red 5.09. The device is a Sonoff Mini R4 (which, as far as I know, does NOT have BLE) so I am just trying to add the Control to Alexa (I also tried Google Home). The node is set up as shown below (and the MatterController as shown in previous message)

I hope these are the corect logs

2026-11-06 19:33:43.467 INFO   Discovery            Initiating discovery of node with discriminator 2
2026-11-06 19:33:43.533 INFO   CommissioningClient  Operational address for undefined set to udp://[fe80::5632:4ff:fe8d:396c%eth0]:5540, udp://[fdbd:5d55:614f:0:5632:4ff:fe8d:396c]:5540, udp://[2a02:8013:78d8:0:5632:4ff:fe8d:396c]:5540, udp://192.168.1.69:5540
2026-11-06 19:33:43.534 INFO   Endpoint             a410c5e06912f1f4.peer1 ready endpoint#: 0 type: RootNode (0x16) behaviors: 💤parts ✓index ✓commissioning ✓network
2026-11-06 19:33:43.543 INFO   Controller~missioner Establish PASE to device DT: 0 PH: 36 ICD: 0 VP: 4897+2 RI: 47009E818F0940A9C68C43FD9B51EE4E2AB9 PI:
2026-11-06 19:33:44.361 INFO   PaseClient           Paired successfully » udp://192.168.1.69:5540 6↔3
2026-11-06 19:33:44.363 INFO   Session              •unsecured#d17a516c22f50bdc Session ended
2026-11-06 19:33:44.366 INFO   Controller~missioner Start commissioning of node @1:1 into fabric 3946470293378020379
2026-11-06 19:33:44.367 INFO   Controller~missioner Skipping NetworkCommissioning steps because the device is already on IP network (udp)
2026-11-06 19:33:44.368 INFO   Controller~missioner Executing commissioning step 0.1: GetInitialData
2026-11-06 19:33:44.371 INFO   ClientInteraction    Read » @0:0•b2cf⇵7960 attributes: 0.operationalCredentials.*, 0.descriptor.*, 0.basicInformation.*, 0.generalCommissioning.*
2026-11-06 19:33:44.402 INFO   ClientInteraction    Read « @0:0•b2cf⇵7960 attributes: 8 events: 0
2026-11-06 19:33:44.404 INFO   ClientInteraction    Read » @0:0•b2cf⇵7961 attributes: *.networkCommissioning.*, *.otaSoftwareUpdateRequestor.*
2026-11-06 19:33:44.446 INFO   ClientInteraction    Read « @0:0•b2cf⇵7961 attributes: 3 events: 0
2026-11-06 19:33:44.447 INFO   Controller~missioner Executing commissioning step 7.1: GeneralCommissioning.ArmFailsafe
2026-11-06 19:33:44.448 INFO   ClientInteraction    Read » @0:0•b2cf⇵7962 attributes: 0.generalCommissioning.*
2026-11-06 19:33:44.461 INFO   ClientInteraction    Read « @0:0•b2cf⇵7962 attributes: 1 events: 0
2026-11-06 19:33:44.464 INFO   ClientInteraction    Invoke » @0:0•b2cf⇵7963 0.generalCommissioning.armFailSafe with breadcrumb: 1 expiryLengthSeconds: 60
2026-11-06 19:33:44.481 INFO   ClientInteraction    Invoke « @0:0•b2cf⇵7963 0.generalCommissioning.armFailSafe errorCode: 0 debugText:
2026-11-06 19:33:44.482 INFO   Controller~missioner Executing commissioning step 8.1: GeneralCommissioning.ConfigureRegulatoryInformation
2026-11-06 19:33:44.482 INFO   ClientInteraction    Read » @0:0•b2cf⇵7964 attributes: 0.generalCommissioning.*
2026-11-06 19:33:44.540 INFO   ClientInteraction    Read « @0:0•b2cf⇵7964 attributes: 1 events: 0
2026-11-06 19:33:44.542 INFO   ClientInteraction    Invoke » @0:0•b2cf⇵7965 0.generalCommissioning.setRegulatoryConfig with breadcrumb: 1 newRegulatoryConfig: 0 countryCode: UK
2026-11-06 19:33:44.559 INFO   ClientInteraction    Invoke « @0:0•b2cf⇵7965 0.generalCommissioning.setRegulatoryConfig errorCode: 0 debugText:
2026-11-06 19:33:44.560 INFO   Controller~missioner Executing commissioning step 8.2: TimeSynchronization.SynchronizeTime
2026-11-06 19:33:44.561 INFO   Controller~missioner Executing commissioning step 10.1: OperationalCredentials.DeviceAttestation
2026-11-06 19:33:44.562 INFO   ClientInteraction    Invoke » @0:0•b2cf⇵7966 0.operationalCredentials.certificateChainRequest with certificateType: 1
2026-11-06 19:33:44.577 INFO   ClientInteraction    Invoke « @0:0•b2cf⇵7966 0.operationalCredentials.certificateChainRequest certificate: 308201dd30820183a003020102021100f52debaa846b88009380c56b7745be57300a06082a8648ce3d0403023033311b301906035504030c12436f6f6c6b6974204d61747465722050414931143012060a2b0601040182a27c02010c04313238363020170d3233303632363030353432335a180f32313138303630333031353432335a3049311b301906035504030c12436f6f6c6b6974204d61747465722044414331143012060a2b0601040182a27c02010c043132383631143012060a2b0601040182a27c02020c04303030323059301306072a8648ce3d020106082a8648ce3d03010703420004970ed683b45e19d17cfb2d550230bc4ecdebf05d3576f2698120b39048c203c565bf76b67c33463edd6d2ec77b18e7e0e84671a91e459c528b8730e24e7b25daa360305e300c0603551d130101ff04023000301f0603551d23041830168014cfca5d203cefa8030bdbe9eadfee218da2063399301d0603551d0e04160414280914508b0bfa6c4ab7bfe7845de47980fcbf94300e0603551d0f0101ff040403020780300a06082a8648ce3d040302034800304502202908dbda6163f724f10a769162bf42a28c1b90ac25971d0bff1e74169497f96902210083c5fd80e5015ca83f8187389fd2c02e6b7f80d9c09356019e3a1f06022dc6c7
2026-11-06 19:33:44.579 INFO   ClientInteraction    Invoke » @0:0•b2cf⇵7967 0.operationalCredentials.certificateChainRequest with certificateType: 2
2026-11-06 19:33:44.594 INFO   ClientInteraction    Invoke « @0:0•b2cf⇵7967 0.operationalCredentials.certificateChainRequest certificate: 308201cc30820173a003020102021100acc5db760718520dea317b9590f6985e300a06082a8648ce3d0403023033311b301906035504030c12436f6f6c6b6974204d61747465722050414131143012060a2b0601040182a27c02010c04313238363020170d3233303230333030333330315a180f32313139303830333031333330315a3033311b301906035504030c12436f6f6c6b6974204d61747465722050414931143012060a2b0601040182a27c02010c04313238363059301306072a8648ce3d020106082a8648ce3d03010703420004e73af7037248aa7a2e1ac9127585323f6a1c7ead87a0414a84c167d763b6b8c44d45b5225374c7df715765019c7e9f0acedd86188caac333227d97772eff96d5a366306430120603551d130101ff040830060101ff020100301f0603551d23041830168014d2cc1924a887c77da6ef95c95edebccc553a5ebe301d0603551d0e04160414cfca5d203cefa8030bdbe9eadfee218da2063399300e0603551d0f0101ff040403020106300a06082a8648ce3d04030203470030440220198c2cda5baf92082501ec2ad35c05126599b822ced1cbdfa048898b820f6eab02205da2d1bd29fc5b80b7db50b1ffd46ba8cd5da198eb604fcdea427c2e560a36ca
2026-11-06 19:33:44.596 INFO   ClientInteraction    Invoke » @0:0•b2cf⇵7968 0.operationalCredentials.attestationRequest with attestationNonce: a93c1c6a79ac8847b103f6ffd52f748d0a05e4fff8da143c6cb2528b66f91536
2026-11-06 19:33:44.674 INFO   ClientInteraction    Invoke « @0:0•b2cf⇵7968 2↔1 0.operationalCredentials.attestationRequest attestationElements: 153001f23081ef06092a864886f70d010702a081e13081de020103310d300b0609608648016503040201304a06092a864886f70d010701a03d043b1524000125012113360204021825030a012c041343534132363032354d415434393438352d323424050024060024070124080225098612240a0218317e307c0201038014fe343f959947763b61ee4539131338494fe67d8e300b0609608648016503040201300a06082a8648ce3d04030204483046022100a104aa45eeb2b0906776edbfd4f4779763a47c3903e3cc89f09e73a0ff5a4bf702210087038f7fb310634a77f35344d8fa6bce8d34a38cc078ca3f3fc777c91c872738300220a93c1c6a79ac8847b103f6ffd52f748d0a05e4fff8da143c6cb2528b66f9153624030018 attestationSignature: d9c3c1df070a9e8ce79b933d73a5dd44b798b3d43842906d721499929045027a64fc440e21ed2f379fd9e5bbd1cb020c1c8da04fa354d08724a514796be5ce4c
2026-11-06 19:33:44.681 WARN   Controller~missioner Attestation finding accepted for backward compatibility: DclServiceUnavailable DclCertificateService not available; skipping PAA trust store, chain, and revocation checks. Register DclCertificateService in the environment for full attestation.
2026-11-06 19:33:44.681 WARN   Controller~missioner Attestation finding accepted for backward compatibility: CdSignerVerificationSkipped No DclCertificateService provided; skipping CD signature verification
2026-11-06 19:33:44.681 INFO   Controller~missioner Device attestation successfully verified with 2 accepted finding(s)
2026-11-06 19:33:44.682 INFO   Controller~missioner Executing commissioning step 11.1: OperationalCredentials.Certificates
2026-11-06 19:33:44.684 INFO   ClientInteraction    Invoke » @0:0•b2cf⇵7969 0.operationalCredentials.csrRequest with csrNonce: 55edbb655714cc5bf23a0807a5b9adec2def844cf0871819423bfbd7c954e2ce
2026-11-06 19:33:44.877 INFO   ClientInteraction    Invoke « @0:0•b2cf⇵7969 2↔1 0.operationalCredentials.csrRequest nocsrElements: 153001cc3081c93070020100300e310c300a060355040a0c034353523059301306072a8648ce3d020106082a8648ce3d030107034200047ee18c41ecc6f1723a9921bcec205c220d8fea057d2ccaf67a67cabe48a02c3be3349db1da301f50538c23ab2df395c4cc9c4ac07ac4cedb2f9affb283f48538a000300a06082a8648ce3d0403020349003046022100d9550b85f99e56d84fc7d3e3cbcbc1befb7a05c29684f7063af8f3fb5a3a920902210087322b77e4e2e26a4b0fe2c0837dc1d391ac6b8dec0d805c03294a5806d0849d30022055edbb655714cc5bf23a0807a5b9adec2def844cf0871819423bfbd7c954e2ce18 attestationSignature: 2416a8c69d10b479b86da7882d9c66c9e53f96624d52df34de885ed1aa4c488208455c1c1067489cc6eb57079646486a7d15512036971ca5a4aba32931bf444a
2026-11-06 19:33:44.885 INFO   ClientInteraction    Invoke » @0:0•b2cf⇵796a 0.operationalCredentials.addTrustedRootCertificate with rootCaCertificate: 1530010100240201370324140018260420139d302605a0494a4537062414001824070124080130094104bc31c916f55b6bfdc8c30bc327a26d86f341e20d267e95a4b6846ccbafea2f387f1f9a4de9b74cfe226ddd2ba362ec5a7b550235b874f7db8c7fd5762552f959370a35012901182402603004148d2ee344a6a270c5319ab5c44767b5c9f4953dc93005148d2ee344a6a270c5319ab5c44767b5c9f4953dc918300b400c349d09348e4cad752c73f66332bb2d62774cf390927978ce19dd96d5decbaa40470baf284e379f461d0a6d0a07558410f36996c3a20020cc45e8d855997f7118
2026-11-06 19:33:45.101 INFO   ClientInteraction    Invoke « @0:0•b2cf⇵796a 2↔1 0.operationalCredentials.addTrustedRootCertificate status: Failure (1)
2026-11-06 19:33:45.102 ERROR  Controller~missioner Commissioning step 11.1: OperationalCredentials.Certificates failed with error: [failure] Failure (code 1) (terminating commissioning)
2026-11-06 19:33:45.103 INFO   ClientInteraction    Invoke » @0:0•b2cf⇵796b 0.generalCommissioning.armFailSafe with breadcrumb: 2 expiryLengthSeconds: 0
2026-11-06 19:33:45.127 INFO   ClientInteraction    Invoke « @0:0•b2cf⇵796b 0.generalCommissioning.armFailSafe errorCode: 0 debugText:
2026-11-06 19:33:45.129 INFO   Session              @0:0•b2cf Session ended
6 Nov 19:33:45 - [error] [mattermanager:Device Commission] Error: Failure (code 1)

@Buckskin This looks like an issue with the Sonnoff device failing at the latter stages of commisioning when it tries to store the controllers certificate.

The most likely cause is that the device does not have space for another controller fabric, some devices only support 5 fabrics, if you've commisioned it into multiple fabrics and/or other attempts with node-red it could still have those in there, I'd suggest doign a factory reset on the device and then commisioning it to just one controller like alexa and then adding node-red as the 2nd controller.

I've got one of those Mini R4Ms running in my setup fine, I can't remember if it has the matter code printed on the device itself or if you have to enable Matter from the eWe link app first and get the code there, if its the latter then it might not have BLE as it relies on the eWe link app to get it onto WiFi and then does matter commisioning as on-network.
Unfortunatly mines screwed into an enclosure box and not easy to access to check!

Amazing, thank you so much, that was the problem.

If anyone else has this problem;

  • I removed the device from Google, Alexa and eWeLink
  • Factory reset (Press the button for 5 secs)
  • Added the device to Alexa using the QR code on the device
  • Went to 'other assistants and apps' in Alexa and generated the link code
  • Added the code and label into the Device Management node and injected a blank msg. This completed the pairing with no further issues.
  • I then add the pairing from Alexa to Google.

To get eWelink back I pressed the button on the device to link again and added the device to eWeLink (ignore the request for 2.4Ghz connection). All other links remained working.

I have found that some of the commands etc. have changed since I last had the device connected to Node-RED but I am now a happy bunny.

That is one of the reasons I wrote it up, so I can find it next time - in a couple of years :laughing:

Changes noticed were the end point names, startUpOnOff for example used to be power-on behaviour.

I had to guess the device ID (1) in my case because I couldn't find where to get the info from.

When you say endpoint names do you mean the attributes you could read?

I don't think they should have changed, they're discovered automatically from the device via the matter.js library which is generated from the matter spec doc, and I don't think matter have renamed attributes, I'd need to compare the different spec versions though.

Where were you needing the device id? Thats a persistent ID for the lifetime the device is commissioned you can discover it with the list devices command in the device management node,

Yes, I am sure that startUpOnOff used to be power-on behaviour, but I could easily be wrong.

Describe Device, Get Device - etc.

I realised after I had used '1' as the Device ID that listing the devices had indeed given me this ID - I just hadn't believed it.

One strange thing I have noticed; I want to write to the OnOff attribute startUpOnOff but when using the Write Attribute node and selecting the cluster OnOff the Attribute entry shows 'no writable attributes available'. If I change the Attribute entry to msg.payload.attribute and the params entry to msg.payload.value (for example) and inject with attribute = 'startUpOnOff' and value = '1' the startUpOnOff of the device attribute is written to. Why is the attribute not shown in the dropdown?