Matter Binding (Marketplace, Deprecated)

I just installed from marketplace and that time it worked to start.

1 Like

Right now the best way to use a OTBR is pair the device using an Alexa device and the Alexa app. It will detect the router on your network and prompt for the operation credentials. Once added, you then use Alexa to generate a pairing code and use that with openHAB. Afterwords you can either leave the device paired with Alexa or remove it, it will still remain paired to the router, and connected to openHAB.

Unfortunately you need to use some fairly complicated platform specific APIs on a mobile device as it has to talk Bluetooth to the device as well as communicate to the OTBR. There are few choices out there for this right now.

I do have a prototype IOS app I have been working on that can be used instead, eventually I’ll create an Android one as well. It’s at point where I could probably add it as a ā€œbetaā€ menu option to the official app, it will detect an OTBR and actually grab the credentials from its rest api, so pretty easy to use.

I suspect this is caused by Nanoleaf’s recent firmware update 12.0.3. Nanoleaf hubs keep rebooting / reconnecting to WiFi. More users report the same symptoms.

Now (patiently) waiting for Nanoleaf to fix this.

Pro-Tip: If you have plenty of spare time, and your hobby is re-pairing devices, I recommend you Nanoleaf!

1 Like

Just in case anyone is interested here’s a screen shot of the working IOS thread commissioning app, this will also setup WiFi for non-thread devices . The goal is that you can take a device out of the box and set it up with just openHAB , no vendor specific apps required to setup WiFi or thread . I’ll work on getting something into our test flights builds in the coming weeks .

image

13 Likes

Hi Dan,

After my multiple problems with dependency resolving when installing new versions from the marketplace, I want to come back this time with a positive feedback, something I was almost no more expecting to happen one day, finally it looks like the issue with my Tapo bulb which was disconnecting every few minutes (coming OFFLINE and then ONLINE again) seems to be solved. Probably a bug was fixed in matter.js because the light firmware is unchanged. I am very happy, I will now be able to start really using these matter bulbs and see if controls are reliable on a long period.

That being said, doing new quick (partial) tests with the bulb, I discovered that the color temperature channel is now broken, probably after a change you did. Color temperature commands are apparently working but the channel state is never updated.
Edit: Main UI is showing a slider in the range 0-100, so maybe the retrieval of min/max mirek is broken or the setting of min/max in channel state description.

Here are the logs when my bulb is in white mode and I change the color temperature from the Tapo app:


21:05:36.222 [DEBUG] [nal.controller.MatterControllerClient] - onWebSocketText {"type":"event","message":{"type":"attributeChanged","data":{"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":7,"attributeName":"colorTemperatureMireds"},"version":705135691,"value":331}}}
21:05:36.223 [DEBUG] [nal.controller.MatterControllerClient] - attributeChanged message {"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":7,"attributeName":"colorTemperatureMireds"},"version":705135691,"value":331}
21:05:36.224 [DEBUG] [g.matter.internal.handler.NodeHandler] - AttributeChangedMessage for endpoint 1
21:05:36.224 [DEBUG] [controller.devices.types.LightingType] - OnEvent: colorTemperatureMireds with value 331

Apparently, the change of color temperature is received by the binding but it leads to no change of my linked item.

Now if I set a new color temperature from Basic UI, I can see the change applied to the bulb but the channel state is still unchanged, so command is handled but channel state is not updated:


21:07:45.899 [INFO ] [openhab.event.ItemCommandEvent       ] - Item 'TemperatureAmpouleMatter' received command 8177 K
21:07:45.902 [DEBUG] [controller.devices.types.LightingType] - Handling command for channel: matter:node_7295849862824570778:openhab:ampouleTapo1:1#colorcontrol-temperature-abs
21:07:45.903 [DEBUG] [l.controller.devices.types.DeviceType] - Handling command for channel: matter:node_7295849862824570778:openhab:ampouleTapo1:1#colorcontrol-temperature-abs
21:07:45.904 [DEBUG] [nal.controller.MatterControllerClient] - sendMessage: {"id":"192d1268-73dd-41f1-8535-87778c3220cf","namespace":"clusters","function":"command","args":["7295849862824570778",1,"ColorControl","moveToColorTemperature",{"colorTemperatureMireds":122,"transitionTime":0,"optionsMask":{"executeIfOff":true},"optionsOverride":{"executeIfOff":true}}]}
21:07:46.225 [DEBUG] [nal.controller.MatterControllerClient] - onWebSocketText {"type":"response","message":{"type":"resultSuccess","id":"192d1268-73dd-41f1-8535-87778c3220cf","result":"undefined","error":"undefined"}}
21:07:46.226 [DEBUG] [nal.controller.MatterControllerClient] - result type: resultSuccess
21:07:46.533 [DEBUG] [nal.controller.MatterControllerClient] - onWebSocketText {"type":"event","message":{"type":"attributeChanged","data":{"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":7,"attributeName":"colorTemperatureMireds"},"version":705135693,"value":153}}}
21:07:46.534 [DEBUG] [nal.controller.MatterControllerClient] - attributeChanged message {"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":7,"attributeName":"colorTemperatureMireds"},"version":705135693,"value":153}
21:07:46.536 [DEBUG] [g.matter.internal.handler.NodeHandler] - AttributeChangedMessage for endpoint 1
21:07:46.537 [DEBUG] [controller.devices.types.LightingType] - OnEvent: colorTemperatureMireds with value 153

My item is in UNDEF state permanently.

I see the issue, but i need to think about it a bit, i’m still a little unclear about the relationship between the matter ā€œColorModeā€ attribute, the feature map ā€œcolorTemperatureā€ boolean and then the XY/Hue/Extended Hue support. The matter cluster docs are not exactly clear on this. I could probably easily patch this to work for your tapo system, but i worry i’m changing something i don’t really understand and it will bite me down the road. I’m going to ask for some help on this one when i back from holiday.

No hurry, I can live without the color tempƩrature feature in openHAB. What is the most important is to be able to switch the light on and off reliably.

Can you do me a favor and set the HSB values in openHAB for the bulb first (so red or something), then set the color temperature either in openHAB or the tapo app. What i want to see is when the device changes from using color to temperature if it first sends a colorMode attribute change followed by a colorTemperatureMireds change afterwords. If you could post those logs that would be great. I think i finally may understand how this is suppose to work.

Here are the logs when switching from color mode to white mode using the Tapo app:

06:09:19.515 [DEBUG] [nal.controller.MatterControllerClient] - onWebSocketText {"type":"event","message":{"type":"attributeChanged","data":{"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":0,"attributeName":"currentHue"},"version":705135720,"value":0}}}
06:09:19.516 [DEBUG] [nal.controller.MatterControllerClient] - attributeChanged message {"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":0,"attributeName":"currentHue"},"version":705135720,"value":0}
06:09:19.516 [DEBUG] [nal.controller.MatterControllerClient] - onWebSocketText {"type":"event","message":{"type":"attributeChanged","data":{"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":1,"attributeName":"currentSaturation"},"version":705135720,"value":0}}}
06:09:19.517 [DEBUG] [g.matter.internal.handler.NodeHandler] - AttributeChangedMessage for endpoint 1
06:09:19.517 [DEBUG] [nal.controller.MatterControllerClient] - onWebSocketText {"type":"event","message":{"type":"attributeChanged","data":{"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":7,"attributeName":"colorTemperatureMireds"},"version":705135720,"value":171}}}
06:09:19.517 [DEBUG] [nal.controller.MatterControllerClient] - attributeChanged message {"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":1,"attributeName":"currentSaturation"},"version":705135720,"value":0}
06:09:19.517 [DEBUG] [controller.devices.types.LightingType] - OnEvent: currentHue with value 0
06:09:19.518 [DEBUG] [g.matter.internal.handler.NodeHandler] - AttributeChangedMessage for endpoint 1
06:09:19.518 [DEBUG] [nal.controller.MatterControllerClient] - attributeChanged message {"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":7,"attributeName":"colorTemperatureMireds"},"version":705135720,"value":171}
06:09:19.519 [DEBUG] [controller.devices.types.LightingType] - OnEvent: currentSaturation with value 0
06:09:19.519 [DEBUG] [nal.controller.MatterControllerClient] - onWebSocketText {"type":"event","message":{"type":"attributeChanged","data":{"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":8,"attributeName":"colorMode"},"version":705135720,"value":2}}}
06:09:19.519 [DEBUG] [g.matter.internal.handler.NodeHandler] - AttributeChangedMessage for endpoint 1
06:09:19.520 [DEBUG] [nal.controller.MatterControllerClient] - attributeChanged message {"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":8,"attributeName":"colorMode"},"version":705135720,"value":2}
06:09:19.520 [DEBUG] [controller.devices.types.LightingType] - OnEvent: colorTemperatureMireds with value 171
06:09:19.521 [DEBUG] [g.matter.internal.handler.NodeHandler] - AttributeChangedMessage for endpoint 1
06:09:19.521 [DEBUG] [nal.controller.MatterControllerClient] - onWebSocketText {"type":"event","message":{"type":"attributeChanged","data":{"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":16385,"attributeName":"enhancedColorMode"},"version":705135720,"value":2}}}
06:09:19.521 [DEBUG] [controller.devices.types.LightingType] - OnEvent: colorMode with value COLOR_TEMPERATURE_MIREDS
06:09:19.522 [DEBUG] [nal.controller.MatterControllerClient] - attributeChanged message {"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":16385,"attributeName":"enhancedColorMode"},"version":705135720,"value":2}
06:09:19.522 [DEBUG] [g.matter.internal.handler.NodeHandler] - AttributeChangedMessage for endpoint 1
06:09:19.523 [DEBUG] [controller.devices.types.LightingType] - OnEvent: enhancedColorMode with value COLOR_TEMPERATURE_MIREDS
06:09:20.024 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'AmpouleMatter' changed from 284.8819,68.89764,100 to 0.0,0.0,100

and when doing it using Google Home app:

06:11:51.140 [DEBUG] [nal.controller.MatterControllerClient] - onWebSocketText {"type":"event","message":{"type":"attributeChanged","data":{"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":8,"attributeName":"colorMode"},"version":705135732,"value":2}}}
06:11:51.141 [DEBUG] [nal.controller.MatterControllerClient] - attributeChanged message {"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":8,"attributeName":"colorMode"},"version":705135732,"value":2}
06:11:51.142 [DEBUG] [g.matter.internal.handler.NodeHandler] - AttributeChangedMessage for endpoint 1
06:11:51.142 [DEBUG] [nal.controller.MatterControllerClient] - onWebSocketText {"type":"event","message":{"type":"attributeChanged","data":{"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":16385,"attributeName":"enhancedColorMode"},"version":705135732,"value":2}}}
06:11:51.142 [DEBUG] [controller.devices.types.LightingType] - OnEvent: colorMode with value COLOR_TEMPERATURE_MIREDS
06:11:51.143 [DEBUG] [nal.controller.MatterControllerClient] - attributeChanged message {"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":16385,"attributeName":"enhancedColorMode"},"version":705135732,"value":2}
06:11:51.143 [DEBUG] [g.matter.internal.handler.NodeHandler] - AttributeChangedMessage for endpoint 1
06:11:51.144 [DEBUG] [controller.devices.types.LightingType] - OnEvent: enhancedColorMode with value COLOR_TEMPERATURE_MIREDS
06:11:52.146 [DEBUG] [nal.controller.MatterControllerClient] - onWebSocketText {"type":"event","message":{"type":"attributeChanged","data":{"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":7,"attributeName":"colorTemperatureMireds"},"version":705135734,"value":370}}}
06:11:52.147 [DEBUG] [nal.controller.MatterControllerClient] - attributeChanged message {"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":7,"attributeName":"colorTemperatureMireds"},"version":705135734,"value":370}
06:11:52.148 [DEBUG] [g.matter.internal.handler.NodeHandler] - AttributeChangedMessage for endpoint 1
06:11:52.148 [DEBUG] [controller.devices.types.LightingType] - OnEvent: colorTemperatureMireds with value 370

and when doing it using Basic UI:

06:14:20.572 [INFO ] [openhab.event.ItemCommandEvent       ] - Item 'TemperatureAmpouleMatter' received command 3125 K
06:14:20.575 [DEBUG] [controller.devices.types.LightingType] - Handling command for channel: matter:node_7295849862824570778:openhab:ampouleTapo1:1#colorcontrol-temperature-abs
06:14:20.575 [DEBUG] [l.controller.devices.types.DeviceType] - Handling command for channel: matter:node_7295849862824570778:openhab:ampouleTapo1:1#colorcontrol-temperature-abs
06:14:20.576 [DEBUG] [nal.controller.MatterControllerClient] - sendMessage: {"id":"1564fc4f-4bbd-4ab7-ad73-c8e96bd53470","namespace":"clusters","function":"command","args":["7295849862824570778",1,"ColorControl","moveToColorTemperature",{"colorTemperatureMireds":320,"transitionTime":0,"optionsMask":{"executeIfOff":true},"optionsOverride":{"executeIfOff":true}}]}
06:14:21.081 [DEBUG] [nal.controller.MatterControllerClient] - onWebSocketText {"type":"response","message":{"type":"resultSuccess","id":"1564fc4f-4bbd-4ab7-ad73-c8e96bd53470","result":"undefined","error":"undefined"}}
06:14:21.082 [DEBUG] [nal.controller.MatterControllerClient] - result type: resultSuccess
06:14:21.104 [DEBUG] [nal.controller.MatterControllerClient] - onWebSocketText {"type":"event","message":{"type":"attributeChanged","data":{"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":8,"attributeName":"colorMode"},"version":705135752,"value":2}}}
06:14:21.104 [DEBUG] [nal.controller.MatterControllerClient] - attributeChanged message {"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":8,"attributeName":"colorMode"},"version":705135752,"value":2}
06:14:21.104 [DEBUG] [nal.controller.MatterControllerClient] - onWebSocketText {"type":"event","message":{"type":"attributeChanged","data":{"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":16385,"attributeName":"enhancedColorMode"},"version":705135752,"value":2}}}
06:14:21.105 [DEBUG] [g.matter.internal.handler.NodeHandler] - AttributeChangedMessage for endpoint 1
06:14:21.105 [DEBUG] [nal.controller.MatterControllerClient] - attributeChanged message {"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":16385,"attributeName":"enhancedColorMode"},"version":705135752,"value":2}
06:14:21.105 [DEBUG] [controller.devices.types.LightingType] - OnEvent: colorMode with value COLOR_TEMPERATURE_MIREDS
06:14:21.106 [DEBUG] [g.matter.internal.handler.NodeHandler] - AttributeChangedMessage for endpoint 1
06:14:21.106 [DEBUG] [controller.devices.types.LightingType] - OnEvent: enhancedColorMode with value COLOR_TEMPERATURE_MIREDS
06:14:22.110 [DEBUG] [nal.controller.MatterControllerClient] - onWebSocketText {"type":"event","message":{"type":"attributeChanged","data":{"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":7,"attributeName":"colorTemperatureMireds"},"version":705135754,"value":320}}}
06:14:22.111 [DEBUG] [nal.controller.MatterControllerClient] - attributeChanged message {"path":{"nodeId":"7295849862824570778","endpointId":1,"clusterId":768,"attributeId":7,"attributeName":"colorTemperatureMireds"},"version":705135754,"value":320}
06:14:22.111 [DEBUG] [g.matter.internal.handler.NodeHandler] - AttributeChangedMessage for endpoint 1
06:14:22.112 [DEBUG] [controller.devices.types.LightingType] - OnEvent: colorTemperatureMireds with value 320

I just discovered that you added two new actions, one to list the connected Matter fabrics for a node and one to remove a connected Matter fabric from a device.
And our fabric has now a proper name mentioning openHAB and this is now properly displayed in Google Home app.
Very good.

PS: note that these 2 new actions are not yet included in your documentation.

Dan, in Basic UI, the white color gradient looks like the default gradient for range 100-1000 mirek. It is another sign that min and max mirek are probably no more applied to the channel.

Thanks for the logs, that flow of mode attribute changes followed by temp or color changes now makes sense and is what I now expect after reading over the docs again. The code needs a slight modification and then should work. I have a very long flight this weekend home and will get a fix out along with some other general updates.

In regards to documentation, i have quite a bit of new docs coming, both for users, but also for developers (and specifically code reviewers). I realize there are a lot of moving pieces and complexity (code generation, Typescript Matter Websocket service, Controller binding logic, Bridge binding logic) and want to try and make this easier for others to dive in.

3 Likes

I talked too fast, that is strange but now my Tapo bulb has again the problem of error connection. The difference is now that the thing does not come back to ONLINE when it happens, it remains in state UNKNOWN/NOT_YET_READY waiting for data. Even if the thing is not ONLINE, it looks like it works correctly, I can control it in openHAB.

Yes, i actually noticed this as well, and is on the top of my list to fix, there was a change to use a new API for monitoring node state in the last release, there’s a small bug in handling the order of those events in the Java code. I pulled some logs when it happened to me before i left, so I can review this over the weekend when i have some time. If you pause/un-pause the thing it should go back to a good state.

Might that be something regarding openHAB, rather than the Matter binding? I have the same with a Shelly device (integrated in openHAB with the Shelly binding) which pretty much constantly goes offline and online etc. But I’m always able to control it…

Yes, exactly.

Howsit Dan, Thanks for the info.

Im setting rules in OH just to reset the temps on the Air Conditioner unit to the lowest or highest threshold if a temperature is set thats out of bounds (due to the max and min setpoints not working for now)

eg: if 3°C is chosen in Google Home the OH rules will kick it into 18°C and update googles UI to 18°C

Basically I’m migrating to use Google Home exclusively
now that matter is supported through OH bridge as a backend thanks to you.

I love my extensive sitemaps and automations over the years but am gravitating towards a simpler and more user friendly smart home experience. Keeping my custom light switches, relays and IR transmitters comms over local MQTT to OH. The wife got smart lamps from Xiomi and i spent a weekend trying to integrate them into OH with no luck lol.

Keep well!

Hey Dan, the plug In Unit type is not exposing itself to google Home through the binding (using OH as a bridge), using it for relays (pool pump, geyser fans etc)

Item example Below:

Switch relaymod1relay1 ā€œBedroom Fanā€ {channel=ā€œmqtt:topic:myMQTTbroker:relaymod1:relaymod1relay1thingā€, matter=ā€œPlugInUnitā€}

Cheers!

I have now in the same bedroom a Hue light bulb controlled by the hue binding and a Tapo Matter light bulb controlled by the matter binding that I switch ON or OFF in the same rules, first the Tapo light and immediately after the Hue light.
I can clearly see that the hue bulb is switched on or off before the Tapo bulb. It is very difficult to calculate the delta but it is clearly noticeable, maybe something between half of a second and a second.
Dan, any idea if this additional delay is caused by the matter binding itself or matter.js or the bulb hardware/software ?
I am running OH on a RPI5.