[SOLVED] Sonos say command with VoiceRSS

Hi,

For the first time, I’m trying to use notifications on my Sonos playbar in combination with VoiceRSS, the rule that I created for the test is:

rule "Notificatie doordeur lamp"

when
Item Group_color_down changed

then

say("Voordeur lamp is ingeschakeld")

end

I’m experiencing two things that I like to change:

  1. If we look at the log:
    2019-07-12 16:08:54.734 [vent.ItemStateChangedEvent] - Group_color_down changed from 0,0,100 to 22,89,41
    2019-07-12 16:08:54.751 [vent.ItemStateChangedEvent] - TRADFRIBulbE27CWSOpal600lm_Color changed from 0,0,0 to 22,89,41
    2019-07-12 16:08:55.037 [vent.ItemStateChangedEvent] - SonosPlaybarLivingRoom_MediaControl changed from PLAY to PAUSE
    2019-07-12 16:08:55.152 [vent.ItemStateChangedEvent] - SonosPlaybarLivingRoom_Volume changed from 10 to 30
    2019-07-12 16:08:55.313 [vent.ItemStateChangedEvent] - SonosPlaybarLivingRoom_MediaControl changed from PAUSE to UNDEF
    2019-07-12 16:08:55.550 [vent.ItemStateChangedEvent] - SonosPlaybarLivingRoom_MediaControl changed from UNDEF to PLAY
    2019-07-12 16:09:00.401 [vent.ItemStateChangedEvent] - SonosPlaybarLivingRoom_Volume changed from 30 to 10
    2019-07-12 16:09:00.606 [vent.ItemStateChangedEvent] - SonosPlaybarLivingRoom_MediaControl changed from PLAY to UNDEF
    2019-07-12 16:09:01.684 [vent.ItemStateChangedEvent] - SonosPlaybarLivingRoom_MediaControl changed from UNDEF to PLAY

You’ll see that the rule get’s triggered after that the lamp status changed. And the voice says “Voordeur lamp is ingeschakeld voo” so it is trying to say the line 2 times and cuts it of during the first word, is there a way to fix that?

  1. The other point is that I’m hearing an advertisement after every notification, how to get rid of that?

Thanks in advance.

The double message migth be caused by the used Group (the change event migth happen twice). On the advertising mesage, I can’t say where it is coming from, just tested it with my Play1 and VOICERSS, no such message.
However, you are using the same text string al the time, VOICERSS does store the resulting sound on your system and reuse it, try changing the message and by chance all the problems are gone.

I’ll try it on a single device, see how it behaves with that.
I discovered that the advertisement only plays when a notification is played during a radio stream on TuneIN on the Sonos.

But know I discovered another problem, the notification won’t play when the TV sounds is on the Sonos, it will cut the sound and it is silent for a moment, it also don’t restore the volume when the notification ends, any thoughts?

I tested it on a single device, you are right, then the text is only spoken 1 time, so that is solved.
About the advertisement, I tested a little bit more, but it only happens with the TuneIn internet radio, it is also a Dutch advertisement and a Dutch radio stations that I’m listening to (Qmusic), apparently they build something to get there add after your voice message. Not all dutch station do it.

But I’m still struggling with the TTS when the sound on the Sonos is set to TV, I still didn’t got it to work then…

Looks like I’m lucky, the radio stations we are using don’t play ads.
The playbar is a bit different, but I can’t say if such behaviour is normal or not.

Thanks for the quick reply, do you maybe have an example rule how your’s work? With the say command it mutes the music totally, I don’t know if there is a command that just put the music volume down and speak in a higher volume, after it’s done it resumes it original volume, that would be nice :slight_smile:

My rule just does react on the change of my “SayCommand” string item and uses the say command.
I do have the device selectable (different Sonos boxes), hence I’m specifying the VoiceService and the Audiosink (the Sonos box) in the command like:

say(SayCommand.state.toString,"voicerss:deDE",AudioSink)

Regarding the muting of the music, IMHO the binding stops/mutes the music, sets the notification volume, plays the notification (the text …), when the maximum time for the notification is over (I think 10 seconds) it resets the normal volume and resume the music.

Edit:
How do you start the music? I remember that when the radio station was called via Alexa, the say command did stop the music totally. That was because starting from Alexa is different (You can recognise that in the SonosApp). However that was resolved but I don’t remember in which version that was (I think the problem was noticeable in 2.4 stable, but not sure on that).

Ah thanks, I will play around with the rules to see if I can get it to work if the tv sound is on.
The radio station is normally started by IFTTT, but I also tried to start the radio with the Sonos app itself but this doesn’t change the behavior :wink:

OK, my concern was just about Alexa!

Oh… but no, I’m not using Alexa, and OH is running on the latest stable versions so it should be fixed then.
Just for fun I made a trigger switch with a say command, my girlfriend wasn’t aware yet that the system could speak so I configured the text “Goodmorning, did you sleep well?” (in Dutch), she was a bit in shock and surprised. Can’t wait to do the same if there are visitors and you go upstairs to grab something :slight_smile:
Thanks for your help!

:+1:
My TTS-Story:
My daughter visited our home with a friend while we were away. As a morning greeting I let the Sonos-Boxes say something like :“Good morning, how was the Party lasdt night?”
Here friend was a bit surprised and asked: What was that?"

" Just my STASI-father" :no_mouth: