@andrewsayre Sounds great! Thanks. Yeah, I was thinking about the join/unjoin service. Staying tuned and looking forward to it
Thanks a lot for a great integration already! Looking forward to the grouping as well. Currently when I have my heos in a group I can change music for example for the whole group, but changing the volume on one of the players changes the volume only for that speaker and not for the whole group as you described. How can I manage to do this until the grouping is finished?
Thanks!
Thanks for the great work on the HEOS integration so far Andrew! Any chance I can motivate you with a beer or coffee (or two) for implementation of the grouping feature?
Hey @andrewsayre! Assume you’ve been busy with other things and that HEOS grouping has fallen behind on the priorities? Just wanted to let you know I did a fork of your HEOS integration and managed to get grouping working when running it as a custom component. Using it together with the mini-media-player and it seems to be functioning quite well so far. Also added a turn_off feature equal to stop (since it doesn’t exist in the CLI commands), just to be sure I can use typical power buttons in cards.
My code should be expected to be rather dirty and not very well structured since I’m still a newbie in Python and even more so on HA components/integrations. But hey, it’s working Anyway, please let me know if I could do anything to contribute, share it or participate in any further developing the official version.
Hi @tormagj: could you share your custom component? Want to do some testing if you like…
Thanks
Cadish
Of course! I’m still learning github too, so bare with me if I’m doing this wrong, but I put my little hack here:
How can I group/ungroup speakers?
Can I do it via a service, or do I need to use the GUI?
hi! the services should work, but I did most of the testing with the mini media card that I linked to above. check the grouping option in the installation guide. let me know if it’s working for you!
I get this error when I’m trying to group through the GUI
Unable to join: Missing Command arguments (3)
Hum, strange. Just tested it here again, and working fine both with mini-mediacard and by using services. Here’s my card setup
cards:
- type: vertical-stack
cards:
- type: custom:mini-media-player
entity: media_player.heos5_office
artwork: cover
source: icon
toggle_power: false
hide:
power_state: false
icon: true
speaker_group:
platform: heos
show_group_count: true
entities:
- entity_id: media_player.heos5_office
name: HEOS5 Office
- entity_id: media_player.heos1_kitchen
name: HEOS1 Kitchen
- entity_id: media_player.heos1_flex
name: HEOS1 Flex
- entity_id: media_player.heos_stue
name: HEOS LivingRoom
And here is how it looks (notice the +1 on the name after I grouped two of the speakers):
Does your setup look somehow similar?
You could also group your speakers with the HEOS app and then call the service ‘heos.groupinfo’ which will basically just print some debugging groupinfo in the log, like this:
2019-11-27 21:12:11 INFO (MainThread) [custom_components.heos.services] HEOS Groups are: ['name: heos5_office + heos1_flexmembers: heos5_office,heos1_flex']
Had more or less the same config, but copy-pasted yours now (with my entities of course), and still the same error…
That’s weird. Do you find any details in the log indicating that the component is not properly loaded? Or perhaps some more info on what goes wrong?
No, no other details in the log, except for the general one
2019-11-27 21:33:37 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for heos which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
BTW, I’m also logged in into my Heos device, as I can see its favorites etc…
Ok. I can’t think of anything obvious right now, but probably something silly I guess. I installed the mini-media card via HACS, but I guess that shouldn’t matter. Do you have the latest version of both card and Home assistant? By the way, I’m running hass.io but I guess that shouldn’t matter as well as long as it is the latest Pyheos in the background.
Did you try to call the heos.join service manually?
Hummmm! I got the same message when I tried to call the service with incorrect parameters for the call:
2019-11-27 22:28:48 DEBUG (MainThread) [pyheos.connection] Command failed 'heos://group/set_group?sequence=489&pid=': {'command': 'group/set_group', 'result': 'fail', 'message': 'eid=3&text=Missing Command arguments&sequence=489&pid='}
2019-11-27 22:28:48 ERROR (MainThread) [custom_components.heos.services] Unable to join: Missing Command arguments (3)
That happened for me when I used the default example data for calling the service, or in other words when the names couldn’t be found and mapped into a playerid (number) which the Heos system needs.
Following my setup in previous posts, I call the service like this - then its working.
Yes indeed, really strange. I also am running hassio and have the mini-media card installed via HACS too.
Heos.join service is giving me the exact same error…
Yeah… See my latest post, can it be something funny with the names? Any special characters??
Do you have your logger level set to errors only? Perhaps it helps to set it to DEBUG because I have some info put into debug that I used when I was working on it (like you see on my post).
I’ve changed it to DEBUG, and this is what I get in the logs now:
2019-11-27 22:42:00 INFO (MainThread) [custom_components.heos.media_player] HEOS Group info, groupname: 1e verdieping
2019-11-27 22:42:00 INFO (MainThread) [custom_components.heos.media_player] HEOS Group info, devices_in_group: ['1e verdieping']
2019-11-27 22:42:00 INFO (MainThread) [custom_components.heos.media_player] HEOS Group info, self.name: Living Room
2019-11-27 22:42:00 INFO (MainThread) [custom_components.heos.media_player] HEOS Rebuilding group info, no groups found for this device: Living Room
2019-11-27 22:42:00 INFO (MainThread) [custom_components.heos.media_player] HEOS Group info, groupname: 1e verdieping
2019-11-27 22:42:00 INFO (MainThread) [custom_components.heos.media_player] HEOS Group info, devices_in_group: ['1e verdieping']
2019-11-27 22:42:00 INFO (MainThread) [custom_components.heos.media_player] HEOS Group info, self.name: Dining Room
2019-11-27 22:42:00 INFO (MainThread) [custom_components.heos.media_player] HEOS Rebuilding group info, no groups found for this device: Dining Room
2019-11-27 22:42:00 INFO (MainThread) [custom_components.heos.media_player] HEOS Group info, groupname: 1e verdieping
2019-11-27 22:42:00 INFO (MainThread) [custom_components.heos.media_player] HEOS Group info, devices_in_group: ['1e verdieping']
2019-11-27 22:42:00 INFO (MainThread) [custom_components.heos.media_player] HEOS Group info, groupname: 1e verdieping
2019-11-27 22:42:00 INFO (MainThread) [custom_components.heos.media_player] HEOS Group info, devices_in_group: ['1e verdieping']
2019-11-27 22:42:00 INFO (MainThread) [custom_components.heos.media_player] HEOS Group info, self.name: Living draagbaar
2019-11-27 22:42:00 INFO (MainThread) [custom_components.heos.media_player] HEOS Rebuilding group info, no groups found for this device: Living draagbaar
2019-11-27 22:43:58 ERROR (MainThread) [custom_components.heos.services] Unable to join: Missing Command arguments (3)
2019-11-27 22:43:59 ERROR (MainThread) [custom_components.heos.services] Unable to join: Missing Command arguments (3)
Here’s my log when it is successful:
2019-11-27 22:31:47 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.139758131676496] Received {'type': 'call_service', 'domain': 'heos', 'service': 'join', 'service_data': {'master': 'media_player.heos5_office', 'entity_id': 'media_player.heos1_flex'}, 'id': 45}
2019-11-27 22:31:47 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=heos, service=join, service_data=master=media_player.heos5_office, entity_id=media_player.heos1_flex>
2019-11-27 22:31:47 DEBUG (MainThread) [pyheos.connection] Command executed 'heos://group/get_groups?sequence=513': '{'command': 'group/get_groups', 'result': 'success', 'message': 'sequence=513'}'
2019-11-27 22:31:47 DEBUG (MainThread) [pyheos.connection] Command under process 'group/set_group': '{'heos': {'command': 'group/set_group', 'result': 'success', 'message': 'command under process&sequence=514&pid=615580468,-764010704'}}'
2019-11-27 22:31:48 INFO (MainThread) [custom_components.heos.media_player] HEOS Group info, groupname: HEOS5_office + HEOS1_flex
2019-11-27 22:31:48 INFO (MainThread) [custom_components.heos.media_player] HEOS Group info, devices_in_group: ['HEOS5_office', 'HEOS1_flex']
2019-11-27 22:31:48 INFO (MainThread) [custom_components.heos.media_player] HEOS Group info, self.name: HEOS1_flex
2019-11-27 22:31:48 INFO (MainThread) [custom_components.heos.media_player] HEOS Rebuilding group info, groupname: HEOS5_office + HEOS1_flex
2019-11-27 22:31:48 INFO (MainThread) [custom_components.heos.media_player] HEOS Rebuilding group info, grouplist: ['media_player.heos5_office', 'media_player.heos1_flex']
I’m not sure at all, but it could perhaps be something in my dirty code that doesn’t handle spaces in names or something? I’ll see if I am able to test it with other names on my devices later on. Not even sure it is relevant, but that’s the only difference I see right now.