Just updating the flow so it handles messages via MQTT correctly, including setting the desired volume level. If you send a message via MQTT, send a payload with the following format: "The message to be spoken"|15 where 15 is the volume level
[
{
"id": "e43cfa8e3a673ea2",
"type": "inject",
"z": "bf1b20db733dbc1c",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "Water leakage dishwashing machine|3",
"payloadType": "str",
"x": 120,
"y": 140,
"wires": [
[
"0e9b67e3c9651ffa"
]
]
},
{
"id": "0e9b67e3c9651ffa",
"type": "mqtt out",
"z": "bf1b20db733dbc1c",
"name": "",
"topic": "TTS",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "d25677b9.097f68",
"x": 250,
"y": 140,
"wires": []
},
{
"id": "3e0d9b5c.fe01b4",
"type": "inject",
"z": "bf1b20db733dbc1c",
"name": "This works perfect for me",
"props": [
{
"p": "payload"
},
{
"p": "volume",
"v": "20",
"vt": "num"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "This works perfect for me",
"payloadType": "str",
"x": 180,
"y": 270,
"wires": [
[
"3d9635bc.53c14a"
]
]
},
{
"id": "17d1372ec4e2fa56",
"type": "switch",
"z": "bf1b20db733dbc1c",
"name": "",
"property": "filesArray",
"propertyType": "msg",
"rules": [
{
"t": "nnull"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 630,
"y": 320,
"wires": [
[
"b6292f5b6fb85a0f"
]
]
},
{
"id": "b6292f5b6fb85a0f",
"type": "function",
"z": "bf1b20db733dbc1c",
"name": "function 6",
"func": "let af = msg.filesArray[0].file;\nlet vol = parseInt(msg.passThroughMessage.volume, 10);\nmsg.payload = '-volume '+vol+' '+af;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 790,
"y": 320,
"wires": [
[
"9b644a0b5cb0fbc9"
]
]
},
{
"id": "9b644a0b5cb0fbc9",
"type": "exec",
"z": "bf1b20db733dbc1c",
"command": "ffplay -nodisp -autoexit",
"addpay": "payload",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "",
"x": 1020,
"y": 320,
"wires": [
[],
[],
[]
]
},
{
"id": "172b415bc9693c77",
"type": "mqtt in",
"z": "bf1b20db733dbc1c",
"name": "",
"topic": "TTS",
"qos": "2",
"datatype": "auto-detect",
"broker": "d25677b9.097f68",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 250,
"y": 210,
"wires": [
[
"6163d16aeae6a338"
]
]
},
{
"id": "5e7ad828a226b98f",
"type": "inject",
"z": "bf1b20db733dbc1c",
"name": "Shouting out loud",
"props": [
{
"p": "payload"
},
{
"p": "volume",
"v": "100",
"vt": "num"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "Shouting out loud",
"payloadType": "str",
"x": 160,
"y": 320,
"wires": [
[
"3d9635bc.53c14a"
]
]
},
{
"id": "2b5336427268b9e9",
"type": "inject",
"z": "bf1b20db733dbc1c",
"name": "Whispering something",
"props": [
{
"p": "payload"
},
{
"p": "volume",
"v": "5",
"vt": "num"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "Whispering something",
"payloadType": "str",
"x": 170,
"y": 370,
"wires": [
[
"3d9635bc.53c14a"
]
]
},
{
"id": "3d9635bc.53c14a",
"type": "ttsultimate",
"z": "bf1b20db733dbc1c",
"name": "",
"voice": "en-AU",
"ssml": false,
"sonosipaddress": "192.168.1.109",
"sonosvolume": "30",
"sonoshailing": "0",
"config": "557d8082.eb5a8",
"property": "payload",
"propertyType": {},
"rules": [],
"playertype": "noplayer",
"speakingrate": "",
"speakingpitch": "",
"unmuteIfMuted": false,
"elevenlabsStability": "",
"elevenlabsSimilarity_boost": "",
"x": 450,
"y": 320,
"wires": [
[
"17d1372ec4e2fa56"
],
[]
]
},
{
"id": "6163d16aeae6a338",
"type": "change",
"z": "bf1b20db733dbc1c",
"name": "",
"rules": [
{
"t": "set",
"p": "volume",
"pt": "msg",
"to": "$split(payload, '|')[1]\t",
"tot": "jsonata"
},
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$split(payload, '|')[0]",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 450,
"y": 210,
"wires": [
[
"3d9635bc.53c14a"
]
]
},
{
"id": "d25677b9.097f68",
"type": "mqtt-broker",
"name": "",
"broker": "127.0.0.1",
"port": "1883",
"clientid": "",
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"sessionExpiry": ""
},
{
"id": "557d8082.eb5a8",
"type": "ttsultimate-config",
"name": "googletranslate",
"noderedipaddress": "127.0.0.1",
"noderedport": "1980",
"purgediratrestart": "leave",
"ttsservice": "googletranslate",
"TTSRootFolderPath": ""
}
]