Media Controllers.... what do they do?

Hey, I’m working on building out a jukebox dashboard with Sonos / Hubitat and working with a developer who’s building drivers to manage presets / playlists using the Jishi node app. He added the “MediaController” capability to the Sonos buttons / controller so I could import them into Sharptools. I added them to my Jukebox and got… Nothing? Just a lightbulb tile with no controls? I can turn it into a Hero Attribute but there’s not much there.

What is a MediaController supposed to have?

Media Controller Capability

The short version is the MediaController capability doesn’t expose much on its own. It’s usually used alongside other capabilities… and the most common use for it is within rules.

The Media Controller capability is a somewhat oddly named capability that is used for starting activities. If you’re familiar with Harmony Remotes, they’re a perfect application for this capability as they can expose a list of ‘activities’ which can then be started.

Music Player and Media Playback Capabilities

If you are looking to expose media playback controls (play/pause/next/prev), this is usually done under the MusicPlayer capability in the Hubitat world.

In case you aren’t familiar with the history, Hubitat picked up a lot of their capabilities from SmartThings… SmartThings has since deprecated the Music Player “monocapability” in favor of several individual capabilities like Media Playback, Media Track Control, Media Presets, Audio Mute, Audio Volume, and Audio Track Data.

While it may seem like a bunch of extra capabilities, it provides much more flexibility for just layering in the additional features that are desired or supported by various devices. I can’t remember off the top of my head if all of these new capabilities have been added to the latest Hubitat builds, but new SmartThings capabilities tend to eventually be supported by Hubitat as well.

Music Player and Album Art Tiles

The SharpTools Music Player and Album Art tiles support either the Music Player monocapability or Media Playback with the individual supporting capabilities.

You can find some details on the attributes necessary to support the Album Art tile in the following post:

Ah, okay. Thanks for this, it makes sense. What we’re looking to expose with this is more around the Media Presets capabilities, I think. Basically to be able to tell the node server to run a preset (with Sonos grouping and optionally a playlist) and have some pre-defined “buttons” which run commands against the Node.js server to do things like play pre-defined sources.

This makes me think a Sharptools UI widget for Media Controllers should query the provided methods:

getAllActivities()

getCurrentActivity()

and provide a way to activate an activity with this one:

startActivity(activityname)

If there’s just a few activities this could be a popup modal with buttons.