[ { "id": "2c76898a.ffc21e", "type": "tab", "label": "AUDIO PROMPTS", "disabled": false, "info": "" }, { "id": "5c6a227f.cfcb14", "type": "group", "z": "2c76898a.ffc21e", "name": "AUDIO FILES MANAGEMENT (BROWSER & UPLOAD)", "style": { "label": true }, "nodes": [ "c9f0160d.acaa18", "af84ab14.4486c", "dbb63a65.cc73a", "d68c7aee.2770e", "35ba17d1.a2f4f8", "d693bba2.71f6a8", "a8970f36.91d1c8", "a1306d1e.028cd8", "9e50ca55.4a75", "af2bd90b.537d8", "3bdee8bd.0022f8", "663b28f.81a7358", "2bbafdd7.202c82", "ac3aa96f.9e2ce", "6c0b4779.ea6178", "f7a1870d.bbd9e8", "cfe386f2.4e22f8", "506667da.f21e88", "236eb7ca.a8c2c", "c194a2a8.6ffd08", "c2bf1981.df15e", "91cf3832.de3c18", "b18d8693.96a4d", "7ced932b.d52094", "766187b9.22e74", "5016c913.ad4bf", "ccca8aa1.3ea4a8", "587eac72.7ce2a4", "dd5ee3aa.aaae78", "cbc0c09b.7c0038", "13a52c70.292124" ], "x": 49, "y": 664, "w": 1192, "h": 437 }, { "id": "6bc6d13.5dd9cb", "type": "group", "z": "2c76898a.ffc21e", "name": "EXTRA", "style": { "label": true }, "nodes": [ "bc2d76b3.dc452", "a7eb1219.e7e7b", "50ffb2ac.c3a594", "7708d11a.4c39f", "e1319804.4eb9", "f2fa4b4f.f4c23", "405dabbc.c7d574" ], "x": 49, "y": 439, "w": 462, "h": 202 }, { "id": "ad47fb2e.463308", "type": "group", "z": "2c76898a.ffc21e", "name": "PLAY SOMETHING - EVENT DRIVEN - PRE-RECORDED AUDIO", "style": { "label": true }, "nodes": [ "f55ae46d.e3fd6", "9cfac6a1.3b5d7", "301d5a53.42012e", "e600a124.fd4058", "8c9427a2.35d7c", "14fa9bea.3e43ac", "f6a690be.92a6c", "54c31036.14a8e", "e893ef6.b3b7b9" ], "x": 49, "y": 264, "w": 463, "h": 157 }, { "id": "c483feab.a7d8d", "type": "group", "z": "2c76898a.ffc21e", "name": "SAY SOMETHING - EVENT DRIVEN - TEXT-TO-SPEECH", "style": { "label": true }, "nodes": [ "1dbd7a67.6b4b0e", "3a3c5b3f.1ff624", "d30b6963.76e788", "78a5a361.c6a344", "6a33b1af.447e08" ], "x": 49, "y": 119, "w": 462, "h": 127 }, { "id": "e3b1b819.0747a", "type": "group", "z": "2c76898a.ffc21e", "name": "PLAY SOMETHING - TIME DRIVEN - PRE-RECORDED AUDIO", "style": { "label": true }, "nodes": [ "a5d262c7.bb4898", "1871ea17.4812a6", "d8a2945.d464768", "f89f4815.7f37f8", "b5c3f0bf.b9709", "981eaca4.e9eca" ], "x": 534, "y": 266.5, "w": 467, "h": 149.5 }, { "id": "ebc9d23a.84f0e8", "type": "group", "z": "2c76898a.ffc21e", "name": "SAY SOMETHING - TIME DRIVEN - TEXT-TO-SPEECH", "style": { "label": true }, "nodes": [ "9253a8b8.4c13b8", "66edf3ce.19a434", "acbf0c32.1eb0b8", "227c0b16.29a744", "8003350b.eb04d" ], "x": 534, "y": 119, "w": 467, "h": 127 }, { "id": "bc2d76b3.dc452", "type": "inject", "z": "2c76898a.ffc21e", "g": "6bc6d13.5dd9cb", "name": "init", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "5", "topic": "", "payload": "true", "payloadType": "bool", "x": 145, "y": 600, "wires": [ [ "a7eb1219.e7e7b" ] ] }, { "id": "a7eb1219.e7e7b", "type": "change", "z": "2c76898a.ffc21e", "g": "6bc6d13.5dd9cb", "name": "sonosmirror=true", "rules": [ { "t": "set", "p": "sonosmirror", "pt": "global", "to": "true", "tot": "bool" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 395, "y": 600, "wires": [ [] ] }, { "id": "50ffb2ac.c3a594", "type": "link in", "z": "2c76898a.ffc21e", "g": "6bc6d13.5dd9cb", "name": "DEBUG SONOS IN", "links": [ "b05b9913.1766d8", "45372c71.5b28ec", "1edf36a8.481cf1", "734d9229.1d57f4", "aa0b60df.859968", "96175099.778d7" ], "x": 90, "y": 520, "wires": [ [ "7708d11a.4c39f" ] ] }, { "id": "7708d11a.4c39f", "type": "function", "z": "2c76898a.ffc21e", "g": "6bc6d13.5dd9cb", "name": "Prepare", "func": "var newMsg = {};\nif(msg.error !== undefined){\n newMsg.payload = msg.error;\n} else {\n newMsg = msg\n}\nreturn newMsg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 275, "y": 520, "wires": [ [ "e1319804.4eb9" ] ] }, { "id": "e1319804.4eb9", "type": "debug", "z": "2c76898a.ffc21e", "g": "6bc6d13.5dd9cb", "name": "ACTIVATE DEBUG SONOS", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 450, "y": 520, "wires": [], "l": false }, { "id": "1dbd7a67.6b4b0e", "type": "function", "z": "2c76898a.ffc21e", "g": "c483feab.a7d8d", "name": "Say something", "func": "msg.payload = {\n text: \"This prompt will be spoken in the Living room\",\n siteId: \"living_room\",\n lang: \"en-UK\"\n};\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 235, "y": 160, "wires": [ [ "3a3c5b3f.1ff624", "d30b6963.76e788" ] ] }, { "id": "3a3c5b3f.1ff624", "type": "link out", "z": "2c76898a.ffc21e", "g": "c483feab.a7d8d", "name": "", "links": [ "2c3b6323.b96384", "b93dbd90.15e29" ], "x": 385, "y": 160, "wires": [] }, { "id": "d30b6963.76e788", "type": "debug", "z": "2c76898a.ffc21e", "g": "c483feab.a7d8d", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 300, "y": 205, "wires": [], "l": false }, { "id": "78a5a361.c6a344", "type": "inject", "z": "2c76898a.ffc21e", "g": "c483feab.a7d8d", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 110, "y": 160, "wires": [ [ "1dbd7a67.6b4b0e" ] ], "l": false }, { "id": "f2fa4b4f.f4c23", "type": "comment", "z": "2c76898a.ffc21e", "g": "6bc6d13.5dd9cb", "name": "ACTIVATE SONOS DEBUG MESSAGES", "info": "", "x": 245, "y": 480, "wires": [] }, { "id": "c9f0160d.acaa18", "type": "file", "z": "2c76898a.ffc21e", "g": "5c6a227f.cfcb14", "name": "", "filename": "", "appendNewline": true, "createDir": true, "overwriteFile": "true", "encoding": "none", "x": 340, "y": 1005, "wires": [ [ "587eac72.7ce2a4" ] ] }, { "id": "af84ab14.4486c", "type": "function", "z": "2c76898a.ffc21e", "g": "5c6a227f.cfcb14", "name": "", "func": "msg.filename = \"/home/pi/.node-red/audioprompts/\"+msg.file.name\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 245, "y": 1005, "wires": [ [ "c9f0160d.acaa18" ] ], "l": false }, { "id": "dbb63a65.cc73a", "type": "comment", "z": "2c76898a.ffc21e", "g": "5c6a227f.cfcb14", "name": "Audio file browser", "info": "Requires: \n * File lister node: node-red-contrib-fs\n * ui_upload: node-red-contrib-ui-upload\n\nBased on https://flows.nodered.org/flow/44bc7ad491aacb4253dd8a5f757b5407\nCredit: nygma2004 https://flows.nodered.org/user/nygma2004\n\nCredit: alkarex https://flows.nodered.org/user/alkarex\nhttps://flows.nodered.org/node/node-red-contrib-ui-upload", "x": 170, "y": 705, "wires": [] }, { "id": "d68c7aee.2770e", "type": "inject", "z": "2c76898a.ffc21e", "g": "5c6a227f.cfcb14", "name": "Init", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "3", "topic": "change", "payload": "/home/pi/.node-red/audioprompts", "payloadType": "str", "x": 155, "y": 755, "wires": [ [ "91cf3832.de3c18" ] ] }, { "id": "35ba17d1.a2f4f8", "type": "ui_button", "z": "2c76898a.ffc21e", "g": "5c6a227f.cfcb14", "name": "", "group": "e7dd4e27.6d1248", "order": 3, "width": "2", "height": "1", "passthru": false, "label": "Refresh", "tooltip": "", "color": "", "bgcolor": "", "icon": "refresh", "payload": "", "payloadType": "str", "topic": "refresh", "x": 145, "y": 795, "wires": [ [ "91cf3832.de3c18" ] ] }, { "id": "d693bba2.71f6a8", "type": "ui_dropdown", "z": "2c76898a.ffc21e", "g": "5c6a227f.cfcb14", "name": "File Selector", "label": "", "tooltip": "", "place": "Select a file", "group": "e7dd4e27.6d1248", "order": 4, "width": "5", "height": "1", "passthru": false, "multiple": false, "options": [ { "label": "", "value": "", "type": "str" } ], "payload": "", "topic": "", "x": 925, "y": 765, "wires": [ [ "b18d8693.96a4d" ] ] }, { "id": "a8970f36.91d1c8", "type": "function", "z": "2c76898a.ffc21e", "g": "5c6a227f.cfcb14", "name": "Format data", "func": "// format the data for the dropdown\nmsg.options = [];\nfor (var i=0; i
\n\n\n", "storeOutMessages": true, "fwdInMessages": true, "resendOnRefresh": false, "templateScope": "local", "x": 1115, "y": 825, "wires": [ [] ] }, { "id": "9e50ca55.4a75", "type": "template", "z": "2c76898a.ffc21e", "g": "5c6a227f.cfcb14", "name": "", "field": "payload", "fieldType": "msg", "format": "handlebars", "syntax": "mustache", "template": "\n \n {{#payload}}\n \n \n \n \n \n \n {{/payload}}\n
File NameSizeCreatedChanged
{{fname}}{{stat.size}}{{stat.created}}{{stat.changed}}
\n", "output": "str", "x": 955, "y": 825, "wires": [ [ "a1306d1e.028cd8" ] ] }, { "id": "af2bd90b.537d8", "type": "function", "z": "2c76898a.ffc21e", "g": "5c6a227f.cfcb14", "name": "Convert timestamps", "func": "for (var i=0; i