What I would like to be able to do, simply: « Gladys, play the Daft Punk album in the living room », or in a scene, « At 7 a.m., play my morning playlist in the kitchen ». And that it works no matter the music source (my Navidrome, Spotify, Plex, a web radio…) and no matter the speaker (Sonos, amplifier, Chromecast…).
Message edited by Pierre-Gilles on 20/10 to keep the request without the implementation
Hi @guim31, thanks for this super complete proposal, it’s clearly a missing piece for Gladys!
I don’t know if I’ll have time to look into it before my paternity leave, but here’s my vision quickly
Yes, it’s core. The sources and speakers are spread across many integrations, and it’s precisely the core’s job to link the two.
We need a new set of features to think about. The real issue is whether we create many separate features for a player, as we did for Sonos (play, pause, next, etc.), or whether we rely on the supported_options, which didn’t exist at the time and allow for much simpler implementation. This is what we did for motorized cameras: a single move feature, and each camera declares what it can do in its supported_options, instead of a feature per direction. The spec docs/specs/camera-ptz-control.md can serve as a model.
We need to adapt the existing « Music » widget to have a nice player in the interface, rather than creating a new one.
In short, before any development, there’s real work to be done in terms of specification and data modeling, and that’s what will make this feature strong The spec will notably need to decide:
how we describe a player and what it can do (separate features or supported_options);
how we represent « play that »: today, a device command is a single value (a URL for play_notification), whereas a media is a source, a type, an identifier…;
play_media or extended play_notification (your question 2): a notification is a short sound that interrupts, whereas launching an album replaces what is playing, it’s not the same thing;
where we store the « currently playing » state (title, artist, cover) that the widget will need;
how a source is declared, both in the core and in external integrations.
If you want to write the spec as you propose, go for it! And don’t hesitate to call on other community developers for review, especially during my absence
I worked yesterday on a major overhaul of the music widget on the dashboard. Today, it’s limited to three buttons and a volume control. The goal is to make it a real player, on par with what we expect from an app like Spotify or Sonos.
What’s currently playing: cover art, title, artist, and album, with a progress bar that can be dragged to skip ahead in the track.
All controls: play/pause, previous/next, shuffle, repeat, mute, and volume. A radio displays « Live. »
The queue and search open in a panel over the dashboard (from the bottom of the screen on mobile). A mini-player immediately shows what you just started. You can browse your playlists, albums, and radios, start an entire album, or add a track to the queue.
In scenes, a new action « Play music on a speaker » allows you, for example, to play your morning playlist in the living room at 7 a.m.
It all works in light and dark mode, on computer, wall tablet, and phone.
Via the store: music players will go through the store’s external integrations. A Sonos integration is the first planned, Spotify should follow. Current integrations (Sonos, Google Cast, AirPlay) remain as they are, and you’ll be able to migrate your devices to the new ones without losing your widgets or scenes.
Privacy respect: your browser never loads an image from Spotify or your speaker. Covers go through Gladys, which checks them and caches them.
Lightweight for your installation: nothing is historized for music, and the track position isn’t sent every second. Gladys receives it when playback starts, pauses, changes track, or when you skip ahead, and the widget advances the bar on its own. The queue and catalog are read on demand, never stored.
Specification first: as with other major features, the specification was written and reviewed before the code. It’s in the repository, in docs/specs/external-integrations/capabilities/music.md.
Tested before review: I tested the widget with a fake integration that simulates three speakers (including a radio), through automated tests in the browser, on computer, phone, and tablet, in light and dark mode. This allowed me to fix a lot of details even before the review.
Next steps: merge master, then the external integrations development kit, then the Sonos integration in the store. The new player will therefore only be usable with these integrations.
Great job. I tried to look a bit at the PR, if I understand correctly, we are really on the improved control part of a speaker, right? With the audio source coming only from the speaker itself (or from the connection to the speaker in the case of Spotify Connect), it’s not for broadcasting to a speaker from integration A the music coming from integration B. Did I understand correctly?
I’d be happy to handle the migration of the AirPlay integration to external with these features, I think the protocol is compatible.