Projekt: Alexa Custom Skill mit Node-RED umsetzen
Nachdem ich jetzt lange Alexa-FHEM laufen hatte (Smart Home Skill und Custom Skill), haben mich nach wie vor ein paar Dinge gestört. Zum einen habe ich einen ReverseProxy laufen, welcher schön mit Fail2Ban usw. abgesichert ist und mit einem echten Zertifikat läuft (alexa-fhem läuft mit einem selbst signierten) - es wäre doch irgendwie sinnvoll, alles über einen Zugang von außen ins Netzwerk zu lassen, oder? Und zum anderen dass ich so viel drumrum brauche, was ich gar nicht nutze. Klar, der Smart Home Skill ist ganz nett, aber benutze ich halt nicht. Daher kann ich auch direkt meine eigene Logik auf die Beine stellen mit Node-RED. Und das machen wir jetzt hier. Im Ergebnis haben wir einen komplett unabhängigen Custom Skill, welcher vollständig in Node-RED umgesetzt wird.
Was Du brauchst?
- Eine Node-RED-Installation
- Einen laufenden ReverseProxy
- Einen Amazon Echo
»Node-RED über ReverseProxy«
Video
Befehle
Hier die Lamdba-Funktion. Ziel ist natürlich deine Domain inkl. ReverseProxy. Ich habe noch eine Basic-Authentication davor, welche im Header angepasst werden muss. Also noch eine Stufe sicherer.
Der Authorization-Header ist natürlich base64 kodiert
const https = require('https');
exports.handler = (event, context, callback) => {
var options = {
hostname: 'fhem.deinhostname.com',
path: '/alexa',
port: 443,
method: 'POST',
rejectUnauthorized: false,
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic .....=='
}
};
const req = https.request(options, (res) => {
let body = '';
console.log('Status:', res.statusCode);
console.log('Headers:', JSON.stringify(res.headers));
res.setEncoding('utf8');
res.on('data', (chunk) => body += chunk);
res.on('end', () => {
console.log('Successfully processed HTTPS response');
body = JSON.parse(body);
callback(null, body);
});
});
req.on('error', callback);
req.write(JSON.stringify(event));
req.end();
};
Hier noch mein Flow zum importieren:
[{"id":"fee8da92.ffe228","type":"subflow","name":"An FHEM","info":"","in":[{"x":320,"y":140,"wires":[{"id":"7d4eb671.f86aa8"}]}],"out":[]},{"id":"7d4eb671.f86aa8","type":"mqtt out","z":"fee8da92.ffe228","name":"An FHEM","topic":"/Service/fhem/cmnd","qos":"","retain":"","broker":"afa97030.18184","x":460,"y":140,"wires":[]},{"id":"afa97030.18184","type":"mqtt-broker","z":"","name":"","broker":"mqtt","port":"1883","clientid":"nodered","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"/Service/nodered/status","willQos":"0","willPayload":"crashed","birthTopic":"/Service/nodered/status","birthQos":"0","birthPayload":"started"},{"id":"bf5eeb85.d24f28","type":"tab","label":"Alexa","disabled":false,"info":""},{"id":"d45463e.fb2f1a","type":"http in","z":"bf5eeb85.d24f28","name":"Alexa","url":"/alexa","method":"post","upload":false,"swaggerDoc":"","x":110,"y":160,"wires":[["7a3488dc.35c468"]]},{"id":"9ac1417c.88ab2","type":"http response","z":"bf5eeb85.d24f28","name":"Alexa","statusCode":"","headers":{},"x":570,"y":300,"wires":[]},{"id":"e52376ad.0a7718","type":"json","z":"bf5eeb85.d24f28","name":"zu JSON","property":"payload","action":"","pretty":false,"x":420,"y":300,"wires":[["9ac1417c.88ab2"]]},{"id":"b7625b91.4944b8","type":"template","z":"bf5eeb85.d24f28","name":"Nicht verstanden","field":"payload","fieldType":"msg","format":"json","syntax":"plain","template":"{\n \"version\": \"1.0\",\n \"response\": {\n \"outputSpeech\": {\n \"type\": \"SSML\",\n \"ssml\": \"<speak>Das habe ich nicht verstanden. <amazon:effect name=\\\"whispered\\\">ist wohl blöd programmiert</amazon:effect></speak>\"\n },\n \"shouldEndSession\": true\n }\n}","x":210,"y":340,"wires":[["e52376ad.0a7718"]]},{"id":"7a3488dc.35c468","type":"switch","z":"bf5eeb85.d24f28","name":"Request Type","property":"payload.request.type","propertyType":"msg","rules":[{"t":"eq","v":"LaunchRequest","vt":"str"},{"t":"eq","v":"IntentRequest","vt":"str"},{"t":"eq","v":"SessionEndedRequest","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":280,"y":160,"wires":[["a3d8fe08.85993"],["bb0f6851.267898","16d69355.e706dd"],["a3d8fe08.85993"]]},{"id":"bb0f6851.267898","type":"switch","z":"bf5eeb85.d24f28","name":"Intents","property":"payload.request.intent.name","propertyType":"msg","rules":[{"t":"eq","v":"GetTemperatureInside","vt":"str"},{"t":"eq","v":"GetTemperatureOutside","vt":"str"},{"t":"eq","v":"SwitchLight","vt":"str"},{"t":"eq","v":"WakeUp","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":5,"x":570,"y":160,"wires":[["a42d68a2.f93fc8"],["d037519b.7f5ae"],["a5ec7a9e.4f3ba8"],["72f9e636.6788f8"],["1e3cdca8.5286b3"]]},{"id":"d1a77721.fdf4e8","type":"template","z":"bf5eeb85.d24f28","name":"Temperatur Raum (in der)","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n \"version\": \"1.0\",\n \"response\": {\n \"outputSpeech\": {\n \"type\": \"PlainText\",\n \"text\": \"Aktuell sind in der °C\"\n },\n \"shouldEndSession\": true\n }\n}","x":1030,"y":520,"wires":[["1ef8c6c7.253889"]]},{"id":"8fd1c9ee.3194a8","type":"switch","z":"bf5eeb85.d24f28","name":"Welcher Raum?","property":"payload.request.intent.slots.room.resolutions.resolutionsPerAuthority[0].values[0].value.name","propertyType":"msg","rules":[{"t":"eq","v":"schlafzimmer","vt":"str"},{"t":"eq","v":"wohnzimmer","vt":"str"},{"t":"eq","v":"arbeitszimmer","vt":"str"},{"t":"eq","v":"badezimmer","vt":"str"},{"t":"eq","v":"küche","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":6,"x":340,"y":500,"wires":[["27064dd2.2e8f32"],["301cfe45.057bf2"],["927e7120.ad0ba"],["80784a3f.3019d8"],["6d237e1d.d5de1"],["ca631c19.2415b"]]},{"id":"6d237e1d.d5de1","type":"function","z":"bf5eeb85.d24f28","name":"Temperatur KU","func":"msg.room = msg.payload.request.intent.slots.room.value;\nmsg.temperature = parseInt(global.get('heating_temp_KU'));\nreturn msg;","outputs":1,"noerr":0,"x":620,"y":560,"wires":[["965918aa.b9cda8"]]},{"id":"a42d68a2.f93fc8","type":"link out","z":"bf5eeb85.d24f28","name":"Alexa: Temperatur Innen","links":["d5bb71ce.8218b"],"x":795,"y":40,"wires":[]},{"id":"27998e34.54ee22","type":"comment","z":"bf5eeb85.d24f28","name":"Temperatur innen","info":"","x":900,"y":40,"wires":[]},{"id":"2f3e1a3.92639e6","type":"link in","z":"bf5eeb85.d24f28","name":"Alexa: RESPONSE","links":["1ef8c6c7.253889","951c7eaa.b7c43","b7cd70e5.2c502","4b2a326a.d5cd0c","fe7ca40a.b68088"],"x":75,"y":300,"wires":[["e52376ad.0a7718"]]},{"id":"d5bb71ce.8218b","type":"link in","z":"bf5eeb85.d24f28","name":"Alexa: Temperatur innen","links":["a42d68a2.f93fc8"],"x":75,"y":500,"wires":[["8fd1c9ee.3194a8"]]},{"id":"d96e7501.1d28a8","type":"link in","z":"bf5eeb85.d24f28","name":"Alexa: NICHT VERSTANDEN","links":["ca631c19.2415b","1e3cdca8.5286b3","402601d2.2a21b","a3d8fe08.85993"],"x":75,"y":340,"wires":[["b7625b91.4944b8"]]},{"id":"f4edf6fb.be58c8","type":"comment","z":"bf5eeb85.d24f28","name":"Request","info":"https://developer.amazon.com/de/docs/custom-skills/request-and-response-json-reference.html","x":120,"y":120,"wires":[]},{"id":"41d27fb8.b62ba","type":"comment","z":"bf5eeb85.d24f28","name":"Response","info":"https://developer.amazon.com/de/docs/custom-skills/request-and-response-json-reference.html","x":120,"y":260,"wires":[]},{"id":"78ed539d.17290c","type":"comment","z":"bf5eeb85.d24f28","name":"Temperatur innen","info":"","x":140,"y":460,"wires":[]},{"id":"80784a3f.3019d8","type":"function","z":"bf5eeb85.d24f28","name":"Temperatur BA","func":"msg.room = msg.payload.request.intent.slots.room.value;\nmsg.temperature = parseInt(global.get('heating_temp_BA'));\nreturn msg;","outputs":1,"noerr":0,"x":620,"y":520,"wires":[["33a721b4.d038de"]]},{"id":"927e7120.ad0ba","type":"function","z":"bf5eeb85.d24f28","name":"Temperatur BU","func":"msg.room = msg.payload.request.intent.slots.room.value;\nmsg.temperature = parseInt(global.get('heating_temp_BU'));\nreturn msg;","outputs":1,"noerr":0,"x":620,"y":480,"wires":[["33a721b4.d038de"]]},{"id":"301cfe45.057bf2","type":"function","z":"bf5eeb85.d24f28","name":"Temperatur WZ","func":"msg.room = msg.payload.request.intent.slots.room.value;\nmsg.temperature = parseInt(global.get('heating_temp_WZ'));\nreturn msg;","outputs":1,"noerr":0,"x":620,"y":440,"wires":[["33a721b4.d038de"]]},{"id":"27064dd2.2e8f32","type":"function","z":"bf5eeb85.d24f28","name":"Temperatur SZ","func":"msg.room = msg.payload.request.intent.slots.room.value;\nmsg.temperature = parseInt(global.get('heating_temp_SZ'));\nreturn msg;","outputs":1,"noerr":0,"x":620,"y":400,"wires":[["33a721b4.d038de"]]},{"id":"ca631c19.2415b","type":"link out","z":"bf5eeb85.d24f28","name":"Alexa: Raum nicht verstanden","links":["d96e7501.1d28a8"],"x":555,"y":600,"wires":[]},{"id":"1ef8c6c7.253889","type":"link out","z":"bf5eeb85.d24f28","name":"Alexa: Raum Antwort","links":["2f3e1a3.92639e6"],"x":1255,"y":500,"wires":[]},{"id":"a561cb2f.6b3b08","type":"template","z":"bf5eeb85.d24f28","name":"Temperatur Raum (im)","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n \"version\": \"1.0\",\n \"response\": {\n \"outputSpeech\": {\n \"type\": \"PlainText\",\n \"text\": \"Aktuell sind im °C\"\n },\n \"shouldEndSession\": true\n }\n}","x":1020,"y":440,"wires":[["1ef8c6c7.253889"]]},{"id":"d037519b.7f5ae","type":"link out","z":"bf5eeb85.d24f28","name":"Alexa: Temperatur außen","links":["9e847db8.c417f"],"x":795,"y":80,"wires":[]},{"id":"1e3cdca8.5286b3","type":"link out","z":"bf5eeb85.d24f28","name":"Alexa: Intent nicht verstanden","links":["d96e7501.1d28a8"],"x":795,"y":240,"wires":[]},{"id":"c248e7d0.324eb8","type":"comment","z":"bf5eeb85.d24f28","name":"Temperatur außen","info":"","x":910,"y":80,"wires":[]},{"id":"9c0b391a.acdd48","type":"comment","z":"bf5eeb85.d24f28","name":"Nicht verstanden","info":"","x":900,"y":240,"wires":[]},{"id":"a5ec7a9e.4f3ba8","type":"link out","z":"bf5eeb85.d24f28","name":"Alexa: Licht schalten","links":["b01f851a.e5bd78"],"x":795,"y":120,"wires":[]},{"id":"61043d7a.43a8e4","type":"comment","z":"bf5eeb85.d24f28","name":"Licht schalten","info":"","x":890,"y":120,"wires":[]},{"id":"b01f851a.e5bd78","type":"link in","z":"bf5eeb85.d24f28","name":"Alexa: Licht schalten","links":["a5ec7a9e.4f3ba8"],"x":75,"y":880,"wires":[["3a0c640c.ee81cc"]]},{"id":"eeabae0d.05d82","type":"comment","z":"bf5eeb85.d24f28","name":"Licht schalten","info":"","x":130,"y":840,"wires":[]},{"id":"3a0c640c.ee81cc","type":"switch","z":"bf5eeb85.d24f28","name":"An oder aus?","property":"payload.request.intent.slots.status.resolutions.resolutionsPerAuthority[0].values[0].value.name","propertyType":"msg","rules":[{"t":"eq","v":"an","vt":"str"},{"t":"eq","v":"aus","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":3,"x":330,"y":880,"wires":[["535de099.ede99","2b8fdf9a.626ff"],["f001a2e8.4a76f","5d1e5c01.85a1c4"],["402601d2.2a21b"]]},{"id":"402601d2.2a21b","type":"link out","z":"bf5eeb85.d24f28","name":"Alexa: Licht nicht verstanden","links":["d96e7501.1d28a8"],"x":555,"y":980,"wires":[]},{"id":"16d69355.e706dd","type":"debug","z":"bf5eeb85.d24f28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":530,"y":100,"wires":[]},{"id":"535de099.ede99","type":"template","z":"bf5eeb85.d24f28","name":"Licht an","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n \"version\": \"1.0\",\n \"response\": {\n \"outputSpeech\": {\n \"type\": \"PlainText\",\n \"text\": \"Es werde Licht\"\n },\n \"shouldEndSession\": true\n }\n}","x":600,"y":840,"wires":[["951c7eaa.b7c43"]]},{"id":"951c7eaa.b7c43","type":"link out","z":"bf5eeb85.d24f28","name":"Alexa: Licht Antwort","links":["2f3e1a3.92639e6"],"x":775,"y":860,"wires":[]},{"id":"f001a2e8.4a76f","type":"template","z":"bf5eeb85.d24f28","name":"Licht an","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n \"version\": \"1.0\",\n \"response\": {\n \"outputSpeech\": {\n \"type\": \"PlainText\",\n \"text\": \"Ok. Jetzt sitzt Du im dunkeln\"\n },\n \"shouldEndSession\": true\n }\n}","x":600,"y":880,"wires":[["951c7eaa.b7c43"]]},{"id":"460c0c1b.07b3f4","type":"subflow:fee8da92.ffe228","z":"bf5eeb85.d24f28","x":1220,"y":860,"wires":[]},{"id":"b9eb3602.c49118","type":"change","z":"bf5eeb85.d24f28","name":"Lampen","rules":[{"t":"set","p":"payload","pt":"msg","to":"set NAME=WZ_.*Licht:FILTER=a:weihnachtsautomatik!=ja on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":780,"wires":[["460c0c1b.07b3f4"]]},{"id":"9eb462e3.1a6d4","type":"change","z":"bf5eeb85.d24f28","name":"Wohnwand","rules":[{"t":"set","p":"payload","pt":"msg","to":"set WZ_WohnwandSonoff cmd Color 0000003300","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":820,"wires":[["460c0c1b.07b3f4"]]},{"id":"e6e2b4b7.21e828","type":"change","z":"bf5eeb85.d24f28","name":"Lampen","rules":[{"t":"set","p":"payload","pt":"msg","to":"set NAME=WZ_.*Licht:FILTER=a:weihnachtsautomatik!=ja off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":940,"wires":[["460c0c1b.07b3f4"]]},{"id":"318b4b7e.bc6404","type":"change","z":"bf5eeb85.d24f28","name":"Wohnwand","rules":[{"t":"set","p":"payload","pt":"msg","to":"set WZ_WohnwandSonoff off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":900,"wires":[["460c0c1b.07b3f4"]]},{"id":"33a721b4.d038de","type":"switch","z":"bf5eeb85.d24f28","name":"","property":"temperature","propertyType":"msg","rules":[{"t":"gt","v":"0","vt":"num"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":830,"y":460,"wires":[["a561cb2f.6b3b08"],["f7f4570.661dea8"]]},{"id":"965918aa.b9cda8","type":"switch","z":"bf5eeb85.d24f28","name":"","property":"temperature","propertyType":"msg","rules":[{"t":"gt","v":"0","vt":"num"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":830,"y":540,"wires":[["d1a77721.fdf4e8"],["13ad9319.2952fd"]]},{"id":"f7f4570.661dea8","type":"template","z":"bf5eeb85.d24f28","name":"Keine Temperatur (das)","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n \"version\": \"1.0\",\n \"response\": {\n \"outputSpeech\": {\n \"type\": \"PlainText\",\n \"text\": \"Aktuell sind für das keine Temperaturdaten hinterlegt\"\n },\n \"shouldEndSession\": true\n }\n}","x":1030,"y":480,"wires":[["1ef8c6c7.253889"]]},{"id":"13ad9319.2952fd","type":"template","z":"bf5eeb85.d24f28","name":"Keine Temperatur (die)","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n \"version\": \"1.0\",\n \"response\": {\n \"outputSpeech\": {\n \"type\": \"PlainText\",\n \"text\": \"Aktuell sind für die keine Temperaturdaten hinterlegt\"\n },\n \"shouldEndSession\": true\n }\n}","x":1020,"y":560,"wires":[["1ef8c6c7.253889"]]},{"id":"2b8fdf9a.626ff","type":"switch","z":"bf5eeb85.d24f28","name":"Welcher Raum?","property":"payload.context.System.device.deviceId","propertyType":"msg","rules":[{"t":"eq","v":"amzn1.ask.device.AEVPCR6Z3G7LG4XBYF245CIKF7XYLAI7OVCR4GXLVX4LKVOCM7POQUEGM2CIL6TSVMBLD24S5AT2RD53E7S5T72WVEVBVHAQOJB5TKYZ5RHC3HNPM6L4SWZLXN4OI6UYHQQPTUZYJN6SADRAUTOBC6SMIRGQ","vt":"str"},{"t":"eq","v":"amzn1.ask.device.AEVPCR6Z3G7LG4XBYF245CIKF7X52FVCMQMDR3VEODYD4ZI7C4HUQXX5ZXOYVFA3EFYMAZI7HDM5ZGMM5OYF5G4E2HOE3HIYI2PDCV4BYDYATAEAVVSDE3OXYKLT2ACQ22UUU7IKGM74BEHTYKCBO2KOTJ4L5GGPQS4SFZUENBCWRQ6CRIEBE","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":620,"y":800,"wires":[["6715b649.6e4da8"],["b9eb3602.c49118","9eb462e3.1a6d4"]],"outputLabels":["Büro","Wohnzimmer"]},{"id":"5d1e5c01.85a1c4","type":"switch","z":"bf5eeb85.d24f28","name":"Welcher Raum?","property":"payload.context.System.device.deviceId","propertyType":"msg","rules":[{"t":"eq","v":"amzn1.ask.device.AEVPCR6Z3G7LG4XBYF245CIKF7X52FVCMQMDR3VEODYD4ZI7C4HUQXX5ZXOYVFA3EFYMAZI7HDM5ZGMM5OYF5G4E2HOE3HIYI2PDCV4BYDYATAEAVVSDE3OXYKLT2ACQ22UUU7IKGM74BEHTYKCBO2KOTJ4L5GGPQS4SFZUENBCWRQ6CRIEBE","vt":"str"},{"t":"eq","v":"amzn1.ask.device.AEVPCR6Z3G7LG4XBYF245CIKF7XYLAI7OVCR4GXLVX4LKVOCM7POQUEGM2CIL6TSVMBLD24S5AT2RD53E7S5T72WVEVBVHAQOJB5TKYZ5RHC3HNPM6L4SWZLXN4OI6UYHQQPTUZYJN6SADRAUTOBC6SMIRGQ","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":620,"y":920,"wires":[["e6e2b4b7.21e828","318b4b7e.bc6404"],["b5591758.3cfc38"]],"outputLabels":["Wohnzimmer","Büro"]},{"id":"6715b649.6e4da8","type":"change","z":"bf5eeb85.d24f28","name":"Deckenlicht","rules":[{"t":"set","p":"payload","pt":"msg","to":"set BU_Deckenlicht on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":740,"wires":[["460c0c1b.07b3f4"]]},{"id":"b5591758.3cfc38","type":"change","z":"bf5eeb85.d24f28","name":"Deckenlicht","rules":[{"t":"set","p":"payload","pt":"msg","to":"set BU_Deckenlicht off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":980,"wires":[["460c0c1b.07b3f4"]]},{"id":"a3d8fe08.85993","type":"link out","z":"bf5eeb85.d24f28","name":"Alexa: Type nicht verstanden","links":["d96e7501.1d28a8"],"x":535,"y":220,"wires":[]},{"id":"7874fd3.6651204","type":"comment","z":"bf5eeb85.d24f28","name":"Temperatur außen","info":"","x":150,"y":660,"wires":[]},{"id":"9e847db8.c417f","type":"link in","z":"bf5eeb85.d24f28","name":"Alexa: Temperatur außen","links":["d037519b.7f5ae"],"x":75,"y":700,"wires":[["ef78bfae.7491f"]]},{"id":"15ce3704.9aac49","type":"template","z":"bf5eeb85.d24f28","name":"Temperatur außen","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n \"version\": \"1.0\",\n \"response\": {\n \"outputSpeech\": {\n \"type\": \"PlainText\",\n \"text\": \"Draußen sind aktuell °C\"\n },\n \"shouldEndSession\": true\n }\n}","x":470,"y":700,"wires":[["b7cd70e5.2c502"]]},{"id":"b7cd70e5.2c502","type":"link out","z":"bf5eeb85.d24f28","name":"Alexa: Temperatur außen Antwort","links":["2f3e1a3.92639e6"],"x":615,"y":700,"wires":[]},{"id":"ef78bfae.7491f","type":"function","z":"bf5eeb85.d24f28","name":"Temperatur draußen","func":"msg.temperature = parseInt(global.get('temp_OUT'));\nreturn msg;","outputs":1,"noerr":0,"x":240,"y":700,"wires":[["15ce3704.9aac49"]]},{"id":"72f9e636.6788f8","type":"link out","z":"bf5eeb85.d24f28","name":"Alexa: Weck mich","links":["a1fea872.aa9708"],"x":795,"y":160,"wires":[]},{"id":"4a35fcf6.b0cfa4","type":"comment","z":"bf5eeb85.d24f28","name":"Wecker stellen","info":"","x":900,"y":160,"wires":[]},{"id":"a1fea872.aa9708","type":"link in","z":"bf5eeb85.d24f28","name":"Alexa: Weck mich","links":["72f9e636.6788f8"],"x":75,"y":1080,"wires":[["c3a590b.fc5cb7"]]},{"id":"4b2a326a.d5cd0c","type":"link out","z":"bf5eeb85.d24f28","name":"Alexa: Weck mich Antwort","links":["2f3e1a3.92639e6"],"x":815,"y":1080,"wires":[]},{"id":"43be1830.6a1b48","type":"template","z":"bf5eeb85.d24f28","name":"Wecker gestellt","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n \"version\": \"1.0\",\n \"response\": {\n \"outputSpeech\": {\n \"type\": \"PlainText\",\n \"text\": \"Ich habe den Wecker auf Uhr gestellt\"\n },\n \"shouldEndSession\": true\n }\n}","x":560,"y":1080,"wires":[["4b2a326a.d5cd0c"]]},{"id":"e6a377a.2f00688","type":"comment","z":"bf5eeb85.d24f28","name":"Wecker stellen","info":"","x":140,"y":1040,"wires":[]},{"id":"c3a590b.fc5cb7","type":"function","z":"bf5eeb85.d24f28","name":"Zeit extrahieren","func":"msg.time = msg.payload.request.intent.slots.time.value;\nreturn msg;","outputs":1,"noerr":0,"x":290,"y":1080,"wires":[["43be1830.6a1b48","7d70ff10.aa39"]]},{"id":"5fdd466b.edb658","type":"subflow:fee8da92.ffe228","z":"bf5eeb85.d24f28","x":740,"y":1120,"wires":[]},{"id":"7d70ff10.aa39","type":"function","z":"bf5eeb85.d24f28","name":"Wecker stellen","func":"msg.payload = 'set Wecker weckzeit ' + msg.time;\nreturn msg;","outputs":1,"noerr":0,"x":560,"y":1120,"wires":[["5fdd466b.edb658"]]},{"id":"8902edc8.adb3f","type":"catch","z":"bf5eeb85.d24f28","name":"Fehler","scope":null,"x":110,"y":40,"wires":[["f6351442.02feb8"]]},{"id":"f6351442.02feb8","type":"template","z":"bf5eeb85.d24f28","name":"Fehlertext","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n \"version\": \"1.0\",\n \"response\": {\n \"outputSpeech\": {\n \"type\": \"PlainText\",\n \"text\": \"Fehler - \"\n },\n \"shouldEndSession\": true\n }\n}","x":280,"y":40,"wires":[["fe7ca40a.b68088"]]},{"id":"fe7ca40a.b68088","type":"link out","z":"bf5eeb85.d24f28","name":"Alexa: Fehler Antwort","links":["2f3e1a3.92639e6"],"x":395,"y":40,"wires":[]}]