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

Filter out players ? #74

Closed
normanmaurer opened this issue May 30, 2019 · 13 comments
Closed

Filter out players ? #74

normanmaurer opened this issue May 30, 2019 · 13 comments

Comments

@normanmaurer
Copy link

Hi there,

I wonder if it is possible to filter out some players and so not show up as switches ? A few of my Sonos devices already have airplay 2 and so show up in the home app already.

@ebaauw
Copy link
Owner

ebaauw commented May 30, 2019

I think it's a good enhancement to provide a config.json setting to filter out zoneplayers that support AirPlay 2, and already natively appear in HomeKit. I'm not keen on filtering out individual zoneplayers: the config.json syntax would be too complicated for non-tech-savvy people, and I don't want to spend my time on end-user support.

Note that when these zoneplayers are excluded, you won't be able to use them in any of the features provided by homebridge-zp. In particular, you will no longer be able to group them from HomeKit, which you would want to do to send the AirPlay 2 stream to zoneplayers that don't support Airplay 2.

I need to check if the zoneplayers report whether they support AirPlay 2. Otherwise, we need to whitelist the models that support AirPlay 2. Could you please run

curl http://IP address:1400/xml/DeviceProperties1.xml > props.xml

substituting the IP address of one of your zoneplayers that supports Airplay 2, and attach props.xml?

@normanmaurer
Copy link
Author

Seems like there is something in there:

<?xml version="1.0" encoding="utf-8" ?>
<scpd xmlns="urn:schemas-upnp-org:service-1-0">
  <specVersion>
    <major>1</major>
    <minor>0</minor>
  </specVersion>
  <serviceStateTable>
    <stateVariable sendEvents="no">
      <name>HouseholdID</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>SettingsReplicationState</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>ZoneName</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>Icon</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>Configuration</name>
      <dataType>string</dataType>
    </stateVariable>
     <stateVariable sendEvents="yes">
      <name>Invisible</name>
      <dataType>boolean</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>IsZoneBridge</name>
      <dataType>boolean</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>AirPlayEnabled</name>
      <dataType>boolean</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>SupportsAudioIn</name>
      <dataType>boolean</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>SupportsAudioClip</name>
      <dataType>boolean</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>IsIdle</name>
      <dataType>boolean</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>MoreInfo</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>ChannelMapSet</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>HTSatChanMapSet</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>HTFreq</name>
      <dataType>ui4</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>HTBondedZoneCommitState</name>
      <dataType>ui4</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>Orientation</name>
      <dataType>i4</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>LastChangedPlayState</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>RoomCalibrationState</name>
      <dataType>i4</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>AvailableRoomCalibration</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>SatRoomUUID</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>LEDState</name>
      <dataType>string</dataType>
      <allowedValueList>
        <allowedValue>On</allowedValue>
        <allowedValue>Off</allowedValue>
      </allowedValueList>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>SerialNumber</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>SoftwareVersion</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>DisplaySoftwareVersion</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>HardwareVersion</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>IPAddress</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>MACAddress</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>CopyrightInfo</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>ExtraInfo</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>HTAudioIn</name>
      <dataType>ui4</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>Flags</name>
      <dataType>ui4</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>AutoplayIncludeLinkedZones</name>
      <dataType>boolean</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>AutoplayRoomUUID</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>AutoplaySource</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>AutoplayVolume</name>
      <dataType>ui2</dataType>
      <allowedValueRange>
        <minimum>0</minimum>
        <maximum>100</maximum>
        <step>1</step>
      </allowedValueRange>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>A_ARG_TYPE_SettingID</name>
      <dataType>ui4</dataType>
      <allowedValueRange>
        <minimum>0</minimum>
        <maximum>65535</maximum>
      </allowedValueRange>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>A_ARG_TYPE_SettingURI</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>AutoplayUseVolume</name>
      <dataType>boolean</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>TVConfigurationError</name>
      <dataType>boolean</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>HdmiCecAvailable</name>
      <dataType>boolean</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>WirelessMode</name>
      <dataType>ui4</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>WirelessLeafOnly</name>
      <dataType>boolean</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>HasConfiguredSSID</name>
      <dataType>boolean</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>ChannelFreq</name>
      <dataType>ui4</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>BehindWifiExtender</name>
      <dataType>ui4</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>WifiEnabled</name>
      <dataType>boolean</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>ConfigMode</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>SecureRegState</name>
      <dataType>ui4</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>A_ARG_TYPE_ConfigModeOptions</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>A_ARG_TYPE_ConfigModeState</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>A_ARG_TYPE_ButtonState</name>
      <dataType>string</dataType>
    </stateVariable>
    <stateVariable sendEvents="no">
      <name>ButtonLockState</name>
      <dataType>string</dataType>
      <allowedValueList>
        <allowedValue>On</allowedValue>
        <allowedValue>Off</allowedValue>
      </allowedValueList>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>VoiceConfigState</name>
      <dataType>ui4</dataType>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>MicEnabled</name>
      <dataType>ui4</dataType>
    </stateVariable>
  </serviceStateTable>
  <actionList>
    <action>
      <name>SetLEDState</name>
      <argumentList>
        <argument>
          <name>DesiredLEDState</name>
          <direction>in</direction>
          <relatedStateVariable>LEDState</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>GetLEDState</name>
      <argumentList>
        <argument>
          <name>CurrentLEDState</name>
          <direction>out</direction>
          <relatedStateVariable>LEDState</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>AddBondedZones</name>
      <argumentList>
        <argument>
          <name>ChannelMapSet</name>
          <direction>in</direction>
          <relatedStateVariable>ChannelMapSet</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>RemoveBondedZones</name>
      <argumentList>
        <argument>
          <name>ChannelMapSet</name>
          <direction>in</direction>
          <relatedStateVariable>ChannelMapSet</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>CreateStereoPair</name>
      <argumentList>
        <argument>
          <name>ChannelMapSet</name>
          <direction>in</direction>
          <relatedStateVariable>ChannelMapSet</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>SeparateStereoPair</name>
      <argumentList>
        <argument>
          <name>ChannelMapSet</name>
          <direction>in</direction>
          <relatedStateVariable>ChannelMapSet</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>SetZoneAttributes</name>
      <argumentList>
        <argument>
          <name>DesiredZoneName</name>
          <direction>in</direction>
          <relatedStateVariable>ZoneName</relatedStateVariable>
        </argument>
        <argument>
          <name>DesiredIcon</name>
          <direction>in</direction>
          <relatedStateVariable>Icon</relatedStateVariable>
        </argument>
        <argument>
          <name>DesiredConfiguration</name>
          <direction>in</direction>
          <relatedStateVariable>Configuration</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>GetZoneAttributes</name>
      <argumentList>
        <argument>
          <name>CurrentZoneName</name>
          <direction>out</direction>
          <relatedStateVariable>ZoneName</relatedStateVariable>
        </argument>
        <argument>
          <name>CurrentIcon</name>
          <direction>out</direction>
          <relatedStateVariable>Icon</relatedStateVariable>
        </argument>
        <argument>
          <name>CurrentConfiguration</name>
          <direction>out</direction>
          <relatedStateVariable>Configuration</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>GetHouseholdID</name>
      <argumentList>
        <argument>
          <name>CurrentHouseholdID</name>
          <direction>out</direction>
          <relatedStateVariable>HouseholdID</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>GetZoneInfo</name>
      <argumentList>
        <argument>
          <name>SerialNumber</name>
          <direction>out</direction>
          <relatedStateVariable>SerialNumber</relatedStateVariable>
        </argument>
        <argument>
          <name>SoftwareVersion</name>
          <direction>out</direction>
          <relatedStateVariable>SoftwareVersion</relatedStateVariable>
        </argument>
        <argument>
          <name>DisplaySoftwareVersion</name>
          <direction>out</direction>
          <relatedStateVariable>DisplaySoftwareVersion</relatedStateVariable>
        </argument>
        <argument>
          <name>HardwareVersion</name>
          <direction>out</direction>
          <relatedStateVariable>HardwareVersion</relatedStateVariable>
        </argument>
        <argument>
          <name>IPAddress</name>
          <direction>out</direction>
          <relatedStateVariable>IPAddress</relatedStateVariable>
        </argument>
        <argument>
          <name>MACAddress</name>
          <direction>out</direction>
          <relatedStateVariable>MACAddress</relatedStateVariable>
        </argument>
        <argument>
          <name>CopyrightInfo</name>
          <direction>out</direction>
          <relatedStateVariable>CopyrightInfo</relatedStateVariable>
        </argument>
        <argument>
          <name>ExtraInfo</name>
          <direction>out</direction>
          <relatedStateVariable>ExtraInfo</relatedStateVariable>
        </argument>
        <argument>
          <name>HTAudioIn</name>
          <direction>out</direction>
          <relatedStateVariable>HTAudioIn</relatedStateVariable>
        </argument>
        <argument>
          <name>Flags</name>
          <direction>out</direction>
          <relatedStateVariable>Flags</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>SetAutoplayLinkedZones</name>
      <argumentList>
        <argument>
          <name>IncludeLinkedZones</name>
          <direction>in</direction>
          <relatedStateVariable>AutoplayIncludeLinkedZones</relatedStateVariable>
        </argument>
        <argument>
          <name>Source</name>
          <direction>in</direction>
          <relatedStateVariable>AutoplaySource</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>GetAutoplayLinkedZones</name>
      <argumentList>
        <argument>
          <name>IncludeLinkedZones</name>
          <direction>out</direction>
          <relatedStateVariable>AutoplayIncludeLinkedZones</relatedStateVariable>
        </argument>
        <argument>
          <name>Source</name>
          <direction>in</direction>
          <relatedStateVariable>AutoplaySource</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>SetAutoplayRoomUUID</name>
      <argumentList>
        <argument>
          <name>RoomUUID</name>
          <direction>in</direction>
          <relatedStateVariable>AutoplayRoomUUID</relatedStateVariable>
        </argument>
        <argument>
          <name>Source</name>
          <direction>in</direction>
          <relatedStateVariable>AutoplaySource</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>GetAutoplayRoomUUID</name>
      <argumentList>
        <argument>
          <name>RoomUUID</name>
          <direction>out</direction>
          <relatedStateVariable>AutoplayRoomUUID</relatedStateVariable>
        </argument>
        <argument>
          <name>Source</name>
          <direction>in</direction>
          <relatedStateVariable>AutoplaySource</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>SetAutoplayVolume</name>
      <argumentList>
        <argument>
          <name>Volume</name>
          <direction>in</direction>
          <relatedStateVariable>AutoplayVolume</relatedStateVariable>
        </argument>
        <argument>
          <name>Source</name>
          <direction>in</direction>
          <relatedStateVariable>AutoplaySource</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>GetAutoplayVolume</name>
      <argumentList>
        <argument>
          <name>CurrentVolume</name>
          <direction>out</direction>
          <relatedStateVariable>AutoplayVolume</relatedStateVariable>
        </argument>
        <argument>
          <name>Source</name>
          <direction>in</direction>
          <relatedStateVariable>AutoplaySource</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>ImportSetting</name>
      <argumentList>
        <argument>
          <name>SettingID</name>
          <direction>in</direction>
          <relatedStateVariable>A_ARG_TYPE_SettingID</relatedStateVariable>
        </argument>
        <argument>
          <name>SettingURI</name>
          <direction>in</direction>
          <relatedStateVariable>A_ARG_TYPE_SettingURI</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>SetUseAutoplayVolume</name>
      <argumentList>
        <argument>
          <name>UseVolume</name>
          <direction>in</direction>
          <relatedStateVariable>AutoplayUseVolume</relatedStateVariable>
        </argument>
        <argument>
          <name>Source</name>
          <direction>in</direction>
          <relatedStateVariable>AutoplaySource</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>GetUseAutoplayVolume</name>
      <argumentList>
        <argument>
          <name>UseVolume</name>
          <direction>out</direction>
          <relatedStateVariable>AutoplayUseVolume</relatedStateVariable>
        </argument>
        <argument>
          <name>Source</name>
          <direction>in</direction>
          <relatedStateVariable>AutoplaySource</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>AddHTSatellite</name>
      <argumentList>
        <argument>
          <name>HTSatChanMapSet</name>
          <direction>in</direction>
          <relatedStateVariable>HTSatChanMapSet</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>RemoveHTSatellite</name>
      <argumentList>
        <argument>
          <name>SatRoomUUID</name>
          <direction>in</direction>
          <relatedStateVariable>SatRoomUUID</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>EnterConfigMode</name>
      <argumentList>
        <argument>
          <name>Mode</name>
          <direction>in</direction>
          <relatedStateVariable>ConfigMode</relatedStateVariable>
        </argument>
        <argument>
          <name>Options</name>
          <direction>in</direction>
          <relatedStateVariable>A_ARG_TYPE_ConfigModeOptions</relatedStateVariable>
        </argument>
        <argument>
          <name>State</name>
          <direction>out</direction>
          <relatedStateVariable>A_ARG_TYPE_ConfigModeState</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>ExitConfigMode</name>
      <argumentList>
        <argument>
          <name>Options</name>
          <direction>in</direction>
          <relatedStateVariable>A_ARG_TYPE_ConfigModeOptions</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>GetButtonState</name>
      <argumentList>
        <argument>
          <name>State</name>
          <direction>out</direction>
          <relatedStateVariable>A_ARG_TYPE_ButtonState</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>SetButtonLockState</name>
      <argumentList>
        <argument>
          <name>DesiredButtonLockState</name>
          <direction>in</direction>
          <relatedStateVariable>ButtonLockState</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
    <action>
      <name>GetButtonLockState</name>
      <argumentList>
        <argument>
          <name>CurrentButtonLockState</name>
          <direction>out</direction>
          <relatedStateVariable>ButtonLockState</relatedStateVariable>
        </argument>
      </argumentList>
    </action>
  </actionList>
</scpd>

Maybe it would be possible to not exclude them but just "hide" (not sure if this is possible) and so still support the other features.

Let me know if you need anything else.

ebaauw added a commit that referenced this issue May 30, 2019
@ebaauw
Copy link
Owner

ebaauw commented May 30, 2019

Seems like there is something in there:

Unfortunately, no, this is exactly the same output as I get from my zoneplayers, that don't support AirPlay 2. It mentions a state variable AirPlayEnabled, but it doesn't seem to be included in any of the API calls (actions). It should be included in DeviceProperties events sent by the zoneplayer.

I've published a beta version that logs these events. Could you please install it (sudo npm -g i homebridge-zp@beta), capture a debug logfile (see https://github.com/ebaauw/homebridge-hue#debug-log-file) and attach the file? Please attach the file, instead of copy/pasting the contents.

I'm not sure if AirPlayEnbled means whether the zoneplayer announced itself on AirPlay, or whether it's actually playing an AirPlay stream. Could you please switch to/from AirPlay 2 input, while capturing the debug log file?

Maybe it would be possible to not exclude them but just "hide" (not sure if this is possible) and so still support the other features.

The only way to do that (sort of) in HomeKit is to move them to an otherwise unused room.

I never tried this before, but I might be able to create the accessory, and not tell homebridge about it. That way I would still have the accessory's structure internally, but it won't be exposed to HomeKit. You would still see it in the homebridge log, however.

@normanmaurer
Copy link
Author

homebridge.log

Here you go... I enabled airplay 2 on OG Schlafzimmer while running it and then stopped again.

@ebaauw
Copy link
Owner

ebaauw commented May 30, 2019

Here you go...

Thanks. What models are ZPS13 (Schafzimmer) and ZPS14 (Wohnzimmer)? The other three, ZPS12, are recent Play:1 models, aren't they?

Ok, it would seem like each player emits a DeviceProperties event, just after homebridge-zp subscribes to these. All your players include AirPlayEnabled in the event, but only Wohnzimmer and Schlafzimmer report value 1. I assume/hope this means that they expose themselves over Airplay 2, not that they're currently streaming an AirPlay 2 source.

I enabled airplay 2 on OG Schlafzimmer while running it and then stopped again.

I don't see that in the log. Could you please start homebridge -D, wait a minute or so (it takes homebridge-zp 15 seconds to search for player, before homebridge actually starts its server and homebridge-zp subscribes to the events from the zoneplayers), start AirPlay, wait another 30 seconds or so, stop AirPlay, and wait another 30 seconds or so before stopping homebridge?

Was AirPlay 2 enabled in Wohnzimmer while you captured the log?

I double-checked my own installation. My ZPS12 Play:1 player also includes AirPlayEnabled in the event; my older ZPS1 Play:1 players, as well as my Play:3 and PlayBar players don't. I would seem that the ZPS12 could support AirPlay 2, but Sonos has disabled this?

@normanmaurer
Copy link
Author

Thanks. What models are ZPS13 (Schafzimmer) and ZPS14 (Wohnzimmer)? The other three, ZPS12, are recent Play:1 models, aren't they?

ZPS13 == Sonos One
ZPS14 == Sonos Beam

All others == Play:1

Ok, it would seem like each player emits a DeviceProperties event, just after homebridge-zp subscribes to these. All your players include AirPlayEnabled in the event, but only Wohnzimmer and Schlafzimmer report value 1. I assume/hope this means that they expose themselves over Airplay 2, not that they're currently streaming an AirPlay 2 source.

Yes this sounds about right...

I don't see that in the log. Could you please start homebridge -D, wait a minute or so (it takes homebridge-zp 15 seconds to search for player, before homebridge actually starts its server and homebridge-zp subscribes to the events from the zoneplayers), start AirPlay, wait another 30 seconds or so, stop AirPlay, and wait another 30 seconds or so before stopping homebridge?

I can try this again later...

Was AirPlay 2 enabled in Wohnzimmer while you captured the log?

No, only for Schlafzimmer (ZPS13)

I double-checked my own installation. My ZPS12 Play:1 player also includes AirPlayEnabled in the event; my older ZPS1 Play:1 players, as well as my Play:3 and PlayBar players don't. I would seem that the ZPS12 could support AirPlay 2, but Sonos has disabled this?

I think what the log shows I right here... Only ZPS13 and ZPS14 support Airplay 2.

ebaauw added a commit that referenced this issue May 30, 2019
Using `DeviceProperties` event, see #74.
@ebaauw
Copy link
Owner

ebaauw commented May 30, 2019

Thanks for the info!

I can try this again later...

Thanks. Could you try with v0.3.20-1 (again, install thru sudo npm -g i homebridge-zp@beta)? This version issues a warning per zoneplayer what capabilities (like AirPlay) and what setup (home theatre, stereo pair) are detected. Could you check that these are correct for the One and the Beam? Thanks.

So the good news: we can detect which zoneplayers support AirPlay 2. The bad news: with the current design of homebridge-zp, this is only detected after the accessory has already been exposed. This might actually be the compelling reason to refactor homebridge-zp to use dynamic platform accessories (see #1).

More bad news: currently, you need the accessory of the (intended) group coordinator to mark it as coordinator, before joining other zones to the group. To be able to join a hidden Airplay 2 player, it must be presented as selectable input. Another thing on my long-term todo list (see #8).

@normanmaurer
Copy link
Author

Yes these are reported correctly:

0|homebrid | [5/30/2019, 5:29:42 PM] [ZP] OG Wohnzimmer Sonos: detected ZPS14 capabilities (please report if wrong): AirPlay: true, audio input: false, TV input: true
0|homebrid | [5/30/2019, 5:29:42 PM] [ZP] OG Schlafzimmer Sonos: detected ZPS13 capabilities (please report if wrong): AirPlay: true, audio input: false, TV input: false

@normanmaurer
Copy link
Author

Let me know if I can help with anything else... And keep up the good work! Thanks a lot :)

ebaauw added a commit that referenced this issue May 31, 2019
- Create the accessory for each zoneplayer as soon as it's discovered, but delay creating the services and characteristics, until after the homebridge server has started.
- Subscribe to `DeviceProperties` events as soon as the accessory has been created, so the discovered capabilities and setup can be used for creating services and characteristics.  Needed for #74.
- No more need for whitelists.
ebaauw added a commit that referenced this issue May 31, 2019
Zoneplayers that support AirPlay 2 already appear in Apple's Home app.  When `"excludeAirPlay": true` is set in config.json, these zoneplayers aren't exposed by homebridge-zp.  See #74.
@ebaauw
Copy link
Owner

ebaauw commented May 31, 2019

The bad news: with the current design of homebridge-zp, this is only detected after the accessory has already been exposed.

Could you try the latest beta (v0.4.0-0)? I refactored the startup of homebridge-zp, so the capabilities are detected before the services and characteristics are created. Zoneplayers supporting AirPlay 2 won't be exposed when "excludeAirPlay": true is specified in config.json.

Could you please capture another debug log and post that, so I can see homebridge-zp works as intended?

More bad news: currently, you need the accessory of the (intended) group coordinator to mark it as coordinator, before joining other zones to the group.

Haven't worked on that one yet. I want to be sure the refactored startup logic works, before making more changes.

@normanmaurer
Copy link
Author

@ebaauw sorry I was not able to capture a debug log yet but from a quick testing all seems to work. When I use excludeAirPlay: true the players that support AirPlay2 will not show up at all, and if I use false these show up. That said if I set it to true these also not show up as "service" and so grouping is not working anymore. But I guess that is what you talked about before...

@ebaauw
Copy link
Owner

ebaauw commented May 31, 2019

if I set it to true these also not show up as "service"

Good catch. Normally homebridge will call getServices() for each (exposed) accessory. I moved the creation of services and characteristics to that function, to make sure the zoneplayer capabilities (like whether it supports AirPlay), have been discovered beforehand. I need to call getServices() myself for the accessories that aren't exposed.

grouping is not working anymore. But I guess that is what you talked about before...

Once I fixed this In v0.4.0-1, the grouping should work if you create a group with an AirPlay 2 zoneplayer as coordinator before starting homebridge. You'll be able to remove and add exposed zones to this group, as long as you don't set the Sonos Coordinator from HomeKit.

ebaauw added a commit that referenced this issue May 31, 2019
Call `getServices()` for excluded zoneplayers, see #74.
@ebaauw
Copy link
Owner

ebaauw commented Jun 3, 2019

Just released v0.4.0. Closing this issue. Input select (and possibility to join the group of a non-exposed ZonePlayer) continues in #8.

@ebaauw ebaauw closed this as completed Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants