-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Expose Sonos as a Speaker instead of a Light #10
Comments
I currently expose a Sonos zone as a Switch service (see README), not as a Lightbulb service. I suspect you set the Type of the Switch service to Light in (one of) your HomeKit app(s). If you set it back to Switch, Siri should leave it alone dealing with your lights. I'm aware of the Speaker service and tried that one originally (before publishing homebridge-zp on GitHub). The Speaker service only contains Volume and Mute as standard characteristics, so I added On as an optional characteristic. However the iOS 10 home app doesn't support that (at least under iOS 10.1 - I haven't checked 10.2 yet). I agree that exposing Sonos as Speaker makes more sense semantically, but I don't think that's worth sacrificing being able to turn on/off the Sonos from the iOS 10 Home app. Note to self: They have added the Speaker service and Volume and Mute characteristics to HAP-NodeJS, so I can delete the definitions for these from homebridge-zp. |
No change to iOS 10.2: Speaker service not supported by iOS Home app. Even under Eve or Home, Mute is shown as the main characteristic (at that's the only non-optional characteristic). |
Light is a much better use until Speaker is supported that means you can say set speaker to 10 and it will do the volume change easily. If someone wants that I can fork this with those changes. |
@NovaGL You'll need to use the Brightness characteristic for volume. I did that on iOS 9, before HomeKit supported the Volume and Mute characteristics. Indeed, it's übercool to have Siri change your speaker volume, and it's very annoying that she includes the Sonos when you want to interact with only the lights. Best use a config.json parameter to select Switch/Volume or Lightbulb/Brightness. |
It's not supported on the Home app so I just changed it to be a lightbulb with brightness. When Siri supports volume then it can be changed back. I don't have smart lights so it doesn't bother me. |
Changed to HAP-NodeJS characteristics in v0.1.2. |
Solved in v0.1.3. |
Thanks, so would you then do. (EDITED)
Or how would you do it? Maybe have it as service. So you can have light, speaker, switch. If not included default to switch. Speaker should be reserved for future as its not natively supported. |
Yes, except for a missing comma and
Good point, @NovaGL , I might as well add support for Once the iOS 10 app supports the |
Thanks, I mainly control my Sonos via https://github.com/jishi/node-sonos-http-api That way I can launch playlists and everything much more easily. I say Hey Siri Play Today's Top Hits |
Another thing can you change model to show model name not model number? |
Technically, I could, but I don't know where to get the model name from. It doesn't seem to be returned in any of the Sonos endpoints homebridge-zp currently uses, and I cannot seem find another endpoint that includes it. @NovaGL do you know how to get the model name? |
There is a very small number of Sonos model numbers, a lookup table should be able to map from model number to model name. A little bit fragile and requires some maintenance, but not too much effort overall. |
I found the model name is in the Player's xml/device_description.xml. I should be able to extract it from there, with a little effort upfront, but without the need to maintain manually a lookup table. |
Dear @ebaauw, first of all I would like to thank you for the clear explanations. I am relatively new to programming but I think that I have managed set up my RPI 3 the way it should. The problem I have is that I am not able to control the Sonos system via the iOS Home app nore the Eve app. It does show the Sonos system but when I try to turn on/turn off the Sonos it comes up with an explanation mark. (The Homebridge-Nest is working fine from both the iOS Home app and Eve). I ran the debug command and it shows that the Sonos is found, connected and even shows activity such as switching channels on Sonos (from TV to radio for example). It also shows an IP address (192.169.0.29...etc) but I am not able to go to that address via my browser. I have forwarded all the ports on my router and I am sure that I am on the same network. UPDATE: I am able to control volume and source from the EVE app, but I can't turn on/turn off the Sonos. That's probably also why I am not able to control that from the iOS Home app. Any ideas what could be wrong? Thanks, |
Hi Melvin, @m3lvn I'm not entirely sure what's going on. Could you please capture the full debug output (see Troubleshooting in the README) and attach that here? As I understand, homebridge-zp and your Sonos seem to have found each other, as you can control volume from Eve. When you change the volume using the Sonos physical +/- buttons or the Sonos app, is that reflected in Eve? Indeed the Home app doesn't support volume, nor mute, nor track, so you can only use the on/off control from that app to play/pause the Sonos. As you mention TV, I assume you have a PlayBar? Note that the PlayBar doesn't accept play/pause when its on TV input - the controls are disabled in the Sonos app, but I have yet to find a way to do that in homebridge-zp. See also issue #12. Can you control the PlayBar if you switch to another input source using the Sonos app? |
My opinion is that Sonos Speakers should be exposed as a HomeKit Speaker (Service), with added:
So what you would see in Eve app for example: Apple's Home app would only show its Speaker icon with NO on-screen controls for brightness/volume, but at least we would have Siri Voice Command control for volume(brightness) and on/off functions. I do like the current exposure as HomeKit Switches and I do use Home app Switches to turn Sonos Speakers (HomeKit Switches) on and off sometimes, but not often enough. I can live without having on-screen controls in Home app if Siri Commands still work (Brightness + On/Off). This just personal taste of course. Has anyone tried adding Characteristic.On to a HomeKit Speaker Service before? I wonder if Home app would at least give you on-screen capabilities to turn a Speaker Service On/Off by tapping the icon..? |
Hi @leoneleone I did try adding On to a Speaker service. This kills the play/pause control from the iOS builtin Home app. In Eve, in the room view, it shows Mute instead of Power. For me, those are dealbreakers. Using a Lightbulb service gives both play/pause and volume control in the builtin Home app, but causes Siri to treat the Sonos as one of your lights, also a dealbreaker. So I was left with Switch. I haven't tried Brightness on a Switch (or any other service than Lightbulb) yet, but I think that could work. Otherwise, we keep a parameter in config.json, to cater for personal taste. Sonos does support mute - that's what homebridge-zp uses for Mute. Note that the HomeKit Speaker service is meant for doorbells: Mute is a mandatory characteristic, and the only standard optional characteristic is Volume. It might be a long time before Siri handles Volume. |
Hi @ebaauw, thanks for your comments! I will try to see if I can control the Sonos in case I switch to another input. I will run a debug report when I am back home tonight. PS: not sure if this is the place to ask but is there an easy guide/manual to setup homebridge-zp so that I can ask Siri to play a certain track or playlist? |
OK, I did some extensive testing with different service/characteristic combinations:
Conclusions
Next Steps
@leoneleone @NovaGL @jasongoldsmith , please let me know what you think. |
@m3lvn Currently, there's no way to select a music source in homebridge-zp (see issue #8). Even if there were, it would be through custom characteristics, which Siri won't understand. My approach would be:
@NovaGL I took a look at node-sonos-http-api, but I don't understand how that enables you to launch your playlist from Siri. Can you please shed light on your setup? |
I am confused why you would want to use fan as a service. I am personally happy with light but I don't have other smart lights. @ebaauw The HTTP API is just that an API, it is up to you how you use it. I have mapped buttons to the favourites it then switches to to that favourite when telling that switch to turn on. |
- Explicit grouping/ungrouping control (issue #3); - Group volume and mute control (issue #4); - Allow different combinations of HomeKit service and characteristic for volume (issue #10); - Bumped dependency to sonos@0.14.0 (issue bencevans/node-sonos#152).
v0.1.4 - @leoneleone @NovaGL @jasongoldsmith please let me know if this works for you. @NovaGL: using |
@ebaauw |
Some cleanup and enhancements in v0.1.5. @leoneleone please test this version.
|
@leoneleone , please see pull request #13 for new info on stop vs pause. |
Hello I will use the plugin with fan to control the volume, but i don't know whats the right setting for the config. "platforms": [ Is this right, i don't know i read something from rotation speed but where is the setting for that? I hope you can help me. regards |
The |
In 71397d1. |
HomeKit has an accessory type of Speaker with Mute and Volume characteristics. Exposing Sonos as a light has side effects ("Siri, turn off the lights" will turn off the Sonos for example).
Exposing the Sonos as a speaker would also be more semantically correct.
Speakers are at line 3060 (approximately)
https://github.com/KhaosT/HAP-NodeJS/blob/master/lib/gen/HomeKitTypes.js
The text was updated successfully, but these errors were encountered: