Sonos TTS driving me crazy, repeating itself over and over

I have Sonos Ones around the house that have replaced my google homes. They are great, and the Sonos component works great aside from one issue. Whenever one of my announcements get triggered, Sonos will repeat it over and over. This never happened with my google homes.

Ive tried doing troubleshooting and am completely out of ideas. At first, I thought it was because I have repeat all turned on for my Sonos. So I found this custom component to change the play mode. I then added a NR action to turn off repeat before triggering the annoucment . But this seems to only work sporadically, half the time repeat will be off and the annoucment will still repeat itself over and over until I hit pause on Sonos.

Anyone else epxeriance this or have any ideas? Its driving me CRAZY.

Screenshot of Node Red

1 Like

Iā€™m using this node https://flows.nodered.org/node/node-red-contrib-sonospollytts for all announcements from NR without any issue.

If you want to add more features like your radio or manage your playlist, than you can easily achieve it with this great node https://flows.nodered.org/node/node-red-contrib-sonos-plus

Both nodes are well maintained and work great

Or you could take a look at this solution, worked for me :wink:

You have to find out if your TTS routine is triggered several times or if the repeat is done within the TTS routine.

To avoid calling the TTS system repeatedly, you can use the RBE node which will ensure that no command will be send more than once in a row.

Its only called once. This never happens with Google homes, only with Sonos. The routine is exactly the same, only thing that changed was where it was sent.

Sorry, Iā€™m using the sonos node-red node (not HA) ā€¦ I never had any of the described isses

Would you be able to help me set up the node you linked? I read the insrtuctions and its over my head. New to NRā€¦

Iā€™ll share my setup and flow tonight (in about 8h) :sunglasses:

1 Like

For normal messages Iā€™m using the Sonos-Polly-TTS as this is using the internet only for new messages. I have repeated standard messages like (ā€œFrontdoor was opened!ā€) and these messages will work from a local TMP folder even when your external connection is down

  1. Create an AWS developer Account
  2. Download the node
  3. Drag a node on your flow
  4. Configure your AWS / Polly settings
    image
  5. Configure your Sonos-Device
  • SONOS IP: This is the IP (192.168.1.224) address of your Sonos Speaker. You will need a node for every speaker you want to use
  • Node-Red IP: as stated the IP adress of the machine running you Node-Red
  1. Now you can import the below sample flow
    image
[
    {
        "id": "7948293a.159a68",
        "type": "inject",
        "z": "2a7223f6.d28e0c",
        "name": "",
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 110,
        "y": 140,
        "wires": [
            [
                "140491c3.4c7e0e"
            ]
        ]
    },
    {
        "id": "140491c3.4c7e0e",
        "type": "function",
        "z": "2a7223f6.d28e0c",
        "name": "Sample function 1",
        "func": "// The simplest way\nmsg.payload=\"Benvenuti,Wilkommen,Wellcome!\";\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "x": 270,
        "y": 140,
        "wires": [
            [
                "b2f92147.9a31e"
            ]
        ]
    },
    {
        "id": "b2f92147.9a31e",
        "type": "sonospollytts",
        "z": "2a7223f6.d28e0c",
        "name": "",
        "voice": "18",
        "ssml": false,
        "dir": "/tmp",
        "sonosipaddress": "192.168.1.109 ",
        "sonosvolume": "25",
        "sonoshailing": "1",
        "noderedipaddress": "192.168.1.209",
        "noderedport": "1880",
        "config": "e9b4b321.0bcb5",
        "x": 490,
        "y": 100,
        "wires": [],
        "icon": "node-red/leveldb.png"
    },
    {
        "id": "21671071.2c082",
        "type": "inject",
        "z": "2a7223f6.d28e0c",
        "name": "",
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 110,
        "y": 180,
        "wires": [
            [
                "f1cff68e.5c6a8"
            ]
        ]
    },
    {
        "id": "f1cff68e.5c6a8",
        "type": "function",
        "z": "2a7223f6.d28e0c",
        "name": "Sample function 2",
        "func": "// Set the Volume\nmsg.volume=\"60\"; // If not set, will take the volume from setting page\nmsg.payload=\"Benvenuti,Wilkommen,Wellcome!\";\nreturn msg;\n\n",
        "outputs": 1,
        "noerr": 0,
        "x": 270,
        "y": 180,
        "wires": [
            [
                "b2f92147.9a31e"
            ]
        ]
    },
    {
        "id": "f42f5c8e.26a728",
        "type": "inject",
        "z": "2a7223f6.d28e0c",
        "name": "",
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 110,
        "y": 220,
        "wires": [
            [
                "d6cbb03.bf40c5"
            ]
        ]
    },
    {
        "id": "d6cbb03.bf40c5",
        "type": "function",
        "z": "2a7223f6.d28e0c",
        "name": "Sample function 3",
        "func": "// Create an array of messages\nvar aMessages=[];\n// Add random messages\naMessages.push({volume:\"50\",payload:\"Benvenuti.\"});\n// Wheater in Italy\naMessages.push({volume:\"40\",payload:\"http://media.ilmeteo.it/audio/2018-03-31.mp3\"});\n// Add random messages\naMessages.push({volume:\"30\",payload:\"Cambia la tua voce nei settaggi.\"});\nreturn [aMessages];\n",
        "outputs": 1,
        "noerr": 0,
        "x": 270,
        "y": 220,
        "wires": [
            [
                "b2f92147.9a31e"
            ]
        ]
    },
    {
        "id": "587710a4.938458",
        "type": "inject",
        "z": "2a7223f6.d28e0c",
        "name": "Hello World",
        "topic": "",
        "payload": "Ciao Mondo! Come stai?",
        "payloadType": "str",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 130,
        "y": 100,
        "wires": [
            [
                "b2f92147.9a31e"
            ]
        ]
    },
    {
        "id": "f0e4fb09.e0fd1",
        "type": "comment",
        "z": "2a7223f6.d28e0c",
        "name": "PUSH THE BUTTONS!",
        "info": "",
        "x": 120,
        "y": 60,
        "wires": []
    },
    {
        "id": "e9b4b321.0bcb5",
        "type": "sonospollytts-config",
        "z": "",
        "name": "bb"
    }
]

I hope this was helpfulā€¦ the most difficult part is getting the AWS credentials :wink: ā€¦ the rest should be a walk in the park :wink:

Thank you! Ill have to try this later today.

Edit: Nvm. Was using the wrong sonos IP. Got it working!

Thank you! Any way to get it not to do the annoying tone before the announcement?

Have a look in my sample above, I have as well disabled the hailing sound in the settings ā€¦ it was very annoying !!

Have you had any issues with it causing errors with Node Red? I had to revert to a previos backup because everytime I used the node, it would case a 502 Error after a few minutes, and I could no longer access the web ui of NR. Really strange.

No, I had no issue with this node

The developer is very responsive ā€¦ reach out to him via github ā€¦Iā€™m sure he will help

Alternatively you can try this Node ā€¦im using this as well to manage all my sonos devices ā€¦but not yet for TTSā€¦but it provides this feature as well

I have exactly the same issue! Works fine on a Google Home Mini, but any of the Sonos speakers loops the message forever.
Unfortunately Sonos-Polly-TTS excibits exactly the same behavior (I do remember Sonos-Polly-TTS working fine for me half a year ago, so thatā€™s strange).
And thanks for the tip about sonos-player-modes. Iā€™ve had some success introducing that into my ā€œsonos_sayā€ script (inspired by this post ), but still having issues that might just be due to mistakes Iā€™ve made with my script.