"say" and "playsound" dosnt work

Hi,
I am trying to set up a rule that play sound or speak. Regarding to: https://github.com/openhab/openhab2-addons/tree/master/addons/binding/org.openhab.binding.squeezebox

rule "SqueezeBox Kueche"
when Item EG_K_SAY received command ON
then
	logInfo("SB-Test","say voiceRSS Squeezebox")
	say("Hallo Welt", "voicerss:deDE", "squeezebox:squeezeboxplayer:D86F7CB5-C4DC-4D83-8E2D-C29427310EC6:0004202d5ae1")
	
	logInfo("SB-Test","say voiceRSS WebSound")
	say("Hallo Welt", "voicerss:deDE", "WebSound")
	
	logInfo("SB-Test","play doorbell Squeezebox")
	PlaySound("squeezebox:squeezeboxplayer:D86F7CB5-C4DC-4D83-8E2D-C29427310EC6:0004202d5ae1", "doorbell.mp3")
	
	logInfo("SB-Test","play doorbell WebSound")
	PlaySound("webaudio", "doorbell.mp3")
end

My sinks are:

openhab> smarthome:audio sinks
squeezebox:squeezeboxplayer:D86F7CB5-C4DC-4D83-8E2D-C29427310EC6:0004202d5ae0
enhancedjavasound
squeezebox:squeezeboxplayer:D86F7CB5-C4DC-4D83-8E2D-C29427310EC6:00042012ce8e
javasound
webaudio
squeezebox:squeezeboxplayer:D86F7CB5-C4DC-4D83-8E2D-C29427310EC6:000420267022

But there is no Sound.

2017-09-06 18:47:31.225 [INFO ] [lipse.smarthome.model.script.SB-Test] - say voiceRSS Squeezebox
2017-09-06 18:47:31.234 [INFO ] [lipse.smarthome.model.script.SB-Test] - say voiceRSS WebSound
2017-09-06 18:47:31.244 [INFO ] [lipse.smarthome.model.script.SB-Test] - play doorbell Squeezebox
2017-09-06 18:47:31.251 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'SqueezeBox Kueche': An error occurred during the script execution: The name 'PlaySound(<XStringLiteralImpl>,<XStringLiteralImpl>)' cannot be resolved to an it
em or type.

If I send

openhab> smarthome:voice say Hallo Welt

on the Console I can hear it in my Webbrowser. Whats wrong?

– Christoph

Maybe try changing PlaySound to playsound (i.e. all lower case).

I forgot to write that. I’ve also tried it lower case.

Ok. It needs to be lower case to avoid the error you are seeing in the logs.

What type of devices are you using for your squeezebox players? If the device uses an older version of squeezelite, there’s a known issue when playing short duration notifications.

I own two Logitech SqueezeBox Radio devices.

Logitech Media Server Version: 7.7.5

Player-Modell: Squeezebox Radio
Firmware: 7.7.3-r16676

Hmm. That should work.

Can you put the squeezebox binding in debug mode, then post the relevant log file lines on this thread?

2017-09-06 19:59:25.256 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - no connection to squeeze server when trying to send command, returning...
2017-09-06 19:59:32.552 [INFO ] [lipse.smarthome.model.script.SB-Test] - say voiceRSS Squeezebox
2017-09-06 19:59:32.572 [INFO ] [lipse.smarthome.model.script.SB-Test] - say voiceRSS WebSound
2017-09-06 19:59:32.582 [INFO ] [lipse.smarthome.model.script.SB-Test] - play doorbell Squeezebox
2017-09-06 19:59:32.592 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'SqueezeBox Kueche': An error occurred during the script execution: The name 'PlaySound(<XStringLiteralImpl>,<XStringLiteralImpl>)' cannot be resolved to an it
em or type.

openhab> bundle:requirements 207 | less

org.openhab.binding.squeezebox_2.1.0 [207] requires:
----------------------------------------------------
osgi.wiring.package; (osgi.wiring.package=com.google.common.collect) resolved by:
   osgi.wiring.package; com.google.common.collect 18.0.0 from com.google.guava_18.0.0 [11]
osgi.wiring.package; (osgi.wiring.package=com.google.gson) resolved by:
   osgi.wiring.package; com.google.gson 2.3.1 from com.google.gson_2.3.1 [10]
osgi.wiring.package; (osgi.wiring.package=org.apache.commons.io) resolved by:
   osgi.wiring.package; org.apache.commons.io 2.2.0 from org.apache.commons.io_2.2.0 [29]
osgi.wiring.package; (osgi.wiring.package=org.apache.commons.lang) resolved by:
   osgi.wiring.package; org.apache.commons.lang 2.6.0 from org.apache.commons.lang_2.6.0 [30]
osgi.wiring.package; (osgi.wiring.package=org.eclipse.jetty.client) resolved by:
   osgi.wiring.package; org.eclipse.jetty.client 9.2.19 from org.eclipse.jetty.client_9.2.19.v20160908 [68]
osgi.wiring.package; (osgi.wiring.package=org.eclipse.jetty.client.api) resolved by:
   osgi.wiring.package; org.eclipse.jetty.client.api 9.2.19 from org.eclipse.jetty.client_9.2.19.v20160908 [68]
osgi.wiring.package; (osgi.wiring.package=org.eclipse.jetty.client.util) resolved by:
   osgi.wiring.package; org.eclipse.jetty.client.util 9.2.19 from org.eclipse.jetty.client_9.2.19.v20160908 [68]
osgi.wiring.package; (osgi.wiring.package=org.eclipse.jetty.http) resolved by:
   osgi.wiring.package; org.eclipse.jetty.http 9.2.19 from org.eclipse.jetty.http_9.2.19.v20160908 [70]
osgi.wiring.package; (osgi.wiring.package=org.eclipse.jetty.util.component) resolved by:
   osgi.wiring.package; org.eclipse.jetty.util.component 9.2.19 from org.eclipse.jetty.util_9.2.19.v20160908 [83]
osgi.wiring.package; (osgi.wiring.package=org.eclipse.smarthome.config.core) resolved by:
   osgi.wiring.package; org.eclipse.smarthome.config.core 0.0.0 from org.eclipse.smarthome.config.core_0.9.0.b5 [94]
osgi.wiring.package; (osgi.wiring.package=org.eclipse.smarthome.config.discovery) resolved by:
   osgi.wiring.package; org.eclipse.smarthome.config.discovery 0.0.0 from org.eclipse.smarthome.config.discovery_0.9.0.b5 [95]
osgi.wiring.package; (osgi.wiring.package=org.eclipse.smarthome.core.audio) resolved by:
   osgi.wiring.package; org.eclipse.smarthome.core.audio 0.0.0 from org.eclipse.smarthome.core.audio_0.9.0.b5 [99]
osgi.wiring.package; (osgi.wiring.package=org.eclipse.smarthome.core.library.types) resolved by:
   osgi.wiring.package; org.eclipse.smarthome.core.library.types 0.0.0 from org.eclipse.smarthome.core_0.9.0.b5 [98]
osgi.wiring.package; (osgi.wiring.package=org.eclipse.smarthome.core.net) resolved by:
   osgi.wiring.package; org.eclipse.smarthome.core.net 0.0.0 from org.eclipse.smarthome.core_0.9.0.b5 [98]
osgi.wiring.package; (osgi.wiring.package=org.eclipse.smarthome.core.thing) resolved by:
   osgi.wiring.package; org.eclipse.smarthome.core.thing 0.0.0 from org.eclipse.smarthome.core.thing_0.9.0.b5 [105]
osgi.wiring.package; (osgi.wiring.package=org.eclipse.smarthome.core.thing.binding) resolved by:
   osgi.wiring.package; org.eclipse.smarthome.core.thing.binding 0.0.0 from org.eclipse.smarthome.core.thing_0.9.0.b5 [105]
osgi.wiring.package; (osgi.wiring.package=org.eclipse.smarthome.core.types) resolved by:
   osgi.wiring.package; org.eclipse.smarthome.core.types 0.0.0 from org.eclipse.smarthome.core_0.9.0.b5 [98]
osgi.wiring.package; (osgi.wiring.package=org.eclipse.smarthome.io.transport.upnp) resolved by:
   osgi.wiring.package; org.eclipse.smarthome.io.transport.upnp 0.0.0 from org.eclipse.smarthome.io.transport.upnp_0.9.0.b5 [203]
osgi.wiring.package; (osgi.wiring.package=org.jupnp) resolved by:
   osgi.wiring.package; org.jupnp 0.0.0 from org.jupnp_2.2.0 [162]
osgi.wiring.package; (osgi.wiring.package=org.jupnp.model) resolved by:
   osgi.wiring.package; org.jupnp.model 0.0.0 from org.jupnp_2.2.0 [162]
osgi.wiring.package; (osgi.wiring.package=org.jupnp.model.meta) resolved by:
   osgi.wiring.package; org.jupnp.model.meta 0.0.0 from org.jupnp_2.2.0 [162]
osgi.wiring.package; (osgi.wiring.package=org.jupnp.model.types) resolved by:
   osgi.wiring.package; org.jupnp.model.types 0.0.0 from org.jupnp_2.2.0 [162]
osgi.wiring.package; (osgi.wiring.package=org.osgi.framework) resolved by:
   osgi.wiring.package; org.osgi.framework 1.8.0 from org.eclipse.osgi_3.10.101.v20150820-1432 [0]
osgi.wiring.package; (osgi.wiring.package=org.slf4j) resolved by:
   osgi.wiring.package; org.slf4j 1.7.13 from org.ops4j.pax.logging.pax-logging-api_1.8.5 [1]
osgi.wiring.package; (osgi.wiring.package=org.openhab.binding.squeezebox) [UNRESOLVED]
osgi.wiring.package; (osgi.wiring.package=org.openhab.binding.squeezebox.handler) [UNRESOLVED]

maybe thats my problem :face_with_raised_eyebrow:

The last error shows that you were using “PlaySound” instead of “playsound”.

Regarding the missing sound for the say command, please confirm that your VoiceRSS is setup correctly. If it is you should have the sound-files in the folder “userdata/voicerss/cache” on a linux-system that would be “var/lib/openhab2/voicerss/cache”.
[Edit] Forget the last, I missed your last statement in the first post.

1 Like

Also your used audiosinks are not matching the listed ones!
The list has: "squeezebox:squeezeboxplayer:D86F7CB5-C4DC-4D83-8E2D-C29427310EC6:0004202d5ae0"
You are using "squeezebox:squeezeboxplayer:D86F7CB5-C4DC-4D83-8E2D-C29427310EC6:0004202d5ae1"
And in the list there are “webaudio” and “javasound” but you are using “WebSound”!

1 Like

It should actually be “playSound”

I think there is a bug in the latest builds that playSound isn’t working.

Mine has worked fine up until last week when I updated to the 09/10 snapshot. I submitted a bug report:

I’m sorry, Yes, that is correct.
However, you filled an Issue on Github without mentioning the related binding. I suggest you include which binding you are using in the issue.

Thanks, but It’s part of the core, not a binding.

@Kai Others are having this issue as well. I didn’t make any other changes to my system beyond applying the 9/10 snapshot. I’ll apply the latest snapshot tomorrow and see if it’s working for me on that one

Do they? I cannot find any details here in this thread - all logs are about “PlaySound” not being recognized (which is correct, due to the wrong spelling).

Fair point. Unless someone else is reporting the issue I won’t worry about it since I figured out a work around that takes it out of OpenHAB’s hands.

Thanks

1 Like

I could only get this to work by using playSound with a lower p and capital S…

So this contradicts what everyone is saying and also the documentation of the binding?

I’m sorry for my earlier false post (which war corrected by user regerrans), the documentation in here however states correctly that you Need “playSound” in a rule.

Then this also needs updating…
https://docs.openhab.org/addons/bindings/squeezebox/readme.html#how-to-set-up

Thanks for pointing to that.

There are quite a few issues with the Squeezebox documentation that I’d update but it’s not the easiest thing to do…