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

Doesnt work with Sonos Playbar? #2

Closed
amitgandhinz opened this issue Nov 28, 2015 · 11 comments
Closed

Doesnt work with Sonos Playbar? #2

amitgandhinz opened this issue Nov 28, 2015 · 11 comments

Comments

@amitgandhinz
Copy link
Contributor

I havent been able to get this working with my Sonos Playbar.

I have set up the Sonos in the "accessories" section of the config.json, with the "room" value matching the Room Name in the Sonos iOS app.

"accessories": [
{
"accessory": "Sonos",
"room": "Family Room",
"name": "TV Speakers"
}
]

Here are my logs:

Loading 1 accessories...
[TV Speakers] Initializing Sonos accessory...

Sat, 28 Nov 2015 18:52:05 GMT EventedHTTPServer [::ffff:192.168.1.69] HTTP request: /characteristis
Sat, 28 Nov 2015 18:52:05 GMT HAPServer [b8:27:eb:44:f8:79] HAP Request: PUT /characteristics
Sat, 28 Nov 2015 18:52:05 GMT Accessory [PiBridge] Processing characteristic set: {"characteristic":[{"aid":2,"iid":9,"value":false}]}
Sat, 28 Nov 2015 18:52:05 GMT Accessory [PiBridge] Setting Characteristic "On" to value false
[TV Speakers] Ignoring request; Sonos device has not yet been discovered.
Sat, 28 Nov 2015 18:52:05 GMT Accessory [PiBridge] Error setting Characteristic "On" to value fals: Sonos has not been discovered yet.
Sat, 28 Nov 2015 18:52:05 GMT HAPServer [b8:27:eb:44:f8:79] Error setting characteristics: Sonos hs not been discovered yet.

@fwboettger
Copy link
Contributor

@amitgandhinz - do you have a Sonos Sub as well (paired with the playbar) or do you maybe even also pair another set of speakers (play1, play3 or play5's) with the playbar to a 5.1 surround home cinema setup?

@amitgandhinz
Copy link
Contributor Author

@fwboettger Thanks for getting back to me. The only Sonos device i have is the Playbar. No sub or play1/3/5's.

It randomly started finding the device the other day (ie no longer errors). However, the controls dont turn the speaker on/off. Doing so would be a nice way to mute the TV via Siri Homekit.

Thanks

@fwboettger
Copy link
Contributor

@amitgandhinz - and the name of the room / the zone you've given in your Sonos smartphone/tablet/desktop app is exactly "Family Room"?

@chadyj
Copy link

chadyj commented Jan 21, 2016

I have a similar issue. In my case I successfully setup Homebridge and homebridge-sonos and can start/stop 2 different Sonos as well as control with Siri. But at some point it stops working and I see errors like:

Thu, 21 Jan 2016 01:03:49 GMT EventedHTTPServer [::ffff:10.0.1.11] HTTP request: /characteristics
Thu, 21 Jan 2016 01:03:49 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics
Thu, 21 Jan 2016 01:03:49 GMT Accessory [Homebridge] Processing characteristic set: [{"aid":2,"iid":9,"value":true}]
Thu, 21 Jan 2016 01:03:49 GMT Accessory [Homebridge] Setting Characteristic "On" to value true
[Kitchen Sonos] Ignoring request; Sonos device has not yet been discovered.
Thu, 21 Jan 2016 01:03:49 GMT Accessory [Homebridge] Error setting Characteristic "On" to value true:  Sonos has not been discovered yet.
Thu, 21 Jan 2016 01:03:49 GMT EventedHTTPServer [::ffff:10.0.1.11] HTTP Repsonse is finished

FWIW this is running on a Raspberry Pi. Rebooting doesn't fix the problem.
However I can get things working again if I delete the homebridge/persist/ folder.

Config file is

{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    },

    "description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",

    "accessories": [
   {
     "accessory": "Sonos",
     "name": "Kitchen Sonos",
     "room": "Kitchen"
   },
   {
     "accessory": "Sonos",
     "name": "Living Room Sonos",
     "room": "Living Room"
   }
 ]
}

@fwboettger
Copy link
Contributor

@chadyj - did you change the "grouping" of your devices (your rooms) via the Sonos Desktop/Smartphone/Tablet app (after you started homebridge)? Would be good to know which devices you have in which room, and if there are any paired/grouped ones...

@chadyj
Copy link

chadyj commented Jan 24, 2016

@fwboettger Didn't touch the groupings. None are paired/grouped.

@fwboettger
Copy link
Contributor

@chadyj - sorry, then i don't have an idea i'm afraid, sorry to not being able to help....

@rudders
Copy link

rudders commented Feb 4, 2016

I have a similar problem - Sonos Playbar and a Play:3 and I get errors connecting to one or the other - I'll investigate and get back to this thread.

@amitgandhinz
Copy link
Contributor Author

amitgandhinz commented Dec 8, 2016

So i finally found time to dig back into the sonos playbar integration with this plugin.

It looks like a lot of the updates this year fixed my detection issue - yay =)

However, the getCurrentState == 'playing' and this.device.play and this.device.stop do not work for the Sonos Playbar.

I have made a fix for this locally, where instead of doing the current actions in the code, flipping the speaker switch off will instead call setMuted(true) and switching it on will setMuted(false). Getting the current state will use getMuted().

I will need to investigate how I can override these in the main branch only if the device type is a Playbar, so it doesnt interfere with Sonos Play 1/3/5 devices.

See #46 for work on this.

@amitgandhinz
Copy link
Contributor Author

This is now resolved in #46

@amitgandhinz
Copy link
Contributor Author

Also note I just discovered why play/stop wasnt working on the playbar.

Those endpoints dont work when the Playbar is using the TV Audio In line. If the playbar is put into music mode via the Sonos App, then the play/stop commands via homebridge appear to work. The trick is now to find a way to programmatically switch the audio source for the playbar.

I am tracking the issue for switching the inputs here - bencevans/node-sonos#148

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

No branches or pull requests

4 participants