KNX - Media Player Control 🎶

With this blueprint, you can control any media_player entity via KNX group addresses

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Source: KNX - Media Player Blueprint

Version: 1.1.1

Requirements

  • Working KNX Integration
  • Home Assistant 2024.6.0 or greater
  • A media_player entity (I tested it with Sonos)

Features

  • Playback Control (Play/Pause, Forward/Backward)
  • Volume control in percent
  • Volume control stepwise
  • Relative Volume control
  • Song, Album & Artist as Feedback to KNX
  • Up to 8 Scenes to start a Playlist/Radio

Setup
Import the blueprint and create an automation based on it. The only mandatory input is the media_player entity. Besides that, all group addresses are optional and mostly self-explanatory.

For the Volume Control you can use absolute control in percent, stepwise control or relative control. It’s also possible to use all at the same time. With the stepwise control, you can configure how much the volume should be turned up/down with each step. The relative control requires a helper entity for each automation. You can create it directly within the blueprint. Kudos to kalhimeo for his Dimming blueprint, that this function is based on. In KNX, the relative volume control is simply a Push Button configured as Dimmer.

To use scenes, you have to configure a scene group address. Within the blueprint, you configure the scene number and the according Playlist/Radio that you want to start. It’s also possible to set a volume level for each scene. I could only test this function with SONOS. There, you have to add the playlist/radio to your SONOS favorites to be able to use it. Watch out for typos. I also discovered that only adding the artist doesn’t work. It needs to be a playlist/album. Please don’t hesitate to test it with other systems and provide feedback.

Thank you to farmio for the great KNX integration and the help to create this blueprint

Have fun :v:

Changelog

  • V1.0 - Initial Release
  • V1.1 - Scenes now also support a predefined Volume
  • V1.1.1 - Bugfix: Volume Control didn’t work without a project
4 Likes

To improve the media compatibility of Home Assistant, i can highly recommend Music Assistant. It is designed to do media control and is nicely integrated in Home Assistant.

Yeah it looks pretty cool. But it seems that it has it’s own set of action’s. So I don’t think that it works with my blueprint.

First of all, thanks for this awesome Blueprint.

I got it to work with MDT Glastaster and Music Assistant(MediaPlayer integrated in Homeassistant).

I can control play/pause (short press) and volume (long press) with just one button.

With the second button I would like to switch the sources, unfortunately the button only supports a fixed selection for scenes. Would it be possible to extend the Blueprint so that you can jump through the sources as soon as an on/off telegram (DPT1) arrives from a GA?

Edith tells me:
It would be even cooler if you could create several source groups (e.g. radio, Spotify, local music, etc.) and change them with a long press of a button. Short press then toggle inside the group.

Thank you for your Feedback. I guess you have allready used the option of the MDT Glastaster to switch between up to 4 Scenes with one button?
However I think it should be possible to edit the blueprint in that way. The function would work like the Forward/Backward Function. Simply switching between the Sources.

Regarding your last wish, to achieve this, the blueprint would have mutliple Scene Sets. So one scene set for Spotify the next for local music etc. This is definetly no problem. However I think it would be tricky to switch between the scene sets with a button press. If for example you started a playlist via the Spotify Scene an then change via the Sonos App, to which scene set should the blueprint change.

Thanks a lot!
Now i can delete my complex Nodered flows and use this simple but good blueprint.
I am only missing the initial volume / define a volume. Maybe you have an idea how to solve it and we will see this feature in a future release.
Use case: If you hear loud music in the evening and want to play smooth radio in the morning, it is important to have a standard volume set up for a scene.

Thank you for your answer and the tip with the 4 scenes of the glass push-button, I didn’t know that until now.

That sounds good and more than 4 channels, playlists, whatevver would be possible.

That also sounds good :grinning:

Even if you switch to a different source with the Sonos app - or in my case Music Assistant, HomeAssistant knows which one is currently active. This means you can “simply” switch to the next one at the touch of a button. Or am I mistaken?


With reference to @EdStark suggestion, I would think it would be great if you could also choose a standard playlist. Use case just this morning: I press the play button on the glass button and there is nothing in the queue → the loudspeaker remains mute


Please don’t take my constructive criticism the wrong way, but there are still a few improvements to be made by using the blueprint. However, as a beginner in Home Assistant, I can’t (yet) contribute much to the solution.

This feature is now implemented for the scenes. If you set the Volume to 101, the volume will stay on the level it allready was.

Actually, it seems harder to implement than I thought. The problem is that the blueprint doesn’t know which scene number was the last one that was sent. Therefore, I would need an additional helper entity.
Because of this, I would rather outsource the function of clicking through scenes to another blueprint. Which also makes more sense, since it isn’t solely related to music.

I can’t really reproduce the state that nothing is in the queue in my SONOS System. There, the queue position is simply reset to 0. So when an album is finished then the music gets paused and when I click on play, the album starts again. Could you send me a screenshot of the attributes of the media_player when it is in this state?

And don’t worry, I appreciate your feedback :slight_smile:

Hallo Torben erstmal danke fĂĽr den Blueprint echt tolle Arbeit es funktioniert auch alles sehr gut auĂźer das Absolute Volume setzen mit DPT 5.001
Im Gruppenmonitor kommt alles an Daten lauten 0x40, 0x50, etc.
Rückmeldung der Lautstärke funktioniert blos das setzen nicht
Das Schrittweise erhöhen und senken der Lautstärke funktioniert auch.
Mediaplayer ist ein Sonos. TouchPanel ein GVS Waltz Touch+ Pad
Bitte um Hilfe!

Danke fĂĽr dein Feedback, das Problem ist, dass du das ETS Projekt nicht importiert hast. Das siehst du auch daran, dass Home Assistant die Rohwerte anzeigt 0x40 0x50 und nicht die Prozentwerte.
Entweder du importierst dein aktuelles KNX Projekt oder du aktualisierst den Blueprint. Ich habe gerade eben einen Bugfix hochgeladen


Thank you for your feedback, the problem is that you have not imported the ETS project file. You can also see this from the fact that Home Assistant displays the raw values 0x40 0x50 and not the percentage values.
Either you import your current KNX project or you update the blueprint. I have just uploaded a bugfix

Funktioniert jetzt durch aktualisieren des Blueprints danke dir vielmals :slightly_smiling_face:

Hi!
Nice job! So I also wanted to replace my self made automation.
But one thing I’m missing.
On my logic I had a check, if player is playing, and “play” is triggered again, the action media_player.media_next_track is executed.
Could you integrate that as an option!?
Thanks!

First of all, I apologize for the late response, but with a family it always takes a while to find time again.

Whatever you say, you’re the pro. It would be great if you could implement it like this :ok_hand:

Here is a screenshot, but unfortunately you can’t see much.
grafik
How do I get to the attributes you need, unfortunately I couldn’t find anything myself

:smiley:

Thank you for this awesome Blueprint.
Is it possible to add the playlist/favorite as Feedback to knx?
I have the mdt gt2 and when i play Radio stations, i don’t know wich is station playing.