Skip to content

Instantly share code, notes, and snippets.

@i8beef
Created September 1, 2017 02:31
Show Gist options
  • Save i8beef/8ccb0d31ece3c3a728ac0576bbe189cb to your computer and use it in GitHub Desktop.
Save i8beef/8ccb0d31ece3c3a728ac0576bbe189cb to your computer and use it in GitHub Desktop.
[{"id":"5cbfde25.c029f","type":"chromecast-play","z":"afd66f30.afd4b","name":"","url":"","contentType":"","ip":"","x":490,"y":320,"wires":[["a15e9a18.739508"]]},{"id":"dfecb67.b53d648","type":"function","z":"afd66f30.afd4b","name":"Map target device","func":"let deviceIp = '192.168.1.111';\nswitch (msg.payload.device) {\n case 'kitchen home':\n deviceIp = '192.168.1.111';\n break;\n case 'bedroom home':\n deviceIp = '192.168.1.124';\n break;\n}\n\nreturn {\n payload: {\n ip: deviceIp,\n url: 'http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&textlen=32&client=tw-ob&q=' + encodeURIComponent(msg.payload.phrase) + '&tl=En-us',\n contentType: 'audio/mp3'\n }\n};","outputs":1,"noerr":0,"x":310,"y":320,"wires":[["5cbfde25.c029f"]]},{"id":"9f337059.9db22","type":"http in","z":"afd66f30.afd4b","name":"","url":"/ifttt/say","method":"post","swaggerDoc":"","x":110,"y":320,"wires":[["ff793b22.4a85b8","deca82ff.34579","dfecb67.b53d648"]]},{"id":"ff793b22.4a85b8","type":"http response","z":"afd66f30.afd4b","name":"","x":270,"y":280,"wires":[]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment