Skip to content
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

Squeezebox multiroom support #312

Merged
merged 4 commits into from
May 25, 2020
Merged

Squeezebox multiroom support #312

merged 4 commits into from
May 25, 2020

Conversation

kalkih
Copy link
Owner

@kalkih kalkih commented May 24, 2020

Squeezebox doesn't have a slave/master setup like many other platforms so it requires some changes related to that functionality, now we set the card entity as the master, I'm not sure if this is the best solution.
Also, the service calls it uses are not the "standardized" ones, and there doesn't seem to be support for grouping multiple entities at once, at least not from looking at the documentation.
https://www.home-assistant.io/integrations/squeezebox/

Need to add documentation.

@kalkih kalkih added the enhancement New feature or request label May 24, 2020
@kalkih kalkih force-pushed the squeezebox-multiroom branch 2 times, most recently from 3c421dc to 62c8659 Compare May 24, 2020 12:41
@kalkih kalkih merged commit c0482ba into dev May 25, 2020
kalkih added a commit that referenced this pull request May 25, 2020
* Support non master/slave relation multiroom platforms

* Add squeezebox group management service calls

* Add exception for squeezebox group attribute
@nickrout
Copy link

nickrout commented May 26, 2020

Hi Karl, I just get an error message in the gui

failed to call service squeezebox/join. Service not found

AFAIK the service for squeezebox is squeezebox/sync ??

EDIT should have added, am running 1.9.0 of your player and 0.110.0 of HA. This is my player setup:

entity: media_player.kitchen
type: 'custom:mini-media-player'
speaker_group:
  platform: squeezebox
  show_group_count: true
  entities:
    - entity_id: media_player.kitchen
      name: Kitchen
    - entity_id: media_player.bedroom
      name: Bedroom
    - entity_id: media_player.laundry
      name: Study

@kalkih
Copy link
Owner Author

kalkih commented May 26, 2020

🤦‍♂️ Yes, the services are actually set to use sync/unsync but I see the miss I did, will fix and do a minor release when I get home tonight.

@nickrout
Copy link

nickrout commented May 26, 2020 via email

@kalkih
Copy link
Owner Author

kalkih commented May 26, 2020

@nickrout Actually, everything looks like it should.
Make sure you're not loading an older version of the card from cache.

@nickrout
Copy link

nickrout commented May 26, 2020

I feel silly now, I think caching was the problem. I'll test more extensively.

@nickrout
Copy link

@kalkih If I add one player at a time to the group (by ticking the box) it works fine. Same for unticking.

However when I try "Group All" I get this error

value should be a string for dictionary value @ data['other_player']
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1215, in async_call
    processed_data = handler.schema(service_data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/validators.py", line 208, in __call__
    return self._exec((Schema(val) for val in self.validators), v)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/validators.py", line 287, in _exec
    raise e if self.msg is None else AllInvalid(self.msg, path=path)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/validators.py", line 283, in _exec
    v = func(v)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
    return schema(data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: value should be a string for dictionary value @ data['other_player']

@kalkih
Copy link
Owner Author

kalkih commented May 27, 2020

Yes, that's expected unfortunately, the squeezebox sync service does only accept a single entity unlike most (all i think?) other multiroom integrations. Please submit a PR to core for this if you feel like this feature is important.

Ungroup all should work though.

Could conditionally disable or remove the group all button from the UI in the future but I feel like adding support for multiple entities as parameter in the backend component is the way to go.

Does it work as expected otherwise? Had to make some changes in order for it to function since it didn't follow the master/slave pattern the other platforms have.

@hillbicks
Copy link

Forgive me for reviving this old thread, but I guess it is the right place since you never got an answer to your question.

I just started playing around with squeezebox and LMS and one thing I have discovered. The speaker group does not look like the preview from the documentation, it works though. I just don't have any indication

image
image

Would be nice if it were a bit more touch friendly i think.

Thanks for the card though! :)

@nickrout
Copy link

nickrout commented Oct 8, 2020

Something has changed! It was working. I think on 0.114.

@kalkih kalkih deleted the squeezebox-multiroom branch January 4, 2021 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants