Open kTitan opened 7 years ago
These mode are available on Playbar, Playbase and Beam.
As a side note, support for playbase and bean devices was not yet been added.
For owners of playbase and bean devices, please run and provide the result of http://<deivce IP>:1400/xml/device_description.xml
replacing
For adding new specific features, this will at least require the help of someone owning such a device and having the technical skill to play with the UPnP tool "device spy" to identify what are the specific UPnP actions available to get/set the night mode for example. Sorry but I have no such Sonos devices.
Half the work could even be done by anyone that would like to help me to add these new features. To help, log to the openHAB console and enable TRACE logs for the binding with this command: log:set TRACE org.eclipse.smarthome.binding.sonos
and then run "log:tail".
Then go in your Sonos control application and play with the new modes. See in the openHAB logs all logs starting with "Received pair". One certainly matches the night mode and another the speech enhancement mode. Show me the full line for each possible modes.
I suppose that these modes are only ON or OFF modes. I suppose the values are 0 and 1 and the service is RenderingControl but no idea of the name of the property.
As an example for volume mute, here are the interesting lines:
13:22:17.442 [TRACE] [os.internal.handler.ZonePlayerHandler] - Received pair 'MuteMaster':'1' (service 'RenderingControl') for thing 'sonos:CONNECT:salon'
13:22:26.753 [TRACE] [os.internal.handler.ZonePlayerHandler] - Received pair 'MuteMaster':'0' (service 'RenderingControl') for thing 'sonos:CONNECT:salon'
When done, don't forget to restore INFO level for the binding logs.
please run and provide the result of http://
:1400/xml/device_description.xml
This is the xml output for a Sonos Beam `
`
Night Mode enabled
14:10:09.978 [TRACE] [os.internal.handler.ZonePlayerHandler] - Received pair 'LastChange':'<Event xmlns="urn:schemas-upnp-org:metadata-1-0/RCS/"><InstanceID val="0"><DialogLevel val="0"/><SurroundLevel val="0"/><MusicSurroundLevel val="0"/><AudioDelay val="0"/><AudioDelayLeftRear val="0"/><AudioDelayRightRear val="0"/><NightMode val="1"/><SurroundEnabled val="1"/><SurroundMode val="0"/></InstanceID></Event>' (service 'RenderingControl') for thing 'sonos:zoneplayer:RINCON_347E5CXXXXXX01400'
Night Mode disabled
14:11:38.615 [TRACE] [os.internal.handler.ZonePlayerHandler] - Received pair 'LastChange':'<Event xmlns="urn:schemas-upnp-org:metadata-1-0/RCS/"><InstanceID val="0"><DialogLevel val="0"/><SurroundLevel val="0"/><MusicSurroundLevel val="0"/><AudioDelay val="0"/><AudioDelayLeftRear val="0"/><AudioDelayRightRear val="0"/><NightMode val="0"/><SurroundEnabled val="1"/><SurroundMode val="0"/></InstanceID></Event>' (service 'RenderingControl') for thing 'sonos:zoneplayer:RINCON_347E5CXXXXXX01400'
Speech Enhancement enabled
14:14:16.747 [TRACE] [os.internal.handler.ZonePlayerHandler] - Received pair 'LastChange':'<Event xmlns="urn:schemas-upnp-org:metadata-1-0/RCS/"><InstanceID val="0"><DialogLevel val="1"/><SurroundLevel val="0"/><MusicSurroundLevel val="0"/><AudioDelay val="0"/><AudioDelayLeftRear val="0"/><AudioDelayRightRear val="0"/><NightMode val="0"/><SurroundEnabled val="1"/><SurroundMode val="0"/></InstanceID></Event>' (service 'RenderingControl') for thing 'sonos:zoneplayer:RINCON_347E5CXXXXXX01400'
Speech Enhancement disabled
14:14:19.477 [TRACE] [os.internal.handler.ZonePlayerHandler] - Received pair 'LastChange':'<Event xmlns="urn:schemas-upnp-org:metadata-1-0/RCS/"><InstanceID val="0"><DialogLevel val="0"/><SurroundLevel val="0"/><MusicSurroundLevel val="0"/><AudioDelay val="0"/><AudioDelayLeftRear val="0"/><AudioDelayRightRear val="0"/><NightMode val="0"/><SurroundEnabled val="1"/><SurroundMode val="0"/></InstanceID></Event>' (service 'RenderingControl') for thing 'sonos:zoneplayer:RINCON_347E5CXXXXXX01400'
Excellent !
I can already add the automatic discovery of Sonos Bean.
I can already add 2 new switch channels for NightMode and DialogLevel., at least as read only channels. Or for the control from the binding, I could make the hypothesis that the actions SetDialogLevel
and SetNightMode
are available for these devices.
For the Sonos Bean, we could have the same problem as with the Playbar, that is the correct detection of the connected line in (which is even different on the Bean because it is HDMI and not optical) and the correct way to start the playback of the line-in (TV sound) on other Sonos devices.
With the same binding logs enabled (TRACE), could you please stop the binding with bundle:stop xxx
and then start it bundle:start xxx
and finally search after few seconds for LineInConnected
or TOSLinkConnected
or even something else like HDMILinkConnected
???
I will also certainly need your value for the channel currenttransporturi
when your Sonos Bean is playing the TV sound.
Rather than restarting the binding, you can unplug the HDMi link and check what values are received by the binding.
after plugin HDMI:
17:15:17.388 [TRACE] [os.internal.handler.ZonePlayerHandler] - Received pair 'TOSLinkConnected':'true' (service 'HTControl') for thing 'sonos:zoneplayer:RINCON_347E5CXXXXXX01400'
value for channel currenttransporturi
is x-sonos-htastream:RINCON_347E5CXXXXXX01400:spdif
My Beam is connected with optical SPDIF and a Sonos Adapter to HDMI port on Beam because my TV does not have a HDMI ACR port.
In this case, it looks fully similar to playbar. Unfortunately I was told that restore after TTS is not working well with playbar so we can expect similar issue with playbase and bean. I will add some debug logs to help understanding with your help what's wrong.
Unfortunately, it is difficult for me to guess the name and accepted values for the actions. The probability that I made the good choice is very low. If someone could use device spy (UPnP tool) to check that, that would help.
Anyone owning a Sonos playbase ?
@pdcemulator : if you could install the UPnP developer tools and start Device Spy
, we could discover the actions behind night mode and speech enhabcement ... rather than having me trying to guess...
What I would need is the equivalent of this:
A topic on the forum leads me tp https://github.com/jishi/node-sonos-http-api/issues/108
I have now what I need. I will update my PR.
I am currently migrating my fhem installation to openhab. Here I have noticed that the SONOS Binding is missing the possibility to set the NightMode and DialogLevel Status. I am using this in fhem for switching the status in the night, to not disturb the neighbors. As far as I know these options are only supported for the Playbar.
It would be nice to get these options added.
Here is the link to the module of fhem (perl): https://github.com/mhop/fhem-mirror/blob/05af8e7afc91f0d166241b446d5d2d39fb7b4ec3/fhem/FHEM/00_SONOS.pm#L7585-L7605