Using Node-Red for Google Home TTS announcements and other stuff eWeLink

Ok all i need now is output debugs from castv2 node, then hopfully i can sort a volume reset after node finishes tts.

How it looks now:

This is everything from the CastV2 “Lounge Mini” node when turning on the Fireplace, (MIOS IN Node).

08/12/2020, 12:16:01node: fe70ae7a.b52e4
msg.payload : undefined
undefined
08/12/2020, 12:16:03node: fe70ae7a.b52e4
msg.payload : undefined
undefined
08/12/2020, 12:16:03node: fe70ae7a.b52e4
msg.payload : null
null
08/12/2020, 12:16:03node: fe70ae7a.b52e4
msg.payload : Object
object
mediaSessionId: 1
playbackRate: 1
playerState: "IDLE"
currentTime: 0
supportedMediaCommands: 274447
volume: object
level: 1
muted: false
activeTrackIds: array[0]
media: object
contentId: "https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Turning%20On%20Fireplace"
contentType: "audio/mp3"
streamType: "BUFFERED"
metadata: object
metadataType: 0
title: "tts"
images: array[1]
0: object
url: "https://nodered.org/node-red-icon.png"
mediaCategory: "AUDIO"
currentItemId: 1
extendedStatus: object
playerState: "LOADING"
media: object
contentId: "https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Turning%20On%20Fireplace"
contentType: "audio/mp3"
streamType: "BUFFERED"
metadata: object
metadataType: 0
title: "tts"
images: array[1]
0: object
url: "https://nodered.org/node-red-icon.png"
mediaCategory: "AUDIO"
mediaSessionId: 1
repeatMode: "REPEAT_OFF"
08/12/2020, 12:16:03node: fe70ae7a.b52e4
msg.payload : undefined
undefined
08/12/2020, 12:16:04node: fe70ae7a.b52e4
msg.payload : Object
object
mediaSessionId: 1
playbackRate: 1
playerState: "PLAYING"
currentTime: 0
supportedMediaCommands: 274447
volume: object
level: 1
muted: false
activeTrackIds: array[0]
media: object
contentId: "https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Turning%20On%20Fireplace"
contentType: "audio/mp3"
streamType: "BUFFERED"
metadata: object
metadataType: 0
title: "tts"
images: array[1]
0: object
url: "https://nodered.org/node-red-icon.png"
mediaCategory: "AUDIO"
duration: 1.896
tracks: array[1]
0: object
trackId: 1
type: "AUDIO"
breakClips: array[0]
breaks: array[0]
currentItemId: 1
items: array[1]
0: object
itemId: 1
media: object
contentId: "https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Turning%20On%20Fireplace"
contentType: "audio/mp3"
streamType: "BUFFERED"
metadata: object
metadataType: 0
title: "tts"
images: array[1]
0: object
mediaCategory: "AUDIO"
duration: 1.896
autoplay: true
activeTrackIds: array[0]
orderId: 0
repeatMode: "REPEAT_OFF"
08/12/2020, 12:16:05node: fe70ae7a.b52e4
msg.payload : Object
object
mediaSessionId: 1
playbackRate: 1
playerState: "PLAYING"
currentTime: 1.176685
supportedMediaCommands: 274447
volume: object
level: 1
muted: false
activeTrackIds: array[0]
currentItemId: 1
repeatMode: "REPEAT_OFF"
08/12/2020, 12:16:06node: fe70ae7a.b52e4
msg.payload : undefined
undefined
08/12/2020, 12:16:06node: fe70ae7a.b52e4
msg.payload : Object
object
mediaSessionId: 1
playbackRate: 1
playerState: "IDLE"
currentTime: 0
supportedMediaCommands: 274447
volume: object
level: 1
muted: false
currentItemId: 1
idleReason: "FINISHED"

This is everything when sending in a HTTP command

08/12/2020, 12:19:07node: fe70ae7a.b52e4
msg.payload : undefined
undefined
08/12/2020, 12:19:08node: fe70ae7a.b52e4
msg.payload : undefined
undefined
08/12/2020, 12:19:09node: fe70ae7a.b52e4
msg.payload : null
null
08/12/2020, 12:19:09node: fe70ae7a.b52e4
msg.payload : Object
object
mediaSessionId: 1
playbackRate: 1
playerState: "IDLE"
currentTime: 0
supportedMediaCommands: 274447
volume: object
level: 1
muted: false
activeTrackIds: array[0]
media: object
contentId: "https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Turning%20on%20the%20fireplace"
contentType: "audio/mp3"
streamType: "BUFFERED"
metadata: object
metadataType: 0
title: "tts"
images: array[1]
0: object
url: "https://nodered.org/node-red-icon.png"
mediaCategory: "AUDIO"
currentItemId: 1
extendedStatus: object
playerState: "LOADING"
media: object
contentId: "https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Turning%20on%20the%20fireplace"
contentType: "audio/mp3"
streamType: "BUFFERED"
metadata: object
metadataType: 0
title: "tts"
images: array[1]
0: object
url: "https://nodered.org/node-red-icon.png"
mediaCategory: "AUDIO"
mediaSessionId: 1
repeatMode: "REPEAT_OFF"
08/12/2020, 12:19:09node: fe70ae7a.b52e4
msg.payload : undefined
undefined
08/12/2020, 12:19:09node: fe70ae7a.b52e4
msg.payload : Object
object
mediaSessionId: 1
playbackRate: 1
playerState: "PLAYING"
currentTime: 0
supportedMediaCommands: 274447
volume: object
level: 1
muted: false
activeTrackIds: array[0]
media: object
contentId: "https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Turning%20on%20the%20fireplace"
contentType: "audio/mp3"
streamType: "BUFFERED"
metadata: object
metadataType: 0
title: "tts"
images: array[1]
0: object
url: "https://nodered.org/node-red-icon.png"
mediaCategory: "AUDIO"
duration: 1.944
tracks: array[1]
0: object
trackId: 1
type: "AUDIO"
breakClips: array[0]
breaks: array[0]
currentItemId: 1
items: array[1]
0: object
itemId: 1
media: object
contentId: "https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Turning%20on%20the%20fireplace"
contentType: "audio/mp3"
streamType: "BUFFERED"
metadata: object
metadataType: 0
title: "tts"
images: array[1]
0: object
url: "https://nodered.org/node-red-icon.png"
mediaCategory: "AUDIO"
duration: 1.944
autoplay: true
activeTrackIds: array[0]
orderId: 0
repeatMode: "REPEAT_OFF"
08/12/2020, 12:19:10node: fe70ae7a.b52e4
msg.payload : Object
object
mediaSessionId: 1
playbackRate: 1
playerState: "PLAYING"
currentTime: 1.068927
supportedMediaCommands: 274447
volume: object
level: 1
muted: false
activeTrackIds: array[0]
currentItemId: 1
repeatMode: "REPEAT_OFF"
08/12/2020, 12:19:11node: fe70ae7a.b52e4
msg.payload : undefined
undefined
08/12/2020, 12:19:11node: fe70ae7a.b52e4
msg.payload : Object
object
mediaSessionId: 1
playbackRate: 1
playerState: "IDLE"
currentTime: 0
supportedMediaCommands: 274447
volume: object
level: 1
muted: false
currentItemId: 1
idleReason: "FINISHED"

Can you run again with this function and repost debug?

[{"id":"a5e81c85.6cb888","type":"function","z":"66b3988b.4a2ea8","name":"","func":"var IPS = msg.payload.ip.split(\"|\");\nvar message = msg.payload.message;\nvar ttsVolume = msg.payload.volume || 35;\nfor (var i in IPS) { \n    //msg.ttsVolume = true;\n    msg.payload = {\"type\":\"VOLUME\",\"volume\":msg.payload.volume,\"ip\":IPS[i]};\n    node.send([null,msg]);\nmsg.payload = {\n    type: \"TTS\",\n    text: message,\n    language: \"En-gb\",\n    ip: IPS[i],\n    metadata:{ip:IPS[i]}\n    }\nmsg.iptts = IPS[i];\nnode.send([null, [msg]]);\n}\nif(!msg.sensor){\nmsg.payload = \"ok\"; // the response message\nreturn [msg];\n}else{\n return;\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","x":200,"y":160,"wires":[["ac7159a9.0806d8"],["67b423dd.7a9a1c"]]}]

MIOS IN Node - turning fireplace ON:

08/12/2020, 12:44:11node: fe70ae7a.b52e4
msg.payload : undefined
undefined
08/12/2020, 12:44:12node: fe70ae7a.b52e4
msg.payload : undefined
undefined
08/12/2020, 12:44:12node: fe70ae7a.b52e4
msg.payload : null
null
08/12/2020, 12:44:12node: fe70ae7a.b52e4
msg.payload : Object
object
mediaSessionId: 1
playbackRate: 1
playerState: "IDLE"
currentTime: 0
supportedMediaCommands: 274447
volume: object
level: 1
muted: false
activeTrackIds: array[0]
media: object
contentId: "https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Turning%20On%20Fireplace"
contentType: "audio/mp3"
streamType: "BUFFERED"
metadata: object
metadataType: 0
title: "tts"
images: array[1]
0: object
ip: "192.168.0.16"
mediaCategory: "AUDIO"
currentItemId: 1
extendedStatus: object
playerState: "LOADING"
media: object
contentId: "https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Turning%20On%20Fireplace"
contentType: "audio/mp3"
streamType: "BUFFERED"
metadata: object
metadataType: 0
title: "tts"
images: array[1]
0: object
url: "https://nodered.org/node-red-icon.png"
ip: "192.168.0.16"
mediaCategory: "AUDIO"
mediaSessionId: 1
repeatMode: "REPEAT_OFF"
08/12/2020, 12:44:12node: fe70ae7a.b52e4
msg.payload : undefined
undefined
08/12/2020, 12:44:13node: fe70ae7a.b52e4
msg.payload : Object
object
mediaSessionId: 1
playbackRate: 1
playerState: "PLAYING"
currentTime: 0
supportedMediaCommands: 274447
volume: object
level: 1
muted: false
activeTrackIds: array[0]
media: object
contentId: "https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Turning%20On%20Fireplace"
contentType: "audio/mp3"
streamType: "BUFFERED"
metadata: object
metadataType: 0
title: "tts"
images: array[1]
0: object
url: "https://nodered.org/node-red-icon.png"
ip: "192.168.0.16"
mediaCategory: "AUDIO"
duration: 1.896
tracks: array[1]
0: object
trackId: 1
type: "AUDIO"
breakClips: array[0]
breaks: array[0]
currentItemId: 1
items: array[1]
0: object
itemId: 1
media: object
contentId: "https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Turning%20On%20Fireplace"
contentType: "audio/mp3"
streamType: "BUFFERED"
metadata: object
metadataType: 0
title: "tts"
images: array[1]
0: object
url: "https://nodered.org/node-red-icon.png"
ip: "192.168.0.16"
mediaCategory: "AUDIO"
duration: 1.896
autoplay: true
activeTrackIds: array[0]
orderId: 0
repeatMode: "REPEAT_OFF"
08/12/2020, 12:44:14node: fe70ae7a.b52e4
msg.payload : Object
object
mediaSessionId: 1
playbackRate: 1
playerState: "PLAYING"
currentTime: 1.130179
supportedMediaCommands: 274447
volume: object
level: 1
muted: false
activeTrackIds: array[0]
currentItemId: 1
repeatMode: "REPEAT_OFF"
08/12/2020, 12:44:15node: fe70ae7a.b52e4
msg.payload : undefined
undefined
08/12/2020, 12:44:15node: fe70ae7a.b52e4
msg.payload : Object
object
mediaSessionId: 1
playbackRate: 1
playerState: "IDLE"
currentTime: 0
supportedMediaCommands: 274447
volume: object
level: 1
muted: false
currentItemId: 1
idleReason: "FINISHED"

HTTP TTS command IN:

08/12/2020, 12:46:08node: Lounge Mini .16
msg : error
"Error: Malformed command"
08/12/2020, 12:46:09node: fe70ae7a.b52e4
msg.payload : undefined
undefined
08/12/2020, 12:46:10node: fe70ae7a.b52e4
msg.payload : undefined
undefined
08/12/2020, 12:46:10node: fe70ae7a.b52e4
msg.payload : null
null
08/12/2020, 12:46:10node: fe70ae7a.b52e4
msg.payload : Object
object
mediaSessionId: 1
playbackRate: 1
playerState: "IDLE"
currentTime: 0
supportedMediaCommands: 274447
volume: object
level: 1
muted: false
activeTrackIds: array[0]
media: object
contentId: "https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Alarm%20Carbon%20Monoxide%20Detected"
contentType: "audio/mp3"
streamType: "BUFFERED"
metadata: object
metadataType: 0
title: "tts"
images: array[1]
0: object
url: "https://nodered.org/node-red-icon.png"
ip: "192.168.0.16"
mediaCategory: "AUDIO"
currentItemId: 1
extendedStatus: object
playerState: "LOADING"
media: object
contentId: "https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Alarm%20Carbon%20Monoxide%20Detected"
contentType: "audio/mp3"
streamType: "BUFFERED"
metadata: object
metadataType: 0
title: "tts"
images: array[1]
0: object
url: "https://nodered.org/node-red-icon.png"
ip: "192.168.0.16"
mediaCategory: "AUDIO"
mediaSessionId: 1
repeatMode: "REPEAT_OFF"
08/12/2020, 12:46:10node: fe70ae7a.b52e4
msg.payload : undefined
undefined
08/12/2020, 12:46:11node: fe70ae7a.b52e4
msg.payload : Object
object
mediaSessionId: 1
playbackRate: 1
playerState: "PLAYING"
currentTime: 0
supportedMediaCommands: 274447
volume: object
level: 1
muted: false
activeTrackIds: array[0]
media: object
contentId: "https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Alarm%20Carbon%20Monoxide%20Detected"
contentType: "audio/mp3"
streamType: "BUFFERED"
metadata: object
metadataType: 0
title: "tts"
images: array[1]
0: object
url: "https://nodered.org/node-red-icon.png"
ip: "192.168.0.16"
mediaCategory: "AUDIO"
duration: 2.616
tracks: array[1]
0: object
trackId: 1
type: "AUDIO"
breakClips: array[0]
breaks: array[0]
currentItemId: 1
items: array[1]
0: object
itemId: 1
media: object
contentId: "https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Alarm%20Carbon%20Monoxide%20Detected"
contentType: "audio/mp3"
streamType: "BUFFERED"
metadata: object
metadataType: 0
title: "tts"
images: array[1]
0: object
url: "https://nodered.org/node-red-icon.png"
ip: "192.168.0.16"
mediaCategory: "AUDIO"
duration: 2.616
autoplay: true
activeTrackIds: array[0]
orderId: 0
repeatMode: "REPEAT_OFF"
08/12/2020, 12:46:12node: fe70ae7a.b52e4
msg.payload : Object
object
mediaSessionId: 1
playbackRate: 1
playerState: "PLAYING"
currentTime: 1.076609
supportedMediaCommands: 274447
volume: object
level: 1
muted: false
activeTrackIds: array[0]
currentItemId: 1
repeatMode: "REPEAT_OFF"
08/12/2020, 12:46:13node: fe70ae7a.b52e4
msg.payload : undefined
undefined
08/12/2020, 12:46:13node: fe70ae7a.b52e4
msg.payload : Object
object
mediaSessionId: 1
playbackRate: 1
playerState: "IDLE"
currentTime: 0
supportedMediaCommands: 274447
volume: object
level: 1
muted: false
currentItemId: 1
idleReason: "FINISHED"

There was an error:

“Error: Malformed command”

But the TTS was spoken out OK on the Lounge Mini speaker.

CAN I GET IT IN THIS FORMAT AS ITS HARD TO WORK OUT THE PATHS IN OTHER FORMAT. sorry caplock on and did not notice

MIOS IN node - Fireplace turning ON

{"mediaSessionId":1,"playbackRate":1,"playerState":"IDLE","currentTime":0,"supportedMediaCommands":274447,"volume":{"level":1,"muted":false},"activeTrackIds":[],"media":{"contentId":"https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Turning%20On%20Fireplace","contentType":"audio/mp3","streamType":"BUFFERED","metadata":{"metadataType":0,"title":"tts","images":[{"url":"https://nodered.org/node-red-icon.png"}],"ip":"192.168.0.16"},"mediaCategory":"AUDIO"},"currentItemId":1,"extendedStatus":{"playerState":"LOADING","media":{"contentId":"https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Turning%20On%20Fireplace","contentType":"audio/mp3","streamType":"BUFFERED","metadata":{"metadataType":0,"title":"tts","images":[{"url":"https://nodered.org/node-red-icon.png"}],"ip":"192.168.0.16"},"mediaCategory":"AUDIO"},"mediaSessionId":1},"repeatMode":"REPEAT_OFF"}
{"mediaSessionId":1,"playbackRate":1,"playerState":"PLAYING","currentTime":0,"supportedMediaCommands":274447,"volume":{"level":1,"muted":false},"activeTrackIds":[],"media":{"contentId":"https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Turning%20On%20Fireplace","contentType":"audio/mp3","streamType":"BUFFERED","metadata":{"metadataType":0,"title":"tts","images":[{"url":"https://nodered.org/node-red-icon.png"}],"ip":"192.168.0.16"},"mediaCategory":"AUDIO","duration":1.896,"tracks":[{"trackId":1,"type":"AUDIO"}],"breakClips":[],"breaks":[]},"currentItemId":1,"items":[{"itemId":1,"media":{"contentId":"https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Turning%20On%20Fireplace","contentType":"audio/mp3","streamType":"BUFFERED","metadata":{"metadataType":0,"title":"tts","images":[{"url":"https://nodered.org/node-red-icon.png"}],"ip":"192.168.0.16"},"mediaCategory":"AUDIO","duration":1.896},"autoplay":true,"activeTrackIds":[],"orderId":0}],"repeatMode":"REPEAT_OFF"}
{"mediaSessionId":1,"playbackRate":1,"playerState":"PLAYING","currentTime":1.11618,"supportedMediaCommands":274447,"volume":{"level":1,"muted":false},"activeTrackIds":[],"currentItemId":1,"repeatMode":"REPEAT_OFF"}
{"mediaSessionId":1,"playbackRate":1,"playerState":"IDLE","currentTime":0,"supportedMediaCommands":274447,"volume":{"level":1,"muted":false},"currentItemId":1,"idleReason":"FINISHED"}

HTTP TTS command IN:

{"mediaSessionId":1,"playbackRate":1,"playerState":"IDLE","currentTime":0,"supportedMediaCommands":274447,"volume":{"level":1,"muted":false},"activeTrackIds":[],"media":{"contentId":"https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Alarm%20Carbon%20Monoxide%20Detected","contentType":"audio/mp3","streamType":"BUFFERED","metadata":{"metadataType":0,"title":"tts","images":[{"url":"https://nodered.org/node-red-icon.png"}],"ip":"192.168.0.16"},"mediaCategory":"AUDIO"},"currentItemId":1,"extendedStatus":{"playerState":"LOADING","media":{"contentId":"https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Alarm%20Carbon%20Monoxide%20Detected","contentType":"audio/mp3","streamType":"BUFFERED","metadata":{"metadataType":0,"title":"tts","images":[{"url":"https://nodered.org/node-red-icon.png"}],"ip":"192.168.0.16"},"mediaCategory":"AUDIO"},"mediaSessionId":1},"repeatMode":"REPEAT_OFF"}
{"mediaSessionId":1,"playbackRate":1,"playerState":"PLAYING","currentTime":0,"supportedMediaCommands":274447,"volume":{"level":1,"muted":false},"activeTrackIds":[],"media":{"contentId":"https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Alarm%20Carbon%20Monoxide%20Detected","contentType":"audio/mp3","streamType":"BUFFERED","metadata":{"metadataType":0,"title":"tts","images":[{"url":"https://nodered.org/node-red-icon.png"}],"ip":"192.168.0.16"},"mediaCategory":"AUDIO","duration":2.616,"tracks":[{"trackId":1,"type":"AUDIO"}],"breakClips":[],"breaks":[]},"currentItemId":1,"items":[{"itemId":1,"media":{"contentId":"https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=En-gb&q=Alarm%20Carbon%20Monoxide%20Detected","contentType":"audio/mp3","streamType":"BUFFERED","metadata":{"metadataType":0,"title":"tts","images":[{"url":"https://nodered.org/node-red-icon.png"}],"ip":"192.168.0.16"},"mediaCategory":"AUDIO","duration":2.616},"autoplay":true,"activeTrackIds":[],"orderId":0}],"repeatMode":"REPEAT_OFF"}
{"mediaSessionId":1,"playbackRate":1,"playerState":"PLAYING","currentTime":1.13906,"supportedMediaCommands":274447,"volume":{"level":1,"muted":false},"activeTrackIds":[],"currentItemId":1,"repeatMode":"REPEAT_OFF"}
{"mediaSessionId":1,"playbackRate":1,"playerState":"IDLE","currentTime":0,"supportedMediaCommands":274447,"volume":{"level":1,"muted":false},"currentItemId":1,"idleReason":"FINISHED"}

Ok the difficulty is finding the trigger to send reset volume

it may be easier to do this, i have used functions to simulate the posistions of the castv2 nodes. Both cast are set the same. give it a try on one of your cast nodes.

[{"id":"150701a9.eddee6","type":"function","z":"66b3988b.4a2ea8","name":"","func":"if(msg.payload.idleReason && msg.payload.idleReason === \"FINISHED\"){\n    msg.payload={\"type\":\"VOLUME\",\"volume\":35};\n    return msg;\n}\nreturn;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":820,"y":140,"wires":[["be455479.e024e8"]]},{"id":"67b423dd.7a9a1c","type":"switch","z":"66b3988b.4a2ea8","name":"","property":"payload.ip","propertyType":"msg","rules":[{"t":"eq","v":"192.168.0.16","vt":"str"},{"t":"eq","v":"192.168.0.19","vt":"str"},{"t":"eq","v":"192.168.0.20","vt":"str"},{"t":"eq","v":"192.168.0.21","vt":"str"},{"t":"eq","v":"192.168.0.24","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":400,"y":160,"wires":[["7f45f953.f9a518"],[],[],[],[]]},{"id":"7f45f953.f9a518","type":"function","z":"66b3988b.4a2ea8","name":"simulate cast node","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":610,"y":140,"wires":[["150701a9.eddee6","a71a4aab.f1a4c8"]]},{"id":"be455479.e024e8","type":"function","z":"66b3988b.4a2ea8","name":"simulate cast node","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1020,"y":140,"wires":[[]]},{"id":"a71a4aab.f1a4c8","type":"debug","z":"66b3988b.4a2ea8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"        (payload.idleReason = \"FINISHED\" ? \"Done\" : \"\")\t  & \" | \" & $moment().format(\"ddd HH:mm:ss\")\t","statusType":"jsonata","x":930,"y":60,"wires":[]}]

edited to stop possible errors undefined.

Like this?

Have you change the Debug node or is that the same?

debug is the same only thing new is the new function node.

So this should change the volume up and down again now ?

Its not doing anything to change the volume level on the Lounge Mini speaker.

Actually that’s not true.

If I manually turn up the volume on the Mini speaker it turns it back down again after the TTS.

Have you set volume to something like 100 in the sensors json.
If no volume is set in url then default is 35 so you will not get any change.

run the fireplace trigger but set sensor json for fireplace to 100. It sholud play at 100 then set back to 35.

That works if I set it to 60 in the Sensors function for the Fireplace.

It says the TTS louder and then after the TTS has finished it turns the Mini speaker back down again.

So for the HTTP command URLs we have to specify the TTS volume in the URL right ?

How do we do that?

I’ll have to edit all my Vera Scenes LUA code and PLEG action LUA code, but if that’s the way its gonna work, that’s fine I’ll do that.

Thanks.

slight error in function 1 here is update

[{"id":"a5e81c85.6cb888","type":"function","z":"66b3988b.4a2ea8","name":"","func":"var IPS = msg.payload.ip.split(\"|\");\nvar message = msg.payload.message;\nvar ttsVolume = msg.payload.volume || 35;\nfor (var i in IPS) { \n    //msg.ttsVolume = true;\n    msg.payload = {\"type\":\"VOLUME\",\"volume\":ttsVolume,\"ip\":IPS[i]};\n    node.send([null,msg]);\nmsg.payload = {\n    type: \"TTS\",\n    text: message,\n    language: \"En-gb\",\n    ip: IPS[i],\n    }\nmsg.iptts = IPS[i];\nnode.send([null, [msg]]);\n}\nif(!msg.sensor){\nmsg.payload = \"ok\"; // the response message\nreturn [msg];\n}else{\n return;\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","x":200,"y":160,"wires":[["ac7159a9.0806d8"],["67b423dd.7a9a1c"]]}]

in url just add &volume=100 there is a default 35 so you do not have to set volume if you want volume set to 35

Just spotted this line in Function 1

var ttsVolume = msg.payload.volume || 60;

I change it to 60 also for the incoming HTTP commands.

That works now increasing the volume and then decreasing after the TTS

So no need to specify the TTS volume in the URL which is good news.

that will set any payload without volume property to 60, The reset will set back to 35. If you want 60 on reset edit function 3

I think I want 60% for the TTS announcement and 35% after the TTS has finished. Which is what I have it setup as now.