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).
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.
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
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.