Sonos - Play:1 as Audio Sink

For a while now I have been using my Sonos Play:1 as an Audio sink and using it to make various announcements. Such as saying good morning when the motion sensor in the kitchen is first set to active after 6am. Also in the evenings there is a reminder to load the kitchen door before heading up to bed.
This was working great until I upgraded to the latest version of OH (2.5.3) and now it’s not working at all. Has there been a change to the way Audio sink works and can be resolved with a change to my configuration or have I just been unlucky?

As I’m running OH on a VM I’m happy to rebuild and start from scratch, but that would have to be a last resort.

Could you give a bit more details?
Or do we have assume that you are using a rule to start the announcement(?), a rule which has some logInfo lines which do or do not showin the log(?)
What is the actual “state” of the sonosplayer, of better how was the last playing initiated (by an Echo or GoogleHome device?, the sonos app would show a radio station played via TuneIn directly different from Echo devices).

Hi Jurgen,

Here’s a simplified rule that I used as a test.

val String filename = "Announcements.rules"

rule "Morning Announcement"
when
        Item Morning_Announcement received update
then
Announcement_Made.sendCommand(1)
if(now.getHourOfDay > 6 || Announcement_Made.state == 1) return;
var String vAnnouncement = Morning_Announcement.state
say(vAnnouncement)
logInfo(filename, "Announcement Made: Good Morning")
end

There isn’t anything in my logs to offer any kind of explanation. The speaker works normally fine, I can play from my music collection, Tune-in radio works fine. It’s as if the Play:1 isn’t being sent anything at all.

Is the Play1 set as your default AudioSink?
Do you see the logInfo line in the logs, as if the message was sent to the Play1?
You are sending the command “1” to the item Announcement_Made and you are checking IMMEDIATELY afterwards if the state of that item is “1”. That might not have happened yet, but could!

The most easy way to check if voicecommands are played by the audiosink is using the Karaf console, that way you would have immediate response.

Yes the Play:1 is my default AudioSink. I’ve checked and double checked that.

I run OH as a daemon, so will have to shut it down to test. Thanks for the pointer.

If you need to shut down OH, I would check the other questions first.
A rule with just a say command for example should do also.

Here’s whats in the log. So now I’m really confused because this doesn’t match what the config in PaperUI has.

2020-04-06 13:20:35.845 [WARN ] [core.audio.internal.AudioManagerImpl] - Default AudioSink service 'sonos:PLAY1:Kitchen' not available!
2020-04-06 13:20:35.845 [WARN ] [core.voice.internal.VoiceManagerImpl] - Error saying 'Good Morning.': Unable to find the audio sink null
org.eclipse.smarthome.core.voice.TTSException: Unable to find the audio sink null
        at org.eclipse.smarthome.core.voice.internal.VoiceManagerImpl.say(VoiceManagerImpl.java:210) ~[?:?]
        at org.eclipse.smarthome.model.script.actions.Voice.say(Voice.java:121) ~[?:?]
        at org.eclipse.smarthome.model.script.actions.Voice.say(Voice.java:40) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_242]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_242]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_242]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_242]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.invokeOperation(XbaseInterpreter.java:1175) ~[?:?]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.invokeOperation(XbaseInterpreter.java:1150) ~[?:?]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._invokeFeature(XbaseInterpreter.java:1136) ~[?:?]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.invokeFeature(XbaseInterpreter.java:1081) ~[?:?]
        at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.invokeFeature(ScriptInterpreter.java:151) ~[?:?]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:991) ~[?:?]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:954) ~[?:?]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:235) ~[?:?]
        at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.doEvaluate(ScriptInterpreter.java:226) ~[?:?]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:215) ~[?:?]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:458) ~[?:?]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:239) ~[?:?]
        at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.doEvaluate(ScriptInterpreter.java:226) ~[?:?]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:215) ~[?:?]
        at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.evaluate(XbaseInterpreter.java:201) ~[?:?]
        at org.eclipse.smarthome.model.script.runtime.internal.engine.ScriptImpl.execute(ScriptImpl.java:81) ~[?:?]
        at org.eclipse.smarthome.model.rule.runtime.internal.engine.RuleEngineImpl.lambda$2(RuleEngineImpl.java:313) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_242]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_242]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_242]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_242]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_242]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_242]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
2020-04-06 13:20:35.873 [INFO ] [ome.model.script.Announcements.rules] - Announcement Made: Good Morning

image

I haven’t moved to 2.53 (yet). So I can’t say anything concerning the update. However I would check if Sonos and OH are on the same network.
It seems you have tried to (re)set the default audiisink
Other then that, I’m out of clues.

Thanks for you help, I think I’m going to drop back down to 2.5.0 to see if that makes any difference at all.

I also tried to hard code the AudioSink via the runtime.cfg and that didn’t help either.

Did you try to delete the Play1 thing and recreate it?

Yup, tried that. Time to go down the road of clean install and see where that take me.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.