Supergiovane / node-red-contrib-tts-ultimate

This node transforms a text into a speech audio. You can hear the voice natively through Sonos or external players.
MIT License
25 stars 5 forks source link

Inconsistent behavior with joined Sonos players #48

Closed gobigdave closed 2 years ago

gobigdave commented 2 years ago

Hello,

Thanks for the great node. I use it all the time, but I'm having issues with group announcements.

Describe the bug I have a function node that sets up the call.

// Set the main player IP and each IP belonging to the player's group var config= { setMainPlayerIP:"192.168.1.16", setPlayerGroupArray:[ "192.168.1.14", "192.168.1.15", "192.168.1.17", "192.168.1.18", "192.168.1.19", "192.168.1.21" ] }; msg.setConfig = config; return msg;

These are all the Sonos players in my house. This is input into TTS-Ultimate. The problem is that some players will often play music at the TTS volume (music that wasn't playing before), but the message and the hail do not play. The behavior is not consistent. Sometimes it will work everywhere. Other times, only 1 or 2 Sonos players play music instead of the message.

To Reproduce Steps to reproduce the behavior:

In my instance, I start my "Dinner" flow. This flow first announces it's dinner time, then it sets up lights and music.

Expected behavior I expect all the players will play the hail and message, and then go back to what they were doing.

Screenshots If applicable, add screenshots to help explain your problem.

TTS-Ultimate Version 1.0.36

Are you running node-red behind homematic, docker or anything similar? Node-red is running in docker.

Additional context I know when I did this directly with the home assistant nodes, I needed to:

  1. snapshot
  2. pause all players
  3. set volume for all players
  4. play message
  5. wait for state to be playing
  6. wait for state to NOT be playing
  7. restore

If I didn't pause all the players, I would get strange behavior with music and volume.

Supergiovane commented 2 years ago

Hi Dave Have you tried to create a TTS-Ultimate node and add all your players in the config window, instead of passing every IP via a message flow?

Supergiovane commented 2 years ago

Other than that.. Do you pass the payload to be spoken, directly with the msg.setConfig, or separately?

Try also that: Pass the msg.setConfig without the payload property. Then, after for example 5 seconds (you can use a delay node for that), send a msg.payload = "Hello, the dinner is on the table" or something like this.

I suspect that some of your players resume from sleep too late to be able to connect to node-red in time.

gobigdave commented 2 years ago

Hi Dave Have you tried to create a TTS-Ultimate node and add all your players in the config window, instead of passing every IP via a message flow?

I did when I was first setting the flow up, but I was having issues so I switched to the function node. TTS-Ultimate has updated since, so I can try that again.

gobigdave commented 2 years ago

Other than that.. Do you pass the payload to be spoken, directly with the msg.setConfig, or separately?

Try also that: Pass the msg.setConfig without the payload property. Then, after for example 5 seconds (you can use a delay node for that), send a msg.payload = "Hello, the dinner is on the table" or something like this.

I suspect that some of your players resume from sleep too late to be able to connect to node-red in time.

I have announce setup as a SubFlow, and the message is already in msg.payload when the function node sets up msg.setConfig. If I set config in one step, will that config be sticky in TTS-Ultimate? That wasn't clear.

Supergiovane commented 2 years ago

Yes. The .setConfig will retain the setup until a new .setConfig or until a node-red restart.