Sonos speaker not playing file generated by VoiceRSS

A few months ago I’ve bought several Sonos speakers which are placed in several rooms in our house. I’m able to control the speakers and start the speakers playing radiostreams using OpenHAB.

I’d like to let openHAB make announcements using the say()-command but I can’t get this working.

After a lot of testing and reading topic’s on the community, I decided to ask you guys for help. To be honest I’m not sure where to start and what information I need to provide.

Let me start with my configuration: I’m running openHAB 4.2.3. It’s running in a Docker container which is running on my Synology NAS.

I will post the configuration of one speaker I’m testing with:

Thing:

Thing sonos:Era100:Attic [udn="RINCON_<XXXXXXXXXXXXXXXXX>", refresh=60, notificationVolume=50]

.
In the configuration of the binding I set the ‘callback URL’ to 192.168.1.5:48080 which is the same as I access the UserInterface of openHAB. (via http://192.168.1.5:48080/static/ I’m able to access files and HTML-pages which are placed in the html-folder of openHAB)
.

Items:

Player SonosAttic_Controller "Controller" (Sonos) {channel="sonos:Era100:Attic:control"}
Dimmer SonosAttic_Volume "Volume [%.1f %%]" <soundvolume> (Sonos) {channel="sonos:Era100:Attic:volume"}
Switch SonosAttic_Mute "Mute [%s]" (Sonos) {channel="sonos:Era100:Attic:mute"}
String SonosAttic_ZoneName "Zone Name[%s]" <text> (Sonos) {channel="sonos:Era100:Attic:zonename"}
String SonosAttic_ZoneGroupId "Zone Group ID [%s]" <text> (Sonos) {channel="sonos:Era100:Attic:zonegroupid"}
String SonosAttic_State "Status [%s]" <text> (Sonos) {channel="sonos:Era100:Attic:state"}
String SonosAttic_PlayUri "PlayUri [%s]" <text> (Sonos) {channel="sonos:Era100:Attic:playuri"}
String SonosAttic_CurrentTrackUri "CurrentTrackUri[%s]" <text> (Sonos) {channel="sonos:Era100:Attic:currenttrackuri"}
String SonosAttic_Add "Add [%s]" {channel="sonos:Era100:Attic:add"}
String SonosAttic_Remove "Remove [%s]" {channel="sonos:Era100:Attic:remove"}
String SonosAttic_Notification "Keuken Notificatie" {channel="sonos:Era100:Attic:notificationsound"}

.
When I start a radio-stream, I’m running this from a rule:

SonosAttic_PlayUri.sendCommand("x-rincon-mp3radio://http://icecast.omroep.nl/radio2-bb-mp3")

.
When I try to let the Sonos speaker say something I’m running this commend from out of a rule:

say("this is a sonos test","voicerss:nlNL","sonos:Era100:Attic")

If the speaker is running the radio-stream and I start the rule that contains the ‘say-command’ I see the following in the logging:

2025-01-02 19:18:03.231 [DEBUG] [voicerss.internal.VoiceRSSTTSService] - Synthesize 'this is a sonos test' for voice 'voicerss:nlNL' in format AudioFormat [codec=PCM_SIGNED, container=WAVE, bigEndian=false, bitDepth=16, bitRate=256000, frequency=16000, channels=1]
2025-01-02 19:18:03.301 [DEBUG] [voicerss.internal.VoiceRSSTTSService] - Use common TTS cache mechanism
2025-01-02 19:18:03.304 [DEBUG] [voicerss.internal.VoiceRSSTTSService] - synthesizeForCache 'this is a sonos test' for voice 'voicerss:nlNL' in format AudioFormat [codec=PCM_SIGNED, container=WAVE, bigEndian=false, bitDepth=16, bitRate=256000, frequency=16000, channels=1]
2025-01-02 19:18:03.305 [DEBUG] [.internal.cloudapi.VoiceRSSCloudImpl] - Call https://api.voicerss.org/?key=***&hl=nl-NL&c=WAV&f=16khz_16bit_mono&src=this+is+a+sonos+test

At the same time the speaker;

  • Stops playing for a second
  • Continues playing the stream on the notificationVolume that is set in the Things-file
  • After exactly 20 seconds (which is the maximum time of a notification as I read in the documentation) the radio-stream start playing on the initial volume.

I’m not 100% sure, but I expect that the speaker cannot access the WAV-file that should be generated by VoiceRSS.

I would like to ‘debug’ by trying to access the file from another device on the network, but I don’t know where it is stored in the openHAB/Docker-container.

I would like to ask you guys if you think that I’m on the right track if you read the above. I would also ask if anybody knows where the generated Wave-file is stored by VoiceRSS?

Thanks in advance for your help.

VoiceRSS + Sonos is what I am using and it is working.

Can you check that TTS cache is enabled in your OH server settings (audio) ?

I guess you mean org.openhab.voice:enableCacheTTS=true in runtime.cfg? It was turned off, but turning it on didn’t make any difference unfortunately.

@Lolodomo, are you also running OH from a docker container?

No, from RPI.