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
24 stars 5 forks source link

[question] Overwrite Main-Sonos-Player via Input Parameter #28

Closed xX-Nexus-Xx closed 3 years ago

xX-Nexus-Xx commented 3 years ago

Hi, Is it possible to overwrite the target sonos (Main-Sonos-Player) with and overwrited via input (like you do it with msg.volume)

Example: msg.player = "Bedroom" or msg.player ="Group: House"

thanks for considering

Supergiovane commented 3 years ago

Hi Nexus I’ll take a look. Currently, you can use 1 node each room and use the nodered link-in and link-out nodes to point to each one.

Supergiovane commented 3 years ago

Hi Nexus Have you seen the readme? Please scroll down to the readme page. I think this is what you need:

setMainPlayerIP Sets the main player IP. This will also be the coordinator if you have a group of players

setPlayerGroupArray Sets the array of players beloging to the group, if any. If you have only one additional player, you need to ever put it into an array. See below.

// Set player IP var config= { setMainPlayerIP:"192.168.1.109" }; msg.setConfig = config; return msg; // Set player IP and additional players var config= { setMainPlayerIP:"192.168.1.109", setPlayerGroupArray:[ "192.168.1.110", "192.168.1.111", "192.168.1.112" ] }; msg.setConfig = config; return msg; // If you have only one additional player var config= { setMainPlayerIP:"192.168.1.109", setPlayerGroupArray:["192.168.1.110"] }; msg.setConfig = config; return msg;

xX-Nexus-Xx commented 3 years ago

Yes, I was playing with that option .. but somehow I'm unable to get it working :(

current scenario

any suggestions? ... Ideally I would like to use the PlayerName (e.g.Bedroom) and not the IP ..but I can work with that ;)

Supergiovane commented 3 years ago

Hi you need to pass an object, you cannot simply pass a msg.setMainPlayerIP command. Please see the README and copy exactly what you see, by adapting the IP addresses to your configuration.

Supergiovane_node-red-contrib-tts-ultimate