Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
node-red-contrib-sonospollytts
Advanced tools
Node-Red TTS with Sonos and Amazon Polly or with your own local mp3 announcement files. This node is specific for security alarm announcement, zone announcement, doorbell, weather annoucement etc.
Adjust the nodes according to your setup
[
{
"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"
}
]
This node transforms a text into a speech audio. It supports many voice languages. You can hear the voice through Sonos. This node uses Polly TTS and Sonos api.
and subscribe to my channel for the latest news, if you enjoy my node.
node.send({payload:"Hello there!"});
.Polly Config
Create a config with your AWS credentials. If you put incorrect credentials, you'll see this error in the node-red's debug window: "The security token included in the request is invalid."
Polly Voice
Select your preferred voice
Sonos IP
Insert your sonos's IP (If your Sonos device doesn't allow you to set a fixed IP, you need to reserve an IP using the DHCP Reservation function of your router/firewall's DHCP Server)
Sonos Volume
set the preferred TTS volume, from "0" to "100" (can be overridden by passing msg.volume="40";
to the node)
Sonos Hailing
before the first TTS message of the message queues, Sonos will play an "hailing" sound. You can select the hailing or totally disable it.
Node-Red IP
set IP of your node-red machine
Host Port
normally 1980. This is the IP of your machine, running node-red
TTS path
you can change the temp folder for storing cached TTS files. Default is "tmp". This is valid only if you select to purge the cache folder at each deploy or restart of node-red (see the next option below)
TTS Cache
Purge and delete the TTS cache folder at deploy or restart(default): on each deploy or node-red restart, delete all tts files in the cache. This is useful not to run out of disk space, in case you've a lot of TTS speech files.
Leave the TTS cache folder untouched (not suggested if you have less disk space): don't delete any tts file. Useful if you wish to keep the tts files, even in case of internet outages.
msg.volume
set the volume (values between "0" and "100" with quotes)msg.nohailing
temporarely doesn't play the Hailing sound prior to the message (values "true" or "1" with quotes)msg.payload
the text to be spoken (for example msg.payload = "Hello World!";). You can also play an mp3 stored on an http server, by passing the URL to the payload ( msg.payload = "http://www.myserver.com/alarm.mp3"
)Example of using http mp3 in a function node
node.send({payload:"http://192.125.22.44/intruderalarm.mp3"};
node.send({payload:"Warning. Intruder in the dinning room."};
msg.completed
true when the node has finished playing, false if the node is playingmsg.connectionerror
true when the node cannot connect to the Sonos device, false if the connection is restored.Adjust the nodes according to your setup
[
{
"id": "9389863f.c9e44",
"type": "sonospollytts",
"z": "2e6a2c30.383f64",
"name": "",
"purgediratrestart": "leave",
"voice": "51",
"ssml": false,
"dir": "/tmp",
"sonosipaddress": "192.168.1.109",
"sonosvolume": "20",
"sonoshailing": "0",
"noderedipaddress": "192.168.1.146",
"noderedport": "1980",
"config": "8194024b.fa7",
"x": 680,
"y": 340,
"wires": [
[]
]
},
{
"id": "90a05585.bc514",
"type": "ownfile",
"z": "2e6a2c30.383f64",
"name": "",
"selectedFile": "OwnFile_Living room window open.mp3",
"x": 350,
"y": 340,
"wires": [
[
"9389863f.c9e44"
]
]
},
{
"id": "d416ac1c.e5c8b",
"type": "inject",
"z": "2e6a2c30.383f64",
"name": "",
"topic": "",
"payload": "true",
"payloadType": "bool",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 150,
"y": 340,
"wires": [
[
"90a05585.bc514"
]
]
},
{
"id": "3b08c36d.aba304",
"type": "comment",
"z": "2e6a2c30.383f64",
"name": "You can upload your own voice messages and use it with SonosPollyTTS",
"info": "",
"x": 340,
"y": 300,
"wires": []
},
{
"id": "b6061743.7f9ce",
"type": "ownfile",
"z": "2e6a2c30.383f64",
"name": "",
"selectedFile": "OwnFile_Tur geoeffnet.mp3",
"x": 310,
"y": 400,
"wires": [
[
"9389863f.c9e44"
]
]
},
{
"id": "6cac28fd.4088a8",
"type": "inject",
"z": "2e6a2c30.383f64",
"name": "",
"topic": "",
"payload": "true",
"payloadType": "bool",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 150,
"y": 400,
"wires": [
[
"b6061743.7f9ce"
]
]
},
{
"id": "8194024b.fa7",
"type": "sonospollytts-config",
"z": "",
"name": "asd"
}
]
This node allow you to upload your custom message and play it via SonosPollyTTS without the need of an internet connection. You can use it, for example, with your alarm panel, to annuce a zone breach, a doorbell or so.
Name
Node name
File to be player
Select a file to be played. You can upload one or multiple files at the same time via the "upload" button.
msg.payload = true
Begin play of the message
msg.selectedFile = "Garage door open"
Overrides the selected message and plays the filename you passed in. Please double check the spelling of the filename (must be the same as you can see in the dropdown list of your own files, in the node config window) and do not include the .mp3 extenson.
FAQs
DEPRECATED. PLEASE INSTALL node-red-contrib-tts-ultimate INSTEAD.
The npm package node-red-contrib-sonospollytts receives a total of 0 weekly downloads. As such, node-red-contrib-sonospollytts popularity was classified as not popular.
We found that node-red-contrib-sonospollytts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.