pymusiccast icon indicating copy to clipboard operation
pymusiccast copied to clipboard

Not adding additional zones as entities

Open benjycov opened this issue 3 years ago • 10 comments

Hi,

Good work on this.

There appears to be a problem where one multi-zone physical device presents multiple musiccast devices, for example if I use the standard yamaha_musiccast:

media_player:

  • platform: yamaha_musiccast host: 10.0.51.22

I see the following entities:

media_player.living_room_main media_player.living_room_zone3

Once I change to the musiccast_yamaha:

media_player:

  • platform: musiccast-yamaha host: 10.0.51.22

I only see one entity:

media_player.living_room_main

Hopefully its an easy fix!

Thanks... Ben

benjycov avatar Sep 14 '20 13:09 benjycov

I am also experiencing this issue

JoeStratton avatar Oct 28 '20 01:10 JoeStratton

This is just what I was looking for for, great work. Is there any way to get to additional zones to show on single devices as benjycov described. I have a zone 2 for the patio that I can control if I set it up as yamaha_musiccast, but once I switch it to musiccast_yamaha for the grouping to work it causes the 2nd zone on the receiver to disapear.

Thanks

timberwolf444 avatar Nov 08 '20 23:11 timberwolf444

anyone got luck to see the additional zone?

arikflorida avatar Feb 03 '21 02:02 arikflorida

Fixed it by: media_player:

  • platform: musiccast_yamaha host: 192.168.1.29
  • platform: yamaha_musiccast host: 192.168.1.29

arikflorida avatar Feb 03 '21 20:02 arikflorida

Hi arikflorida, are you sure that this fixed the issue? your 1st line is configuring the entity for the new musiccast integration, and your 2nd line is configuring the same device to the original musiccast integration. Are you actually able to group all these speakers? I am still unable to get the zone 2 on my receiver to show in the as an entity unless I use the original musiccast integration yamaha_musiccast but that platform does not give the join/unjoin speaker features that the musiccast_yamaha does.

Thanks

timberwolf444 avatar Feb 04 '21 01:02 timberwolf444

@timberwolf444 have you had any luck with this? I'd really love for my zone2 to show as an additional entity.

darthdurden avatar Jun 12 '21 19:06 darthdurden

Looking into this a little bit with the HASS debug output. It looks like part of the problem is we're getting a null pointer here:

https://github.com/ppanagiotis/pymusiccast/blob/418441f7836e68562f366db017dfa27c040229d6/custom_components/musiccast_yamaha/pymusiccast.py#L97

distribution_info is null:

File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 432, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 550, in async_device_update await task File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/musiccast_yamaha/media_player.py", line 306, in update self.refresh_group() File "/config/custom_components/musiccast_yamaha/media_player.py", line 378, in refresh_group client_entities = [e for e in entities File "/config/custom_components/musiccast_yamaha/media_player.py", line 379, in <listcomp> if e.ip_address in self._zone.group_clients] File "/config/custom_components/musiccast_yamaha/pymusiccast.py", line 103, in group_clients if not self.group_is_server: File "/config/custom_components/musiccast_yamaha/pymusiccast.py", line 97, in group_is_server return self._distribution_info.get('role') == 'server' and \ AttributeError: 'NoneType' object has no attribute 'get'

darthdurden avatar Jun 12 '21 19:06 darthdurden

I have not had any luck getting the zone 2 working. It looks like someone is working on a new version.

https://github.com/home-assistant/core/pull/51561

timberwolf444 avatar Jun 13 '21 15:06 timberwolf444

@timberwolf444 that is awesome! I'll definitely be looking into that. In the meantime, I have sort of been able to get zone2 to work on mine. A couple of minor code tweaks (checking that distribution_info isn't null above), and then fixing this line:

https://github.com/ppanagiotis/pymusiccast/blob/1d1e9b0df22f85eb3095c34756b77078e2cc0e87/custom_components/musiccast_yamaha/pymusiccast.py#L77

You need to pass the zone_id into the super class.

This allows the second zone to be added, but it doesn't seem to work with the grouping functionality :-/ Not sure why that is just yet, but I'll keep toying with it, while I keep my eye on the rewritten integration. Thanks for the heads up!

darthdurden avatar Jun 13 '21 15:06 darthdurden

@arikflorida @timberwolf444 I just tried out the new version and grouping works great for everything, including zone2!

Installed the component from this branch while I wait on official release: https://github.com/vigonotion/home-assistant/tree/musiccast-grouping-2

darthdurden avatar Jun 15 '21 11:06 darthdurden