SqueezeBox Speak on OH2

Hi,

I’ve just got Squeezebox set up and want to implement a rule that triggers some speak on my Amazon Dash Button being pressed (Sort of like a doorbell).

I can find topics about Google TTS providing a 503 error, but I’m not even getting that far and this is in my OpenHAB log

 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'Dash Button Pressed': An error occured during the script execution: The name 'squeezeboxSpeak(<XStringLiteralImpl>,<XStringLiteralImpl>)' cannot be resolved to an item or type.

Do I need to install an additional binding or action? I can’t find anything about squeezeboxSpeak in the docs

1 Like

The OH2 squeezebox binding doesn’t support notifications (yet). The PR for this functionality is awaiting review. See here.

If you’re interested in testing this new functionality, the jar files are located here.
https://github.com/mhilbush/squeezebox-test

and by the way… this PR works like a charm… i have been using it for a few days now and really enjoy the fact my house is now “speaking” to me :slight_smile:

Thanks Mark. I’ve got the addons installed and don’t see any errors in my log. I’m not hearing anything, but that is probably due to having SqueezeLite 1.7 installed. I’ll try finding a previous version and let you know how I get on, which should be well judging by @snoekieboe’s response

I had the same issues with Squeezelite 1.7. If you test with really long TTS sentences you should hear something. e.g. " Error while arming the alarm, please check for any open doors or windows" would playback just fine. " Alarm armed, goodbye" would do nothing.

Changing back to an older version of Squeezelite is on my todo list still :slight_smile:

That did the job.

Oddly, it also started playing music after it said my string. I wasn’t playing music before hand so I wonder if this is a bug?

Could be a bug. I’ll look into it.

Do you recall if the player was paused or powered off prior to the notification?

Were you streaming from a remote source (Pandora, Spotify, etc.) or from your local music library?

What was the player (squeezelite, squeezeplay, receiver, boom, etc.) and what was the version of LMS?

Yeah, I tracked down the issue in squeezelite. When streaming short content that can be read in a single read request, the streaming thread never gets into the state necessary to start the decoder. I’m hoping Ralphy can come up with a fix. I built a version that works on Ubuntu running on Intel, but I haven’t gotten around to building a version for the piCorePlayer.

Player was paused and is reproducable

Local music library

Squeezelite 1.7 on a Pi3 and LMS is 7.7.5 - 1416570306

Hope this helps

Thanks, that’s helpful. I’ll build a 1.7 version to see if I can reproduce.

Sorry, I told a lie, it’s as follows:

Player Model: SqueezeLite
Firmware: v1.8.5-823

Ah, even better. That’s the version I’m running on my pCP.

I reworked the logic that restores the player state after the notification finishes. There’s a new version here if you want to test it.

Thanks Mark, I’ll give it a go this evening

Hey @Rob_Pope, did you get a chance to see if this fixed the issue?

Hi Mark. Sorry, I’ve been out for the past couple of evenings. I just copied the latest jar over and restarted OpenHAB, but it still resumes playback after TTS if the audio was paused. If the squeezelite player is powered off it does not resume music playback afterwards.

I’m having some issues with my amp cutting out during audio playback at the moment, which isn’t helping testing, but I can see the playlist on the web to see what’s happening and hear the occaisional utterance.

Ugh. Can you put the squeezebox binding in debug mode, then capture the openhab.log entries when the TTS plays? I’d like to see the state of the player before the TTS plays, as well as what happens when the player state is restored.

I’m not able to recreate this with my squeezelite 1.8.5 due to the squeezelite issue I described above. Not sure why your version is working.

Sorry, n00b question, how can I put the binding in debug mode?

I’ve just tidied up some old links though Karaf that were making my log look messy, so I’ll do some more testing this evening.

Rob

Ah, sorry.

Launch the Karaf console as described here.
http://docs.openhab.org/administration/console.html

Then at the command prompt, enter this.

log:set DEBUG org.openhab.binding.squeezebox

You can turn off debug mode by entering this.

log:set INFO org.openhab.binding.squeezebox
1 Like

Hi Mark.

I can confirm this happens - that the music resumes after TTS when the player is paused. This happens with both Squeezeplay and Squeezelite players.

log:

2017-01-26 12:55:53.325 [DEBUG] [eezebox.internal.SqueezeBoxAudioSink] - Squeezebox audiosink processing audioStream /audio/c8a3cac5-0fe7-4b9c-ab47-d286566ef124 of format AudioFormat [codec=MP3, container=NONE, ]
2017-01-26 12:55:53.326 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Play notification sound on player 20:cf:30:53:a1:cd at URI /audio/c8a3cac5-0fe7-4b9c-ab47-d286566ef124.mp3
2017-01-26 12:55:53.329 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Cur State: vol=90, mut=NOT MUTED, pwr=ON, stp=NOT STOPPED, ctl=PAUSED, shf=OFF, rpt=OFF, tix=0, tnm=38, tim=126
2017-01-26 12:55:53.331 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Setting up player for notification
2017-01-26 12:55:53.331 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 20:cf:30:53:a1:cd pause 1
2017-01-26 12:55:53.333 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 20:cf:30:53:a1:cd mixer volume 90
2017-01-26 12:55:53.334 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Playing notification
2017-01-26 12:55:53.335 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 20:cf:30:53:a1:cd playlist add http://192.xxx.xxx.xxx:8080/audio/c8a3cac5-0fe7-4b9c-ab47-d286566ef124.mp3
2017-01-26 12:55:53.336 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Waiting for playlist to be updated...
2017-01-26 12:55:53.738 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting for playlist to be updated
2017-01-26 12:55:53.740 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 20:cf:30:53:a1:cd playlist index 38
2017-01-26 12:55:53.743 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Waiting for notification message to finish...
2017-01-26 12:55:57.451 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting for notification to finish
2017-01-26 12:55:57.453 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 20:cf:30:53:a1:cd playlist delete 38
2017-01-26 12:55:57.455 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Waiting for playlist to be updated...
2017-01-26 12:55:59.160 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting for playlist to be updated
2017-01-26 12:55:59.162 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Restoring player state
2017-01-26 12:55:59.164 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 20:cf:30:53:a1:cd mixer volume 90
2017-01-26 12:55:59.167 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Resuming last item playing
2017-01-26 12:55:59.168 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 20:cf:30:53:a1:cd playlist index 0
2017-01-26 12:55:59.171 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 20:cf:30:53:a1:cd time 126
2017-01-26 12:55:59.173 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Pausing the player
2017-01-26 12:55:59.174 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: 20:cf:30:53:a1:cd pause 1

I compiled the latest version of squeezelite with your workaround for the Raspberry Pi and it seems to be working ok in my piCorePlayers.
https://github.com/airix1/squeezelite/releases/download/v1.8.6-830/squeezelite-armv6hf-ffmpeg
https://github.com/airix1/squeezelite/releases/download/v1.8.6-830/squeezelite-armv6hf-noffmpeg

For some reason the TTS is timing out this evening for me. The logs are below (and I believe quite similar to @g_g_rich’s)

2017-01-26 21:31:43.289 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: b8:27:eb:35:02:cc pause 1
2017-01-26 21:31:56.450 [DEBUG] [eezebox.internal.SqueezeBoxAudioSink] - Squeezebox audiosink processing audioStream /audio/a66430ee-1154-4cee-b71e-f6bcfd2e3bb5 of format AudioFormat [codec=MP3, container=NONE, ]
2017-01-26 21:31:56.452 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Play notification sound on player b8:27:eb:35:02:cc at URI /audio/a66430ee-1154-4cee-b71e-f6bcfd2e3bb5.mp3
2017-01-26 21:31:56.467 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Cur State: vol=40, mut=NOT MUTED, pwr=ON, stp=NOT STOPPED, ctl=PAUSED, shf=OFF, rpt=OFF, tix=10, tnm=21, tim=142
2017-01-26 21:31:56.469 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Setting up player for notification
2017-01-26 21:31:56.471 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: b8:27:eb:35:02:cc pause 1
2017-01-26 21:31:56.472 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Initializing notification volume to current player volume
2017-01-26 21:31:56.475 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: b8:27:eb:35:02:cc mixer volume 40
2017-01-26 21:31:56.477 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Playing notification
2017-01-26 21:31:56.478 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: b8:27:eb:35:02:cc playlist add http://192.168.5.3:8081/audio/a66430ee-1154-4cee-b71e-f6bcfd2e3bb5.mp3
2017-01-26 21:31:56.484 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Waiting for playlist to be updated...
2017-01-26 21:31:56.886 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting for playlist to be updated
2017-01-26 21:31:56.888 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: b8:27:eb:35:02:cc playlist index 21
2017-01-26 21:31:56.890 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Waiting for notification message to finish...
2017-01-26 21:32:26.921 [WARN ] [ebox.handler.SqueezeBoxPlayerHandler] - Timed out waiting for notification to complete!
2017-01-26 21:32:26.923 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: b8:27:eb:35:02:cc playlist delete 21
2017-01-26 21:32:26.925 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Waiting for playlist to be updated...
2017-01-26 21:32:27.327 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Done waiting for playlist to be updated
2017-01-26 21:32:27.328 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Restoring player state
2017-01-26 21:32:27.330 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: b8:27:eb:35:02:cc mixer volume 40
2017-01-26 21:32:27.332 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Resuming last item playing
2017-01-26 21:32:27.333 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: b8:27:eb:35:02:cc playlist index 10
2017-01-26 21:32:27.335 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: b8:27:eb:35:02:cc time 142
2017-01-26 21:32:27.337 [DEBUG] [ebox.handler.SqueezeBoxPlayerHandler] - Pausing the player
2017-01-26 21:32:27.338 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: b8:27:eb:35:02:cc pause 1
2017-01-26 21:32:40.577 [DEBUG] [ebox.handler.SqueezeBoxServerHandler] - Sending command: players 0

Thanks for the updated library too Rich, I’ll give it a go at the weekend.