[SOLVED] Sonos Binding -> Beam play notification while playing TV Source

Before I post an issue on Github, wanted to quickly discuss here to see if I maybe missed something.

I have two questions with regards to the Sonos Beam and more the Sonos Binding.

  1. When my Sonos Beam is set to TV (it plays the sound from my TV via HDMI) I cannot play a Notification. When I play music, the notification works.

  2. I would like to select via the binding the TV source on the Sonos Beam. Is this already possible?

I think it is not added to the binding yet, I think it should be possible if I read the information on the Sonos API site:
https://developer.sonos.com/reference/control-api/hometheater/

It should but it apparently never worked well with the Playbar.
Not easy to help without owning such a model, I already tried several times.
If you have the knowledge to deploy a specific version with additional logs and report the results, we can try again.

I have the Beam, not the Playbar. I can deploy a specific jar in the right folder and use that to test it. I can report the logs from my log files. Would that suffice?

Yes, it could help. I will prepare the version with more logs.
I expect similar behavior for playbar and beam.

Ideally, you should run a 2.5 version of openHAB. It could run too with a version 2.4 but I am not sure.
To update your binding:
1 - download the following Sonos jar file and put it for example in directory /home/pi (don’t put it in your openHAB addons folder).
2 - run the following command in the openHAB console to get your bundle id: bundle:list -s | grep sonos
3 - run the following command to replace your Sonos binding, assuming the previous command returned 245: bundle:update 245 file:///home/pi/sonos.jar

All the logs I added are at INFO level and contain the string “Beam_LineIn”, so you have no level to update.

After a restart of the bundle, please provide the log entries containing “Beam_LineIn”.

Now select with the Sonos app the TV input for your Beam device. Please provide the new log entries containing “Beam_LineIn”.

Now try a notification. Please provide the new log entries containing “Beam_LineIn”.

I’ve sent the log files to you by DM. The notification sound did not play.

I’m running version 2.5.0.M2.

Thanks for your support.

Interesting, I was expecting a different problem. It looks like the binding is correctly detecting that you are listening the TV input. The problem is that the notification sound is apparently not started and after 20 seconds, the TV sound is restored.
Can you at least confirm that the TV sound is correctly restored after the 20 seconds ?

I will add new logs.

I just uploaded a new jar file with additional traces, can you please try again ?

I suspect that the problem is that the binding is first trying to stop the audio from the current source, the TV input in your case. For an unexplained reason, maybe the state remains in PLAYING state. I will probably see what is going wrong with the new traces.

Any news?

Sorry for the delay.
I’ve sent you the logs.
So far it did not play the sound, and also there was no ‘break’ in the playback for 20 seconds.

The last logs should really help me.
Stop is not working, I will try to replace it by pause.

Ok and do you also know how you can ‘select’ the TV source with a command?

Of course, this is with the channel playlinein. Tell me if it does not work.

That doesn’t seem to be working, this is my rule for a test switch:

rule "Switch Sonos Beam to TV line in"
when    
    Item Sonos_LR_PlayTV received update
then
    logInfo("Sonos Rule","is it working?")
    Sonos_LR_TVLinein.sendCommand("lr")
end

lr is the Thing ID of the Beam.

item:
String Sonos_LR_TVLinein "Play TV sound" (gSonos {channel="sonos:BEAM:lr:playlinein"}

Please provide logs when running this command with the special binding version.

Just sent them to you. Hope it helps.

The line-in is not played because the binding is detecting no connected line-in.
Strangely in your previous logs, I see that a connected digital line-in is correctly detected. Strange.

Ok. Could it have something that it is not a ‘traditional’ line-in but an audio/TV in via HDMI? Do the Sonos API docs give some clarification?

As a reminder, the binding is based on an undocumented UPnP API and some reverse-engineering.

Ok, didn’t know that.