New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Automatically naming Bose Soundtouch presets in Shortcuts #284
Comments
Hey, Unfortunately not going to implement this one, it would be a platform specific feature, and I try to stay away from adding those. Would indeed be a cool feature though, feel free to fork this card and extend it as you like with e.g. platform specific features like this, I'm sure more people would be interested in this as well, could become "mini-bose-player" 😉 |
What about a method that can be called to update a button's text? |
Please elaborate, how would that work? You should be able to achieve something similar with the help of config-template-card) though. |
I am thinking that a button could be given a content string and expanded like a template or the markdown card Then you could pull the state or an attribute off an entity you create or have a media platform (such as soundtouch) export the text for the 6 buttons as a property to include in the markdown. |
I like the idea of @jpearce73. What about you @da-anda? I am sure you have enough of homeassistant pull requests but maybe you have an idea. Unfortunately I cannot code at all but if there is anything else when it comes to testing stuff I am glad to help out. Maybe one could integrate the currently stored presets in the attributes of each player? |
You can already do that with the help of config template card. I don't really want to add templating to the card as there are solutions that solves that problem just fine already. |
I agree with Kalkih. Maybe start by sharing your lovelace yaml for the sound touch here and I can try and help you. |
Here is the yaml file for the media player shown in the screenshot in first post: type: 'custom:mini-media-player'
artwork: full-cover-fit
entity: media_player.soundtouch_room2
group: true
hide:
shuffle: true
source: false
volume: false
icon: 'mdi:speaker-wireless'
name: Bose Room2
power_color: true
shortcuts:
column_height: 30
align_text: left
buttons:
- icon: 'mdi:numeric-1-box'
id: 1
name: Deepmix Moscow
type: playlist
- icon: 'mdi:numeric-2-box'
id: 2
name: I can haz We3kend?
type: playlist
- icon: 'mdi:numeric-3-box'
id: 3
name: Anrüchige Frauen
type: playlist
- icon: 'mdi:numeric-4-box'
id: 4
name: Tagesschau 100s
type: playlist
- icon: 'mdi:numeric-5-box'
id: 5
name: Mix der Woche
type: playlist
- icon: 'mdi:numeric-6-box'
id: 6
name: Autobahn bei Nacht
type: playlist |
OK this is a proof of concept Using the config-template-card we can put attributes from media_player.soundtouch (or any other platform) into our button names. And they update as the attribute changes. => So to get the final solution you are seeking I will need to enhance the soundtouch library and add exported attributes for the button presets and then those could be used in the template. Give me a bit of time for that... but I like the idea of it too.
|
Please try this solution. Install by using the add-on terminal
Then use lovelace code like this to put a mini-media-card inside a config-template-card. Note the expansion of the newly exported soundtouch_presets attribute.
|
Hey @jpearce73, sorry for the late reply. I've tested your solution. It basically works! Only one issue with the encoding like in Preset 3 where German Umlaut "Ü" is not displayed correctly: I have also noted that when the title gets too long the icon somehow shrinks a bit (Preset 1 and 4) but this seems to be default behavior of the mini-media-player. @kalkih: Are you aware of the shrinking icons when title gets too long? |
I'll have to differ to @kalkih for the visual stuff - probably German language knowledge too! There is that German U, but it's not coming with any encoding information in the XML. What does it look like on the Speaker Displays and inside the Bose Phone App? |
So the interesting thing is that the manually created button seems to have the U shown correctly. Please make sure that's still the case with the templated card by making a minimal change and hardcoding button #3 with the text. We want to know if it's going wrong in the loading of the attribute from the XML, or in the display of the card within the templated card. So make a 1 line change to your templated card and hardcode button #3 that text with the U. Please also check in the UI under Developer Tools => States tab. Find your soundtouch entity and look at the text displayed for the soundtouch_presets attribute. How's the U? |
Perfect thanks. |
Great, thanks! I really like the way the Soundtouch integration is improving lately. |
Great progress! I'll fix the icon resize issue. |
OK, I have managed to fix it. CharlesBlonde/libsoundtouch#38 @kalkih - Do you know someone who can help us? |
I see that libsoundtouch 0.8.0 already has this fix, so I think the things we want to do is push for HA to upgrade libsoundtouch library and possibly bring that library into local management given the original owner does not seem to be active. |
Hello @kalkih,
first of all thank you for implementing multi room features for the Bose Soundtouch integration. Great feature.
I use 4 Soundtouch devices with the shortcuts settings to quickly start playing predefined playlists:
These shortcuts are also exposed by the speakers API when you call
http://IP_OF_SPEAKER/presets
and they have the name and even an URL to the cover art in it:Would it be possible for mini-media-player to read and display the names of the presets automatically? Maybe even use the cover art in a shortcut button?
I am asking because I don't use
lovelace.yaml
mode in hass and have to edit these presets 4 times in the GUI. It would be a handy feature if the presets change automatically.The text was updated successfully, but these errors were encountered: