Incorporating Matter

Sorry i have missed this thread for so long! I have been casually pursuing a matter strategy for a little while, its probably a good time to share what i’m thinking and how I plan to spend my free time.

this is very tl;dr , just warning ya…

So around Christmas I took a long weekend and was able to get a pure, non android build of the connectedhome (project chip) java client working, the basis of this can be found at https://github.com/project-chip/connectedhomeip/tree/master/examples/java-matter-controller, although i had to make a few tweaks.

While i did manage to get this working after a few long days, the road was not easy and it discovered many issues which ultimately led me to abandon using the main connectedhomeip (chip) project at all. Some of the issue i encountered:

  1. Thee project is painful to build, i mean really painful. I had to make several tweaks to the Make files to get this working, hand build several sub modules and dependent sub modules, and other build related changes, this is for the pure java version. Now, this could probably fixed with more time spent hardening the build and Make files, but thats no small feat. For anyone else who wants to try, I strongly recommend using their container (docker) based build system, trying to do it manually is difficult.

  2. Building anything in the project requires a full build of mostly everything…which is a lot! See point 3.

  3. The project is HUGE, the source alone is gigantic, by the time you download and build your working directory is over 20G+. This also means builds are SLOW…

  4. The project is not entirely cross platform, it really wants to run on unix/linux/android and not windows. Not a problem for my system, but thinking about this for our community it seems like an issue. Also not all architectures are supported for the sub projects or example applications. This of course can be fixed through changing the build system / Make files in most cases, but that actually proved difficult ( i had a x86 build, was trying to get arm working which was not supported in the java app out of the box)

  5. The actual Java example app was buggy and missing a lot of features. In fact i experienced many issues which seem to plague some of the other CLI and wrapper apps, so i was not convinced this was strictly an issue with the Java example app.

  6. Its not clear that the non core example apps and libraries will be maintained over time. Development is sporadic on them, the main focus of this project is really around hardware manufacturers and embedded devices.

So again, i left with a pretty bad taste in my mouth, the idea of trying to maintain an integration using a java wrapper around the main project was not something i was interested in doing, and i think would be a maintenance nightmare over time.

So, i started to look else where… and found another project written in pure Typescript.

This was interesting to me as we have a very high performance Javascript runtime engine in our core based on Graalvm. Looking more into this project reveled a lot of positives as a potential candidate…in fact i would say it almost seemed designed to be embedded and checked a lot of boxes for me. The main developer is actually a member of the ioBroker project, another home automation system.

  1. The code is clean, easy to read, easy to build, easy to run.

  2. The project is split into 2 modules, a pure Typescript core and then a NodeJS implementation which provides the native bits for running like network, storage and crypto. This is done in a clean and pluggable architecture.

  3. It implements both a server and client , so not only can we control matter devices, we can expose local devices to other matter servers (like Alexa, Google Home or Apple Home).

  4. Very, very active project

  5. I was able to contribute and have my first PR accepted quickly :wink:
    Implements ManualPairingCodeSchema.decodeInternal() by digitaldan · Pull Request #124 · project-chip/matter.js · GitHub , try that with the main chip project!

  6. The project has been adopted by the project-chip organization and lives in their github space, but is not run by the very big guys (apple, google, amazon, zensys) . This is actually a big deal, and really legitimizes the importance of this project, but still makes it easy to work with.

The lead dev and i have had a few conversations about this integration and he was very positive about supporting us and this use case, even suggesting we contribute a Java implementation to the project.

My plan is to get a proof of concept working, which requires loading the matter.js core along with a small sample typescript app and then providing it with Java implementations of the required network, storage and crypto , which so far seems very doable.

This is also still in the prototype / discovery phase, so of course lots could go wrong, and maybe it won’t work, but i’m optimistic about it.

The only thing holding me back right now is time. Life has become very busy for me and i have not been able to break away and work on openHAB related stuff which has been super disappointing.

26 Likes