Hi @kalkih! I’ve made a custom component out of the Heos integration which I’m using with your great media player card. I managed to add services for grouping of HEOS-speakers that seems to be working fine (still testing though…). Also added turn_off feature that simply does the same as stop and this allows me to use your power button.
I’m successfully joining and unjoining players to/from groups using your card, but I can see something is missing in my humble “hack” since the group status is not read and updated. As a result the card only shows correct status when the commands are successful, and they’re also not updated next time I open the card. I was trying to poke around in your code to see how it’s updated, but couldn’t really find how this the group status et.c. is read. Would you be so kind to give me some hints on my way there?
Thanks in advance, and thanks a lot for a great card!
Not possible in shortcuts with service/script calls, if the source changed would be within the same entity as the card entity this would have been possible. See the attribute option in the shortcuts object.
The reason behind this is because we don’t watch or keep track of state changes happening outside of the card entity.
If you need more advanced buttons I recommend checking out the custom button-card. Combining a mini-media-player card (with the group option set to true) with a couple of button-cards inside a vertical-stack-in-card would be an option.
That’s awesome, it’s great seeing more and more media player platforms getting support for multiroom management within HA.
Please check this issue and the discussion there, as I think this might be related.
Basically what I think your implementation is missing is an attribute that expose the group composition.
I’ll quote myself from another post:
The main thing that keeps the speaker group management card feature from not working with the official soundtouch component is the lack of an exposed group attribute, we need this to keep track of groups and group members/master etc.
In order to function without any modifications to this card the group attribute should look something like this (this is also how the Sonos component does it):
The group is a list/array.
The group contains the entity id’s of all of its members.
The group looks the same on master and client/slave.
The initial entry is the master.
The attribute is exposed as [platform]_group ( soundtouch_group in this case).
Here’s a PR that adds just this to the bluesound component, and here’s one for the soundtouch component.
Feel free to open an issue on github if you want to discuss this further
Great, thanks! I think I get the point, I’ll try to implement it. My luck is that the pyheos library already contains the grouping functionality, also including a class for groups. So I believe it should be a minor thing to get it working. I tried to read up on the Sonos code, but didn’t quite figure it out. I’ll study the thread you suggested and do some testing.
Basically it would be something like
heos_group = [‘media_player.themaster’, ‘media_player.themember’,…]
right?
Exactly! Yes, the Sonos implementation and the two PR’s I linked are great examples. Check the “Files changed” tab on the PRs, there you can easily see the code added to implement the group attribute
Do the custom shortcut buttons support images instead of icons? I was hoping to use icons from flaticon.com as they offer a bit more clarity but this does not work:
Hi Karl! Just to let you know I got it working with HEOS grouping. Probably rough and dirty, but hey, it’s working Thanks for your inputs, it really helped. Hopefully this feature will be part of the official integration soon, I know Andrew is working on it and will for sure make it more “fluent” than I have.
Nice, great job!
If/when it comes to the official component, please ping me and I’ll add information about it in the mini-media-player docs (or if you wanna create a PR)
Thanks!
No success with that entity_picture extracting. Any chance for a piece of code for taking that picture and putting in the background of verical-stack-in-card?
I thought that entity_picture disappeared after that change. But deleting comment between style and ha-card::before { helped. Unfortunately now opacity: does not work.
And another magic: it works only with # this is... comment at the end of line background: url.... Without that comment it disappeare.
another EDIT: this magic works only if there is other (in any vew) duplicated this card.
Make sure to not have ANY comments anywhere in the card-mod styles as it will get parsed as part of the CSS and break the rules. Also make sure every rule ends with a ;.
This should work fine unless you have other custom styles defined that’s interfering with these ones.
Here’s the complete code again, with the image opacity at 25%, should just be to copy/paste.
It’s by default based on the theme variable --secondary-text-color.
If the card is displaying cover artwork the variable --mini-media-player-media-cover-info-color can be used.
Thanks for the great card. I’m having a bit of trouble figuring out the correct config with the shortcut/button feature. I’d like the button to turn off a switch. I tried this last night and it was turning off all switches in HA. How can I direct it only to my desired switch?
shortcuts:
buttons:
- name: Projector Off
icon: mdi:television-classic-off
type: service
id: switch.turn_off
data:
entity_id: switch.projector_power
Special needs. My mmp is not with cover by mmp but it has cover in background. While other cards backgrounds are light, changing thr secondary-text-color do not suit.
If it is possible to add the variable for that colors in a future I’ll appreciate it. Nothing urgent.