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

[Discussion] Implementing Matter #3228

Open
lboue opened this issue Sep 11, 2022 · 13 comments
Open

[Discussion] Implementing Matter #3228

lboue opened this issue Sep 11, 2022 · 13 comments

Comments

@lboue
Copy link

lboue commented Sep 11, 2022

Current Situation

Phillips has announced that they will update their Hue Bridge V2 to add compatibility with the Matter protocol in December 2022.
Philips Hue Will Support “Matter” https://www.smarthomepoint.com/philips-hue-matter-support-new-video/

In the same way it would be interesting to reuse the existing Homekit plugins and to be able to announce these devices in the Matter over IP network.
In fact, in this way, all the Matter compatible objects in the house can communicate together no matter the manufacturer.

Proposed Change

Here is an example of a bridge available in the Matter SDK:

CHIP Linux Bridge Example
An example demonstrating a simple lighting bridge and the use of dynamic endpoints. The document will describe the theory of operation and how to build and run CHIP Linux Bridge Example on Raspberry Pi. This doc is tested on Ubuntu for Raspberry Pi Server 20.04 LTS (aarch64) and Ubuntu for Raspberry Pi Desktop 20.10 (aarch64)

Do you think that would be feasible?

You can install a Matter profile for IOS 15 and 16 to add Matter compatibily.

@MoTechnicalities
Copy link

MoTechnicalities commented Sep 12, 2022

This is a great idea. Except that most plugins are created by individuals, many being incomplete and needing a lot of work. Still, generally speaking, it would be nice to be able to bring products like Ring and WiZ into Matter if these companies don't intend to introduce their own bridges.

@Neirth
Copy link

Neirth commented Sep 18, 2022

Personally, I think it is a very good opportunity to explore the option of adding native Matter support to the project, this would de facto make Homebridge one of the most complete device hubs on the market, with out-of-box support for devices that we were previously having enough problems in porting and/or maintaining, the different confirmations are happening throughout these days by the brands. I imagine that this will be the trend until the official launch of the protocol.

On the other hand, the great voice assistants have also confirmed support for Matter, so it will greatly simplify the work involved in integrating these technologies through plugins to the project.

TD;LR: Apple confirmed a while ago that if the device in question was compatible with Homekit it would be compatible with Matter, I understand that soon they will present us with updates in the proprietary protocol of Homekit, perhaps making it somewhat more open due to requirements of the standard . It's just a hypothesis.

@lboue
Copy link
Author

lboue commented Sep 19, 2022

TD;LR: Apple confirmed a while ago that if the device in question was compatible with Homekit it would be compatible with Matter, I understand that soon they will present us with updates in the proprietary protocol of Homekit, perhaps making it somewhat more open due to requirements of the standard . It's just a hypothesis.

I'm not sure about that. Matter and HomeKit over BLE are 2 different protocols

For information, a new home-assistant lib is in development:
Python Matter Server. This project implements a Matter (formerly Home Assistant Connected Home over IP or CHIP) Controller Server using WebSockets.

The Matter Python REPL is a native IPython shell environment loaded with a Python-wrapped version of the C++ Matter stack to permit interacting as a controller to other Matter-compliant devices.

REPL Basics: This goes over the basics of interacting with the REPL.

@NorthernMan54
Copy link
Contributor

For reference current Homebridge Architecture

               Home App
                   |
               HomeKit HAP Interface ( HomeKit Accessory Protocol )
                   |
              -----------------
              | HAP-NodeJS    |
              -----------------
              | Homebridge    |
              -----------------
              | Plugin        |
              -----------------
                   |
                Vendor Device API
                   |
                Vendor Device

For what we are discussing, adding the Matter interface in addition to the existing HAP Interface would be a change to HAP-NodeJS and not Homebridge.

@Neirth
Copy link

Neirth commented Sep 20, 2022

I'm not sure about that. Matter and HomeKit over BLE are 2 different protocols

@lboue, I attach the developer page of Apple telling about the HomeKit/Matter support: https://developer.apple.com/apple-home/matter/. I hope this can solve your doubts about what I mentioned above.

@adriancable
Copy link

adriancable commented Sep 25, 2022

@Neirth - I think your interpretation of that page isn't what Apple are actually saying.

As said earlier, HomeKit and Matter are separate, unrelated protocols. It is not true what you state that "if the device in question was compatible with Homekit it would be compatible with Matter". The article you link to states that the iOS HomeKit API (i.e. the 'HomeKit framework') is being extended to work transparently with Matter devices. This means, for example, that an iOS app that already implements HomeKit support won't need (many) changes to also work with Matter devices. But, this doesn't have any bearing whatsoever on the device side (e.g. Homebridge/HAP-NodeJS). Devices do not have any awareness of, any connection with, or use the iOS HomeKit framework. They 'talk HomeKit' directly and this is as different from 'talking Matter' as English and Chinese. There is no HomeKit/Matter compatibility layer on the device side, just like there is no English/Chinese compatibility layer when speaking.

HAP-NodeJS would need a complete rewrite to support Matter. It would also need to continue to support HomeKit in parallel to avoid a major feature downgrade (since a lot of HomeKit e.g. cameras are not supported at all in Matter). Not impossible, but probably (as a 'spare time project') not coming soon.

@github-actions github-actions bot added the stale label Oct 26, 2022
@homebridge homebridge deleted a comment from github-actions bot Oct 26, 2022
@donavanbecker
Copy link
Contributor

I don't think we would want to rewrite HAP-NodeJs, but would want to give an option of using HAP-NodeJS or Matter within Homebridge.

If someone wants to give it a try and implement it into Homebridge, we could look at merging it into Homebridge.

@Apollon77
Copy link

Hi,

I'm one of the matter.js developers. We are in the middle of a bigger code merge and cleanups and also implement a High level API right now ... so we might not be ready now (but "soon") for such a topic and we also miss some Cluster definitions (aka Services in homekit), so if someone want to think about that we also search for contributors :-)

In fact Clusters (aka Homekit Services) are a bit different then Homekit, so mid term the question in my eyes is if not a "matterbridge" project would make more sense that uses comparable plugin structure like homebridge and bases e.g. on matter-node.js (our nodejs package that uses matter.js for putre JS basics). Then plugin devs could - with affordable efforts - recreate their plugins for the Matter structure ... but honestly I personally do not really see a 100% mapped approach. (But maybe I'm too deep in to see the options ... ) ;-)

Matter uses beside Cluster attributes (aka Characteristics) also a lot of "commands" that then execute logic (e.g "dim the light within 5seconds with effect X" and such) what homekit do not really have.

I also started a Discord at https://discord.gg/ujmRNrhDuW for "Matter integrators". So if someone wants to discuss or know more. Join there and contact me.

Ingo

@NebzHB
Copy link
Contributor

NebzHB commented May 23, 2023

Why not having a plugin like homebridge-matter that works like homebridge-gsh or homebridge-alexa to send everything into matter ? that would make sense and re-uses all the effort the community set in the plugins

@draco1544
Copy link

Any news on that ?

@jelockwood
Copy link

👍
I am not a developer and likely not as familiar with the technicalities of both HomeBridge and Matter but I certainly support the idea of either making HomeBridge able to expose devices to Matter i.e. act as a Matter bridge, or the creation of a related separate project to accomplish this.

I am aware that at this time not all capabilities currently available via HomeKit are available via Matter e.g. apparently energy monitoring is not yet supported by Matter, so from this perspective exposing to both HomeKit and Matter would give users a choice. However my own goal is to over time to switch to Matter only either natively or via Matter bridges. I am therefore currently experimenting with the Philips Hue bridge which can as both a HomeKit bridge and a Matter bridge to test lighting solutions. (There are apparently zero Matter compatible dimmer solutions for the European market as of yet.)

@afharo
Copy link
Contributor

afharo commented Dec 10, 2023

As a plugin developer, I'd love to learn what plans Apple has for device types introduced by Matter that are not currently supported in HomeKit.

In the beginning, HomeKit supported a wider variety of devices than Matter 1.0. However, Matter 1.2 adds support for robot vacuum cleaners. Will HomeKit add that Accessory Category Type? Or will they just direct devs to the Matter SDK (as they seem to do in their docs)?

Xcode includes the certified Matter SDK in its entirety. You are encouraged to use this version of the SDK provided by Apple for your Matter ecosystem apps. Apple will work continuously to keep it up to date.

If the latter, I would like Homebridge to expose the extra APIs to register the matter device.

If the decision is to address it as a separate project (matterbridge), my plugin will need to be deprecated in favor of the matter clone (I assume many other plugins "impersonating" other accessory types in the absence of their own would be in the same situation).

TBH, I've already assumed I'll need a good rewrite of my plugin when the support for the appropriate device type comes out. However, allowing this transition by letting the plugin call different APIs based on config will be smoother for devs and users, IMO.

It could be a new set of APIs:

  • api.registerMatterAccessory instead of api.registerAccessory
  • api.matter instead of api.hap

IMO, that'd ease the transition for both:

  • Devs: mostly the same code, just different "last mile" conversion logic
  • Users: anyone wanting to test the "experimental" matter device, they can do that with a config change (maybe even keeping the accessory for their BWC automations). I'm thinking of a config like below
{
  ...
  "accessories": [
    {
      "accessory": "XiaomiRoborockVacuum",
      "name": "My Robot Vacuum",
      "ip": "192.168.0.10",
      "token": "my-secret-token"
    }
  ],
  "platforms": [...],
+  "matterAccessories": [
+    {
+      "accessory": "XiaomiRoborockVacuum",
+      "name": "My Matter Robot Vacuum",
+      "ip": "192.168.0.10",
+      "token": "my-secret-token"
+    }
+  ]
}

This can also be achieved by forking to project matterbridge, but, IMO, the effort is larger on both ends:

  • Devs: Clone and publish the plugin with a new name (and try to keep feature parity during the transition, if they want to maintain any level of BWC).
  • Users: Set up a new architecture altogether: new project, new NPM installs, await new UI plugin to handle the plugins, ... you know the drill.

FWIW, I don't think homebridge should automatically try to automatically convert compatible accessories to Matter. At least not for now. I'd rather keep it on the plugin-dev's end to implement it or not, and let the users decide whether they want to enable that mode or not for that plugin.

@nitaybz
Copy link

nitaybz commented Apr 10, 2024

Suggestion (might be an easy solution):
There is a Matter bridge repository that exposes different plugins to matter: https://github.com/Luligu/matterbridge. It might be easy enough to create a matterbridge plugin that connects to Homebridge and expose all devices to matter, it can use Homebridge API or a dedicated plugin also on Homebridge side in order to connect the 2 systems.

Checkout the Zigbee2MQTT plugin for matterbridge, they connected all the accessories from Z2M into matter and it was pretty straight forward to set it up: https://github.com/Luligu/matterbridge-zigbee2mqtt

I hope it will help to push this forward. I've created a few Homebridge plugins that I really wish to be able to expose as Matter accessories.

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

No branches or pull requests