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

iOS 11.4 Speaker Service? #36

Closed
leoneleone opened this issue Jun 4, 2018 · 20 comments
Closed

iOS 11.4 Speaker Service? #36

leoneleone opened this issue Jun 4, 2018 · 20 comments
Labels

Comments

@leoneleone
Copy link

@ebaauw
I know this has been discussed before, but I’m wondering if anything has changed under iOS 11.4

Has anyone managed to get the Speaker Service working in the native Home app?
In the past people reported the Home app tiles showing as Unsupported if Service.Speaker HomeKit Accessory Type was used. Do they show up as Speakers under iOS 11.4?

Many thanks for your continued support of this plugin 😀

@jonathansimmons
Copy link

I'd be curious to know if iOS 12 has brought any improvements to this even beyond 11.4.

@michaelsaul
Copy link

michaelsaul commented Jun 13, 2018

According to the HomeKit Deep Dive session at WWDC, iOS 12 does bring support for Speakers as an official accessory type. https://developer.apple.com/videos/play/wwdc2018/231/

I have not installed the beta, but it might be worth checking out.

@ebaauw
Copy link
Owner

ebaauw commented Jun 18, 2018

@leoneleone, no changes in iOS 11.4. The Speaker service only works in conjunction with a Video Doorbell, just as the Microphone service. @jonathansimmons, I haven't tried the iOS 12 beta yet, but I seriously doubt this will change, in iOS 12 or ever.

@michaelsaul, where in the video did you see this? I watched the video, but only found mention that they introduced support for Airplay 2 speakers in the Home app in iOS 11. This has nothing to do with HomeKit, nor with the HomeKit Speaker service over the HomeKit Accessory Protocol, which homebridge uses.

@michaelsaul
Copy link

@ebaauw Yes, going back and listening again, it does say support in the Home App. It's a bit misleading as this was under the section on HAP and is intermixed with all of the other accessories supported.

@leoneleone
Copy link
Author

leoneleone commented Jun 18, 2018

@ebaauw
I believe you are correct. For a Speaker to show up as an independent Speker Service in the Home app it must be added via the Home app using the new AirPlay 2 protocols which somehow link into HomeKit. I don’t see this changing in the future either. We will have to wait and see how 3rd party AirPlay 2 integration works when manufacturers finally push out their AirPlay 2 compatibility. Only a month until Sonos updates their software to support AirPlay 2 🤞🏼

@jonathansimmons
Copy link

I watched the video and did some digging myself and agree it looks like the service itself is unchanged. I was hopeful because of their emphasis on Airplay 2 that the "Speaker" service would be updated. ¯_(ツ)_/¯

@ebaauw
Copy link
Owner

ebaauw commented Jun 18, 2018

Only a month until Sonos updates their software to support AirPlay 2

Yeah, but only for the newer, touch-controlled speakers. I don't have any of those, and I doubt that adding a single Sonos One will automagically enable Airplay 2 for my other speakers. I fear, they'll only airplay when grouped with the Sonos One. I would be very interested to hear the experiences from folks with a mixed old and new Sonos speaker setup.

@leoneleone
Copy link
Author

@ebaauw
You are correct again. You can only AirPlay 2 to one of the newer Sonos models, but it will play to any older model that is grouped to/with the AirPlay 2 capable Sonos speaker.
Thankfully I have a Play:5 (gen2) in my living room, but I planned ahead and sold one of my Sonos Play:1s and purchased a SonosONE to get AirPlay 2 in my bedroom.
I don’t mind having only one AirPlay 2 capable Sonos for each section of my flat. The Home app and the iOS AirPlay interface would get too crowded if all my current Sonos Speakers showed up there .

I suspect I’ll still be using your plugin to switch Sonos speakers on based on motion alerts though.

If you can afford it, I’d say purchased a Sonos ONE and just sell the one you already have 😊

@ebaauw
Copy link
Owner

ebaauw commented Jun 23, 2018

If you can afford it, I’d say purchased a Sonos ONE and just sell the one you already have 😊

On top of my wish list is a Sub for my PlayBar; I'd better start winning the lottery...

Look what I found in the UPnP description for the Device Properties service of all my zone players (PlayBar, Play:1, Play:3 and Connect), see http://ip address:1400/xml/DeviceProperties1.xml:

<stateVariable sendEvents="yes">
  <name>AirPlayEnabled</name>
  <dataType>boolean</dataType>
</stateVariable>

No commands to set or change it, though.

@leoneleone
Copy link
Author

@ebaauw
That’s very Interesting indeed... only a couple of more weeks until official Sonos AirPlay 2 support.
I assume the variable you mention triggers some sort of AirPlay 2 Speaker identifier so that HomeKit can “see” the “accessory” and initiate the HomeKit (adding a Speaker) process.

@ebaauw
Copy link
Owner

ebaauw commented Jul 3, 2018

As I mentioned, there’s no command to set or clear this variable, but since sendEvents is set, it could be included in the event notifications the ZonePlayer sends to the Sonos app. Presumably so the app can show Airplay as an additional input source.

@ebaauw
Copy link
Owner

ebaauw commented Jul 11, 2018

Just got an email from Sonos that they released Airplay2 with v9.0 of their app and firmware. Indeed, the older zone players are only supported when grouped with a newer zone player, see: https://www.sonos.com/en-us/airplay.

Would appreciate if some-one could post a screenshot of the Sonos app when playing Airplay2 source (to see what controls are available, and whether you can select Airplay2 as input).

I'll need some detailed logs to figure out how to recognise when Airplay2 is selected for homebridge-zp. I'd really appreciate if some-one could uncomment this line

// this.log.debug('%s: AVTransport event: %j', this.name, event)
and capture the debug log file, see https://github.com/ebaauw/homebridge-hue#debug-log-file.

@leoneleone
Copy link
Author

@ebaauw

I’ve been testing my Sonos with AirPlay2. The implementation is very limited. Will try to get you the logs you mention. Won’t have time until the weekend.

Things I’ve noticed:

  1. There is no visible way to set AirPlay2 as an input from within the Sonos app.
  2. To enable AirPlay2 from within the Sonos app (AirPlay icon) brings up a list of only the Sonos Speakers (Rooms), which join the same AirPlay(2?) stream. I have a couple of HomePods that are Grouped with my Sonos Speakers in the iOS Music Controls AirPlay 2 interface. These HomePods are not visible in the Sonos app at all.
  3. This renders my previous Automation using your plugin inaccessible. I can’t have the music follow me around the house based on HomeKit Motion Detection 🙁
  4. It looks to me like the newer Sonos Speakers have been updated to “receive” AirPlay2, but the app still can’t be used as a real AirPlay2 “Sender” yet.
  5. There is no control whatsoever, not even Play/Pause functionality like with the HomePods from within the native Home.app, and none of the Sonos Speakers are even visible in any of the 3rd Party HomeKit apps I’ve looked at 🙁

836ed356-5fc0-4084-93b8-5222867c95bf
61417ffb-e4cd-4d8b-982e-e0a11c050153
0105f6af-51b6-4e89-9948-3ad328d8dac3

@leoneleone
Copy link
Author

leoneleone commented Jul 18, 2018

@ebaauw
When initiating a stream from the native iOS Music Controller panel, the Sonos simply says “Playing from AirPlay”.
838382f1-6b9d-4b53-a943-ef9ae8703754
68c772e0-8eb4-4ed5-ba90-1eddbca06d4b

@scheeko
Copy link

scheeko commented Jul 23, 2018

@leoneleone You are correct, but just to clarify your inputs based on my experience:
Things I’ve noticed:

  1. There is no visible way to set AirPlay2 as an input from within the Sonos app.

The Sonos app controls only Sonos devices. Airplay 2, for Sonos, is an added feature, i.e., Sonos players can now be used as Airplay 2 targets; that's it. The only "control" over Airplay 2 streams it has is the start and stop of the stream (it uses the Airplay 2 stream as any other content source).

Using the Sonos app, one tells the Sonos speakers which is the source, and the Speakers are now independent, and linked to the source, e.g. directly connected connected to Spotify. If your phone dies, or you leave home, it doesn't matter, as the speakers are streaming directly from Spotify. Using Airplay 2 from the phone, for instance, the speakers are mere targets of the Airplay 2 stream of the phone. In this case, it would be the Spotify app of the phone, and if you leave home, Sonos will loose the stream and stop playing.

  1. It looks to me like the newer Sonos Speakers have been updated to “receive” AirPlay2, but the app still can’t be used as a real AirPlay2 “Sender” yet.

Exactly. Sonos didn't put their speakers entirely in the Airplay 2 ecosystem (I'm not sure if this is a limitation of Apple or of Sonos). Therefore they are only targets, functioning just like Airplay 1 targets, but that can be grouped by the iOS/Mac content sources.

HomePods / Apple TVs show up as independent content sources on iOS/Macs that can be Played/Paused from, say, the iPhone, and that can use other Airplay 2 devices as targets too. E.g. I can start a HomePod from my iPhone and choose it to play to the HomePod itself as well as to other Airplay 2 targets. But Sonos speakers are mere Airplay 2 targets, so what one does with the HomePod is not possible with Sonos speakers.

  1. There is no control whatsoever, not even Play/Pause functionality like with the HomePods from within the native Home.app, and none of the Sonos Speakers are even visible in any of the 3rd Party HomeKit apps I’ve looked at 🙁

True - the single utility of the Sonos speakers in the Home.app is that they allow one to inform Siri the physical location of the Speakers. Then, if one says "Hey Siri, play Podcast XYZ on the Living Room Sonos", Siri will know which speaker it is and use it as an Airplay 2 target for the Podcast Player. It is not setting a music source in the Sonos system, as, for example, Alexa would do. Other than that, a Sonos Speaker on Home does not function as a Play/Pause switch, has no volume control, nor does it even give any status information (playing/paused), unlike the HomePod.

I'll mostly be away from home in the coming weeks, but if I manage, I'll try to get the log info.

@ebaauw
Copy link
Owner

ebaauw commented Sep 2, 2018

See https://www.macrumors.com/2018/08/28/airport-express-firmware-airplay-2/, the 2012 Airport Express (with dual 2.4GHz/5GHz radio) now supports Airplay 2. I updated mine: it looks very much like the Sonos implementation: you can add the Express to the Home app (not to HomeKit!), so Siri knows it can stream audio to it. However, no control of the volume or even turning it on/off.

I now connect the Airport Express to my Sonos Connect line in, instead of my macMini using Airfoil Speakers. Still hoping Rogue Amoeba will add Airplay 2 support to Airfoil, though.

@leoneleone
Copy link
Author

@ebaauw
Yes I updated mine. Great to see the Airport Express updated to support AirPlay 2.

The problem with using an Airport Express wired to a Sonos Connect is the audio delay that occurs. Sonos (AirportExpress/AirPlay2) stream suffers a lag when played in conjunction with HomePods in the same Room.
I have a mixture of HomePods and Sonos Speakers in my setup. I group the HomePods with my AirPlay2 compatibility (which are grouped in the Sonos app with older Sonos models).

I think ’s implementation of AirPlay2 within HomeKit is seriously lacking. We need control over AirPlay2 grouping and playing/pausing music (even music controls) from inside HomeKit. I don’t think iOS 12 or the  Shortcuts.app will do the trick. In the meantime, I can only attempt to simulate some sort of audio automation using your plugin. Thanks for continuing to work on it 🙏🏼

@ebaauw
Copy link
Owner

ebaauw commented Sep 6, 2018

The problem with using an Airport Express wired to a Sonos Connect is the audio delay that occurs.

Yes, ~5 secs at least. This is due to the Sonos Connect compressing the line-in input. You can disable this compression in the Sonos app under Settings|Advance|General, but I find my Sonos mesh network cannot handle streaming the uncompressed line-in feed to multiple zones (grouped with the Connect).

I think ’s implementation of AirPlay2 within HomeKit is seriously lacking.

There is no Airplay2 within HomeKit. The Airplay 2 support in the Home app has nothing to do with HomeKit.

I don’t think iOS 12 or the  Shortcuts.app will do the trick.

Nor do I; you need a way to control the Airplay 2 device before you can include it in a shortcut.

In the meantime, I can only attempt to simulate some sort of audio automation using your plugin.

I'm afraid that could be a very long meantime...

@ebaauw
Copy link
Owner

ebaauw commented Sep 21, 2018

I'd be curious to know if iOS 12 has brought any improvements to this even beyond 11.4.

I've seen no changes in iOS 12 and tvOS 12.

Closing this issue for now, but feel free to continue to add other info.

@ebaauw ebaauw closed this as completed Sep 21, 2018
@ebaauw
Copy link
Owner

ebaauw commented Sep 22, 2018

I've integrated AirSonos in beta v0.2.34-0, see https://github.com/ebaauw/homebridge-zp/releases. Now all my Sonos zone groups show up as AirTunes speakers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants