when you run tts at end does it say “finnished” under the debug node? not the debug window.
you can add a date and time too so you know when it last ran, you can have a 32 letter message. on my http request and mqtt i show time and status codes etc
when you run tts at end does it say “finnished” under the debug node? not the debug window.
you can add a date and time too so you know when it last ran, you can have a 32 letter message. on my http request and mqtt i show time and status codes etc
After running a TTS HTTP command this is the last entry in the debug
{"mediaSessionId":1,"playbackRate":1,"playerState":"IDLE","currentTime":0,"supportedMediaCommands":274447,"volume":{"level":1,"muted":false},"currentItemId":1,"idleReason":"FINISHED"}
How do you add date and time ?
Ok
[{"id":"af17f34a.768af8","type":"debug","z":"8d22ae29.7df6d","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":600,"y":2420,"wires":[]}]
edit/ typo
OK there is a problem with sending to more than one Google Home Speaker:
http://192.168.0.4:1880/sceneTrigger?message=Alarm%20Carbon%20Monoxide%20Detected&ip=192.168.0.16|192.168.0.19
It plays on the Lounge Mini OK but the Home speaker in the Kitchen it doesn’t play the TTS but it does make the ding sound as if it is about to do it.
An error can be seen on the Kitchen speaker
Error: Unknown command
Looks like the second speaker isn’t getting the text
Debug node looks like this now:
updated function
[{"id":"4405a5e2.b6263c","type":"function","z":"8d22ae29.7df6d","name":"","func":"var IPS = msg.payload.ip.split(\"|\");\nvar message =msg.payload.message;\nfor (var i in IPS) { \nmsg.payload = {\n type: \"TTS\",\n text: message,\n speed: 1, // optional to adjust TTS speed, defaults to 1\n language: \"en\", // optional to set TTS language, default to en\n title:\"\",\n ip: IPS[i]\n }\n\nnode.send([null, [msg]]);\n}\nmsg.payload = \"ok\"; // the response message\nreturn [msg];\n","outputs":2,"noerr":0,"initialize":"","finalize":"","x":320,"y":2220,"wires":[["9d497085.252fe8"],["5694dfbe.42dd8","d46f5c71.d2de1"]]}]
Yep, when finnished it will say done and if not finished will be blank.
would you like a green circle when done and red when not?
Damn your fast !
That works now both speakers speak out the TTS.
I’ve tested it with four Home speakers and they all say the TTS now.
So everything is working again, other than the volume control you mentioned, if you do have a solution for that.
Thanks again for your help and fixing the Google Home TTS !
i have an idea for volume and will create something probably by tomorrow, as i have a slow day. i was thinking of setting volume then sending tts, with meta data to hold a volume setting and have that picked up after tts finishes, then send a reset volume command. It will mean adding some nodes after the cast nodes to feed back volume command. This way it will only send reset volume when finished and when default volume is not used.
Can you post a complete msg output from the debug, as what you posted earlier in this thread only contains msg.payload.
so set debug to complete msg object and run tts
I also had some static TTS announcements based on device state using the MIOS node etc.
Probably not the best way to do it, but I’ve had to add a function and the replacement Castv2 nodes.
The functions are just like this:
Door opened:
msg =
{
payload: {
type: "TTS",
text: "Patio Door Opened",
speed: 1, // optional to adjust TTS speed, defaults to 1
language: "en", // optional to set TTS language, default to en
title: ""
}
}
return msg;
Door Closed:
msg =
{
payload: {
type: "TTS",
text: "Patio Door Closed",
speed: 1, // optional to adjust TTS speed, defaults to 1
language: "en", // optional to set TTS language, default to en
title: ""
}
}
return msg;
The Switch nodes are the same as what they were before, just looking for a 1 or 0 for the device being tripped or not tripped etc.
They work anyway, when the door is opened or closed it says the correct thing on the TTS.
This is how they looked with the old Cast node:
Export the flow i can probably slim that lot down
are they mios in nodes?
One(possibly) in node one function and into the same switch node for the scenestriggers.
infact export the new tts flow to, and i will combine them.
I have all my sensors in one room called sensors. i can then refer to them in mios node, and not get any other switch info.
Here is the new TTS flow
[{"id":"607f8f77.d010c","type":"tab","label":"Google-TTS-CastV2","disabled":false,"info":""},{"id":"a112732f.89e43","type":"switch","z":"607f8f77.d010c","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":350,"y":160,"wires":[["434f5823.741a98"],["dccbcf87.55976"],["804c865e.7fec08"],["27e62a08.0c33f6"],["9cf2440c.f2a1a8"]]},{"id":"434f5823.741a98","type":"castv2-sender","z":"607f8f77.d010c","name":"Lounge Mini","connection":"6f8783fb.3dd50c","spotifyAccessToken":"","spotifyAccessTokenExpiration":"","spotifyDeviceName":"","x":550,"y":60,"wires":[["2f390a0e.9841b6"]]},{"id":"dccbcf87.55976","type":"castv2-sender","z":"607f8f77.d010c","name":"Kitchen Home","connection":"84b64104.c6bd5","spotifyAccessToken":"","spotifyAccessTokenExpiration":"","spotifyDeviceName":"","x":560,"y":120,"wires":[["850c8bf0.d8e1c8"]]},{"id":"67895b69.0f0944","type":"http in","z":"607f8f77.d010c","name":"http request from scene","url":"sceneTrigger","method":"get","upload":false,"swaggerDoc":"","x":120,"y":100,"wires":[["adb13e3c.05bda"]]},{"id":"804c865e.7fec08","type":"castv2-sender","z":"607f8f77.d010c","name":"Bathroom Mini","connection":"eefe01fb.d0bec","spotifyAccessToken":"","spotifyAccessTokenExpiration":"","spotifyDeviceName":"","x":560,"y":180,"wires":[["eb308132.50df5"]]},{"id":"27e62a08.0c33f6","type":"castv2-sender","z":"607f8f77.d010c","name":"Masterbed Mini","connection":"7f5d6c3c.415914","spotifyAccessToken":"","spotifyAccessTokenExpiration":"","spotifyDeviceName":"","x":560,"y":240,"wires":[["9284e485.4e4de8"]]},{"id":"9cf2440c.f2a1a8","type":"castv2-sender","z":"607f8f77.d010c","name":"Bedroom 2 Mini","connection":"292a4ac3.634916","spotifyAccessToken":"","spotifyAccessTokenExpiration":"","spotifyDeviceName":"","x":560,"y":300,"wires":[["ddeed2e9.7e1db"]]},{"id":"c8222bd2.edf4c8","type":"http response","z":"607f8f77.d010c","name":"http response","statusCode":"200","headers":{},"x":320,"y":40,"wires":[]},{"id":"2f390a0e.9841b6","type":"debug","z":"607f8f77.d010c","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":730,"y":60,"wires":[]},{"id":"850c8bf0.d8e1c8","type":"debug","z":"607f8f77.d010c","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":730,"y":120,"wires":[]},{"id":"eb308132.50df5","type":"debug","z":"607f8f77.d010c","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":730,"y":180,"wires":[]},{"id":"9284e485.4e4de8","type":"debug","z":"607f8f77.d010c","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":732,"y":241,"wires":[]},{"id":"ddeed2e9.7e1db","type":"debug","z":"607f8f77.d010c","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":730,"y":300,"wires":[]},{"id":"952ff1ab.c215c","type":"debug","z":"607f8f77.d010c","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":290,"y":240,"wires":[]},{"id":"adb13e3c.05bda","type":"function","z":"607f8f77.d010c","name":"","func":"var IPS = msg.payload.ip.split(\"|\");\nvar message =msg.payload.message;\nfor (var i in IPS) { \nmsg.payload = {\n type: \"TTS\",\n text: message,\n speed: 1, // optional to adjust TTS speed, defaults to 1\n language: \"en\", // optional to set TTS language, default to en\n title:\"\",\n ip: IPS[i]\n }\n\nnode.send([null, [msg]]);\n}\nmsg.payload = \"ok\"; // the response message\nreturn [msg];\n","outputs":2,"noerr":0,"initialize":"","finalize":"","x":200,"y":160,"wires":[["c8222bd2.edf4c8"],["a112732f.89e43","952ff1ab.c215c"]]},{"id":"6f8783fb.3dd50c","type":"castv2-connection","z":"","name":"Lounge Mini","target":"","host":"192.168.0.16","port":"8009"},{"id":"84b64104.c6bd5","type":"castv2-connection","z":"","name":"Kitchen Home","target":"","host":"192.168.0.19","port":"8009"},{"id":"eefe01fb.d0bec","type":"castv2-connection","z":"","name":"Bathroom Mini","target":"","host":"192.168.0.20","port":"8009"},{"id":"7f5d6c3c.415914","type":"castv2-connection","z":"","name":"Masterbed Mini","target":"","host":"192.168.0.21","port":"8009"},{"id":"292a4ac3.634916","type":"castv2-connection","z":"","name":"Bedroom 2 Home","target":"","host":"192.168.0.24","port":"8009"}]
And here is the flow using the MIOS IN nodes for device status:
[{"id":"975807c0.aa5bc8","type":"tab","label":"Vera-Devices-Google-TTS","disabled":false,"info":""},{"id":"544aa294.3f077c","type":"debug","z":"975807c0.aa5bc8","name":"Vera-Plus","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":460,"y":40,"wires":[]},{"id":"603e98d2.40aa28","type":"delay","z":"975807c0.aa5bc8","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":270,"y":40,"wires":[["544aa294.3f077c"]]},{"id":"3444b601.2ce80a","type":"switch","z":"975807c0.aa5bc8","name":"Patio Door Opened","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":290,"y":100,"wires":[["c152ef72.d0adc"]]},{"id":"7e854856.801418","type":"switch","z":"975807c0.aa5bc8","name":"Patio Door Closed","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":290,"y":140,"wires":[["79d92c1c.66f264"]]},{"id":"86ece8ca.778968","type":"switch","z":"975807c0.aa5bc8","name":"Front Door Opened","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":290,"y":200,"wires":[["352d0a0a.c721f6"]]},{"id":"8d1180c3.e8b16","type":"switch","z":"975807c0.aa5bc8","name":"Front Door Closed","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":290,"y":240,"wires":[["a79a55ac.092b08"]]},{"id":"2e95f24b.a2a93e","type":"switch","z":"975807c0.aa5bc8","name":"Garden Gate Opened","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":280,"y":300,"wires":[["2e279ebe.b90592"]]},{"id":"525ab3e4.6ac68c","type":"switch","z":"975807c0.aa5bc8","name":"Garden Gate Closed","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":280,"y":340,"wires":[["b6261c5c.6b333"]]},{"id":"787f5009.e7e05","type":"switch","z":"975807c0.aa5bc8","name":"Letterbox Opened","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":270,"y":480,"wires":[["32e26933.d23026"]]},{"id":"3a02596.26bfba6","type":"mios-in","z":"975807c0.aa5bc8","name":"Patio Door","server":"db098590.052cd8","item":"Kitchen:Patio Door:Tripped","exact":false,"x":80,"y":100,"wires":[["3444b601.2ce80a","7e854856.801418"]]},{"id":"883b78bd.fcfb98","type":"mios-in","z":"975807c0.aa5bc8","name":"Vera-Plus","server":"db098590.052cd8","item":"","exact":false,"x":80,"y":40,"wires":[["603e98d2.40aa28"]]},{"id":"360a820b.86981e","type":"mios-in","z":"975807c0.aa5bc8","name":"Front Door","server":"db098590.052cd8","item":"Porch:Front Door:Tripped","exact":false,"x":80,"y":180,"wires":[["86ece8ca.778968","8d1180c3.e8b16"]]},{"id":"b02c287a.e29128","type":"mios-in","z":"975807c0.aa5bc8","name":"Garden Gate","server":"db098590.052cd8","item":"Back Garden:Garden Gate:Tripped","exact":false,"x":90,"y":280,"wires":[["2e95f24b.a2a93e","525ab3e4.6ac68c"]]},{"id":"b25f7069.40d2d","type":"mios-in","z":"975807c0.aa5bc8","name":"Letterbox","server":"db098590.052cd8","item":"Porch:Letterbox:Tripped","exact":false,"x":80,"y":480,"wires":[["787f5009.e7e05"]]},{"id":"caf5b829.7b7f48","type":"mios-in","z":"975807c0.aa5bc8","name":"Fireplace","server":"db098590.052cd8","item":"Lounge:Fireplace:Status","exact":false,"x":80,"y":600,"wires":[["dfa8d24b.b7021","1adee64.d78b41a"]]},{"id":"b348dd60.854bf","type":"castv2-sender","z":"975807c0.aa5bc8","name":"Lounge Mini","connection":"6f8783fb.3dd50c","spotifyAccessToken":"","spotifyAccessTokenExpiration":"","spotifyDeviceName":"","x":670,"y":100,"wires":[[]]},{"id":"666ff509.4929ac","type":"castv2-sender","z":"975807c0.aa5bc8","name":"Lounge Mini","connection":"6f8783fb.3dd50c","spotifyAccessToken":"","spotifyAccessTokenExpiration":"","spotifyDeviceName":"","x":670,"y":140,"wires":[[]]},{"id":"9a8759a2.950978","type":"castv2-sender","z":"975807c0.aa5bc8","name":"Lounge Mini","connection":"6f8783fb.3dd50c","spotifyAccessToken":"","spotifyAccessTokenExpiration":"","spotifyDeviceName":"","x":610,"y":580,"wires":[[]]},{"id":"ac107037.2455a","type":"castv2-sender","z":"975807c0.aa5bc8","name":"Lounge Mini","connection":"6f8783fb.3dd50c","spotifyAccessToken":"","spotifyAccessTokenExpiration":"","spotifyDeviceName":"","x":610,"y":620,"wires":[[]]},{"id":"1bec1bc3.a36994","type":"function","z":"975807c0.aa5bc8","name":"Fireplace On","func":"msg =\n{\n payload: {\n type: \"TTS\",\n text: \"Turning on Fireplace\",\n speed: 1, // optional to adjust TTS speed, defaults to 1\n language: \"en\", // optional to set TTS language, default to en\n title: \"\"\n }\n }\n\n \n\n return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":450,"y":580,"wires":[["9a8759a2.950978"]]},{"id":"bf1f7581.9d3b38","type":"function","z":"975807c0.aa5bc8","name":"Fireplace Off","func":"msg =\n{\n payload: {\n type: \"TTS\",\n text: \"Turning off Fireplace\",\n speed: 1, // optional to adjust TTS speed, defaults to 1\n language: \"en\", // optional to set TTS language, default to en\n title: \"\"\n }\n }\n\n \n\n return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":450,"y":620,"wires":[["ac107037.2455a"]]},{"id":"dfa8d24b.b7021","type":"switch","z":"975807c0.aa5bc8","name":"Fireplace On","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":270,"y":580,"wires":[["1bec1bc3.a36994"]]},{"id":"1adee64.d78b41a","type":"switch","z":"975807c0.aa5bc8","name":"Fireplace Off","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":270,"y":620,"wires":[["bf1f7581.9d3b38"]]},{"id":"c152ef72.d0adc","type":"function","z":"975807c0.aa5bc8","name":"Patio Door Opened","func":"msg =\n{\n payload: {\n type: \"TTS\",\n text: \"Patio Door Opened\",\n speed: 1, // optional to adjust TTS speed, defaults to 1\n language: \"en\", // optional to set TTS language, default to en\n title: \"\"\n }\n }\n\n \n\n return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":490,"y":100,"wires":[["b348dd60.854bf"]]},{"id":"79d92c1c.66f264","type":"function","z":"975807c0.aa5bc8","name":"Patio Door Closed","func":"msg =\n{\n payload: {\n type: \"TTS\",\n text: \"Patio Door Closed\",\n speed: 1, // optional to adjust TTS speed, defaults to 1\n language: \"en\", // optional to set TTS language, default to en\n title: \"\"\n }\n }\n\n \n\n return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":490,"y":140,"wires":[["666ff509.4929ac"]]},{"id":"76bc314b.30511","type":"castv2-sender","z":"975807c0.aa5bc8","name":"Lounge Mini","connection":"6f8783fb.3dd50c","spotifyAccessToken":"","spotifyAccessTokenExpiration":"","spotifyDeviceName":"","x":670,"y":200,"wires":[[]]},{"id":"476f043e.6055dc","type":"castv2-sender","z":"975807c0.aa5bc8","name":"Lounge Mini","connection":"6f8783fb.3dd50c","spotifyAccessToken":"","spotifyAccessTokenExpiration":"","spotifyDeviceName":"","x":670,"y":240,"wires":[[]]},{"id":"352d0a0a.c721f6","type":"function","z":"975807c0.aa5bc8","name":"Front Door Opened","func":"msg =\n{\n payload: {\n type: \"TTS\",\n text: \"Front Door Opened\",\n speed: 1, // optional to adjust TTS speed, defaults to 1\n language: \"en\", // optional to set TTS language, default to en\n title: \"\"\n }\n }\n\n \n\n return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":490,"y":200,"wires":[["76bc314b.30511"]]},{"id":"a79a55ac.092b08","type":"function","z":"975807c0.aa5bc8","name":"Front Door Closed","func":"msg =\n{\n payload: {\n type: \"TTS\",\n text: \"Front Door Closed\",\n speed: 1, // optional to adjust TTS speed, defaults to 1\n language: \"en\", // optional to set TTS language, default to en\n title: \"\"\n }\n }\n\n \n\n return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":490,"y":240,"wires":[["476f043e.6055dc"]]},{"id":"c6c5523c.c2482","type":"castv2-sender","z":"975807c0.aa5bc8","name":"Lounge Mini","connection":"6f8783fb.3dd50c","spotifyAccessToken":"","spotifyAccessTokenExpiration":"","spotifyDeviceName":"","x":710,"y":300,"wires":[[]]},{"id":"b611625a.f256a","type":"castv2-sender","z":"975807c0.aa5bc8","name":"Lounge Mini","connection":"6f8783fb.3dd50c","spotifyAccessToken":"","spotifyAccessTokenExpiration":"","spotifyDeviceName":"","x":710,"y":380,"wires":[[]]},{"id":"2e279ebe.b90592","type":"function","z":"975807c0.aa5bc8","name":"Garden Gate Opened","func":"msg =\n{\n payload: {\n type: \"TTS\",\n text: \"Garden Gate Opened\",\n speed: 1, // optional to adjust TTS speed, defaults to 1\n language: \"en\", // optional to set TTS language, default to en\n title: \"\"\n }\n }\n\n \n\n return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":500,"y":300,"wires":[["c6c5523c.c2482","ae70c144.c6338"]]},{"id":"b6261c5c.6b333","type":"function","z":"975807c0.aa5bc8","name":"Garden Gate Closed","func":"msg =\n{\n payload: {\n type: \"TTS\",\n text: \"Garden Gate Closed\",\n speed: 1, // optional to adjust TTS speed, defaults to 1\n language: \"en\", // optional to set TTS language, default to en\n title: \"\"\n }\n }\n\n \n\n return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":500,"y":340,"wires":[["b611625a.f256a","3cbb98dc.4403d8"]]},{"id":"3cbb98dc.4403d8","type":"castv2-sender","z":"975807c0.aa5bc8","name":"Masterbed Mini","connection":"7f5d6c3c.415914","spotifyAccessToken":"","spotifyAccessTokenExpiration":"","spotifyDeviceName":"","x":720,"y":420,"wires":[[]]},{"id":"ae70c144.c6338","type":"castv2-sender","z":"975807c0.aa5bc8","name":"Masterbed Mini","connection":"7f5d6c3c.415914","spotifyAccessToken":"","spotifyAccessTokenExpiration":"","spotifyDeviceName":"","x":720,"y":340,"wires":[[]]},{"id":"32e26933.d23026","type":"function","z":"975807c0.aa5bc8","name":"Letterbox Opened","func":"msg =\n{\n payload: {\n type: \"TTS\",\n text: \"Letterbox Opened\",\n speed: 1, // optional to adjust TTS speed, defaults to 1\n language: \"en\", // optional to set TTS language, default to en\n title: \"\"\n }\n }\n\n \n\n return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":490,"y":480,"wires":[["899443f6.0873d","7166a594.b03eec"]]},{"id":"899443f6.0873d","type":"castv2-sender","z":"975807c0.aa5bc8","name":"Lounge Mini","connection":"6f8783fb.3dd50c","spotifyAccessToken":"","spotifyAccessTokenExpiration":"","spotifyDeviceName":"","x":710,"y":480,"wires":[[]]},{"id":"7166a594.b03eec","type":"castv2-sender","z":"975807c0.aa5bc8","name":"Masterbed Mini","connection":"7f5d6c3c.415914","spotifyAccessToken":"","spotifyAccessTokenExpiration":"","spotifyDeviceName":"","x":720,"y":520,"wires":[[]]},{"id":"db098590.052cd8","type":"mios-server","z":"","name":"Vera-Plus","host":"192.168.0.12","port":"3480"},{"id":"6f8783fb.3dd50c","type":"castv2-connection","z":"","name":"Lounge Mini","target":"","host":"192.168.0.16","port":"8009"},{"id":"7f5d6c3c.415914","type":"castv2-connection","z":"","name":"Masterbed Mini","target":"","host":"192.168.0.21","port":"8009"}]
try this i have added the two sensors in the function.
[{"id":"eddb7aa9.886be","type":"mios-in","z":"66b3988b.4a2ea8","name":"Front Door","server":"1de4bdab.459a8a","item":"Porch:Front Door:Tripped","exact":false,"x":90,"y":440,"wires":[["e81dc498.0a1308"]]},{"id":"e81dc498.0a1308","type":"function","z":"66b3988b.4a2ea8","name":"","func":"let sensors={\n \"Kitchen:Patio Door:Tripped\":{\n \"ips\":\"192.168.0.16|192.168.0.19\",\n \"message\":[\"Patio Door Closed\",\"Patio Door Opened\"],\n \"volume\":35\n },\n \"Porch:Front Door:Tripped\":{\n \"ips\":\"192.168.0.16|192.168.0.19\",\n \"message\":[\"Front Door Closed\",\"Front Door Opened\"],\n \"volume\":35\n },\n \"Porch:Letterbox:Tripped\":{\n \"ips\":\"192.168.0.16|192.168.0.19\",\n \"message\":[\"null\",\"Letter box Opened\"],\n \"volume\":35\n }\n}\nlet sensor = sensors[msg.topic];\nif(sensor[\"message\"][msg.payload] !== \"null\"){\nmsg.payload = {\n \"message\": sensor[\"message\"][msg.payload],\n \"ip\": sensor[\"ips\"],\n \"volume\": sensor[\"volume\"]\n }\nmsg.sensor = true;\nreturn msg;\n}else{\n return;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":270,"y":380,"wires":[["a5e81c85.6cb888"]]},{"id":"8a0ab9ca.46477","type":"mios-in","z":"66b3988b.4a2ea8","name":"Patio Door","server":"1de4bdab.459a8a","item":"Kitchen:Patio Door:Tripped","exact":false,"x":90,"y":380,"wires":[["e81dc498.0a1308"]]},{"id":"a5e81c85.6cb888","type":"function","z":"66b3988b.4a2ea8","name":"","func":"var IPS = msg.payload.ip.split(\"|\");\nvar message =msg.payload.message;\nfor (var i in IPS) { \nmsg.payload = {\n type: \"TTS\",\n text: message,\n ip: IPS[i]\n }\n\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"]]},{"id":"e1e73f8f.e66748","type":"mios-in","z":"66b3988b.4a2ea8","name":"Letterbox","server":"1de4bdab.459a8a","item":"Porch:Letterbox:Tripped","exact":false,"x":90,"y":500,"wires":[["e81dc498.0a1308"]]},{"id":"e1c51dd3.ce0e2","type":"http in","z":"66b3988b.4a2ea8","name":"http request from scene","url":"sceneTrigger","method":"get","upload":false,"swaggerDoc":"","x":120,"y":100,"wires":[["a5e81c85.6cb888"]]},{"id":"ac7159a9.0806d8","type":"http response","z":"66b3988b.4a2ea8","name":"http response","statusCode":"200","headers":{},"x":320,"y":40,"wires":[]},{"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":[["a71a4aab.f1a4c8"],["512ec525.ee0f4c"],["f26c9efc.a34d58"],["266bf474.3e3fc4"],["b43a5935.deb66"]]},{"id":"1de4bdab.459a8a","type":"mios-server","z":"","name":"Vera-Plus","host":"192.168.1.11","port":"3480"}]
edit added letter box null on payload 0
Starbuck is call me on the TV.
I’ll try it tomorrow.
Best Home Automation shopping experience. Shop at Ezlo!
© 2024 Ezlo Innovation, All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules