Matter Media Playback Cluster

Hello,

I am currently working on personal project based on Matter. I need to create a Basic Video Player as specified in Matter's standard embedding the Media Playback Cluster.

I went through the reading of how Apple now supports Matter as a standard :

linkText

My understanding of the following schematic, is alongside :

  • HomeKit Accessory Protocol (HAP) Framework API
    • Related HAP accessories underneath the homeKit framework.

Developpers also find under the Homekit framework :

  • CHIP (Connected Home IP) Framework API
    • Related Matter accessories this time

Both types of accessories/devices can be commissioned in the HomeKit ecosystem seemlessly.

Each framework has it's documentation :

I want through the process of installing XCode and the HomeKit Accessory Simulator. In the list of HomeKit Accessories I did not see any Media related devices :

The list of currently supported devices is limited as I read here and will be enriched with time : https://support.apple.com/en-us/102135#:~:text=The%20Home%20app%20currently%20supports,%2C%20temperature%2C%20and%20humidity).

In the meantime, as I read the matter documentation, I read several references made to the Media Playback :

My questions are :

  • Are Matter Basic Video Players, (Media Playback) supported in HomeKit ?

  • Why aren't they listed in HomeKit Accessory Simulator ?

  • How can I add a Basic Video Player in HomeKit and display it's Media Playback controls once I have added the device to HomeKit ?

Thank you for your Answer.

Regards

David

Answered by DTS Engineer in 860910022

First off, a comment here:

Both types of accessories/devices can be commissioned in the HomeKit ecosystem seamlessly.

Each framework has its documentation: HAP: https://developer.apple.com/documentation/homekit/hmhomemanager CHIP: https://developer.apple.com/documentation/matter

While the frameworks are conceptually similar, I think it's a mistake to think of them as direct equivalents to each other.

The Matter framework is the easier of the two to explain— it's a hardware control framework you use to send commands to Matter accessories. There's a little bit of nuance in that you need to do pairing through the MatterSupport framework, but once you're paired, the behavior of the framework is relatively straightforward.

However, that's not really how HomeKit works. HomeKit works at a much higher level than that and is basically manipulating the "Home Ecosystem" that's built "on top" of HomeKit. So, for example, when you call a "basic" API like HMCharacteristic.writeValue(...), what that actually "does" could be one of at least three different things:

  1. The device your app is running on connects to the accessory and writes the characteristic.

  2. The device your app is running on sends a request to the current HomeHub, and the HomeHub writes the characteristic.

  3. The device your app is running on sends a command to iCloud, the HomeHub receives that command, and the HomeHub then writes the characteristic.

...and which of those three happened is totally invisible to your app.

Finally, the other issue here is that the HomeKit framework also provides limited support for using the Matter framework to send commands to Matter accessories. In other words, instead of writing an ecosystem app that maintains its own pairing, you can connect to the accessory through HomeKit's ecosystem pairing. This forum post describes how that process works, while this one discusses one of its major limitations.

However, for your purposes, I believe the biggest issue is that I think you'd need to send all your commands directly through MTRBaseDevice, instead of being able to use the higher-level MTRClusterMediaPlayback.

Reordering questions a bit for clarity...

Why aren't they listed in HomeKit Accessory Simulator?

So, what the"HomeKit Accessory Simulator” actually does is simulate HAP (HomeKit Accessory Protocol) accessories. Indeed, one of its main uses is allowing HAP accessory developers to see what a given HAP accessory "should" look like, as well as allowing accessory developers to quickly experiment with different service configurations that will look in HomeKit.

I'll also note that the tools haven’t been updated in several years, so there are HAP accessories that it does not support (for example, televisions).

Are Matter Basic Video Players, (Media Playback) supported in HomeKit?

No, at least not directly. Going back to the support link you posted, in terms of the Matter specification:

"The Home app currently supports these types of Matter accessories: air conditioners, bridges, lights, locks, outlets, switches, thermostats, blinds and shades, and sensors (motion, ambient light, contact, temperature, and humidity)."

...that is a list of the cluster configuration HomeKit (and Home.app) support. However, two notes on that point:

  1. Matter accessories are made up of collections of clusters and HomeKit will pair with an accessory even when it doesn't support everything it provides. FYI, this is actually very common, as many accessories include things like vendor-specific configurations.

  2. I'm honestly not sure what will happen if you try and pair an accessory where HomeKit doesn't support ANY of its configuration, but I suspect HomeKit will pair the accessory but won't really "show it" in the home. That's something you need to try for yourself.

How can I add a Basic Video Player in HomeKit and display its Media Playback controls once I have added the device to HomeKit?

I don't think this is possible. Please file a bug on this and post the bug number back here once it's filed.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Accepted Answer

First off, a comment here:

Both types of accessories/devices can be commissioned in the HomeKit ecosystem seamlessly.

Each framework has its documentation: HAP: https://developer.apple.com/documentation/homekit/hmhomemanager CHIP: https://developer.apple.com/documentation/matter

While the frameworks are conceptually similar, I think it's a mistake to think of them as direct equivalents to each other.

The Matter framework is the easier of the two to explain— it's a hardware control framework you use to send commands to Matter accessories. There's a little bit of nuance in that you need to do pairing through the MatterSupport framework, but once you're paired, the behavior of the framework is relatively straightforward.

However, that's not really how HomeKit works. HomeKit works at a much higher level than that and is basically manipulating the "Home Ecosystem" that's built "on top" of HomeKit. So, for example, when you call a "basic" API like HMCharacteristic.writeValue(...), what that actually "does" could be one of at least three different things:

  1. The device your app is running on connects to the accessory and writes the characteristic.

  2. The device your app is running on sends a request to the current HomeHub, and the HomeHub writes the characteristic.

  3. The device your app is running on sends a command to iCloud, the HomeHub receives that command, and the HomeHub then writes the characteristic.

...and which of those three happened is totally invisible to your app.

Finally, the other issue here is that the HomeKit framework also provides limited support for using the Matter framework to send commands to Matter accessories. In other words, instead of writing an ecosystem app that maintains its own pairing, you can connect to the accessory through HomeKit's ecosystem pairing. This forum post describes how that process works, while this one discusses one of its major limitations.

However, for your purposes, I believe the biggest issue is that I think you'd need to send all your commands directly through MTRBaseDevice, instead of being able to use the higher-level MTRClusterMediaPlayback.

Reordering questions a bit for clarity...

Why aren't they listed in HomeKit Accessory Simulator?

So, what the"HomeKit Accessory Simulator” actually does is simulate HAP (HomeKit Accessory Protocol) accessories. Indeed, one of its main uses is allowing HAP accessory developers to see what a given HAP accessory "should" look like, as well as allowing accessory developers to quickly experiment with different service configurations that will look in HomeKit.

I'll also note that the tools haven’t been updated in several years, so there are HAP accessories that it does not support (for example, televisions).

Are Matter Basic Video Players, (Media Playback) supported in HomeKit?

No, at least not directly. Going back to the support link you posted, in terms of the Matter specification:

"The Home app currently supports these types of Matter accessories: air conditioners, bridges, lights, locks, outlets, switches, thermostats, blinds and shades, and sensors (motion, ambient light, contact, temperature, and humidity)."

...that is a list of the cluster configuration HomeKit (and Home.app) support. However, two notes on that point:

  1. Matter accessories are made up of collections of clusters and HomeKit will pair with an accessory even when it doesn't support everything it provides. FYI, this is actually very common, as many accessories include things like vendor-specific configurations.

  2. I'm honestly not sure what will happen if you try and pair an accessory where HomeKit doesn't support ANY of its configuration, but I suspect HomeKit will pair the accessory but won't really "show it" in the home. That's something you need to try for yourself.

How can I add a Basic Video Player in HomeKit and display its Media Playback controls once I have added the device to HomeKit?

I don't think this is possible. Please file a bug on this and post the bug number back here once it's filed.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Hello Kevin,

I tried to open and fill in a bug as recommended on the page https://www.apple.com/feedback/home-app (see attached screenshot).

I did not recieve a bug number. Could you please assist and share the correct page I should access to fill in the bug ?

Kind regards,

David.

Hi David you can use the Feedback Assistant app on macOS, or https://feedbackassistant.apple.com to log a trackable bug, which you can assign to your self or your development team (if you are a member of one).

That other link seems to be for anonymous user feedback.

I did not recieve a bug number. Could you please assist and share the correct page I should access to fill in the bug ?

Sorry, I should have included my usual link to Quinn's post on bug filing. That points you to the right page but also includes a good overview of the bug process. But, yes:

Hi David you can use the Feedback Assistant app on macOS, or https://feedbackassistant.apple.com

...either of those work.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Matter Media Playback Cluster
 
 
Q