# Pure fun with Alexa and Alexa Skills

**URL:** https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867
**Category:** Share Your Projects
**Created:** [8 June 2021 16:57 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867 "2021-06-08T16:57:59Z")
**Posts on this page:** 20
**Page:** 3

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [4 May 2022 08:35 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/41 "2022-05-04T08:35:53Z")

</div>

Which Alex node are you using?  
I creaated my original flow to work with... node-red-contrib-alexa-remote2-applestrudel  
 ![Screen Shot 05-04-22 at 09.32 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/a/eabf8ca5dd7f2a0562a183710c3b04410362e14e.png)

---

<div class="post-metadata">

### Author: ![Mengi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mengi/32/60708_2.png) [@Mengi](https://discourse.nodered.org/u/Mengi)
#### Post date: [4 May 2022 09:19 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/42 "2022-05-04T09:19:10Z")

</div>

> [@dynamicdave](#):
>
> node-red-contrib-alexa-remote2-applestrudel

Yes, I am using that same Paletta..."node-red-contrib-alexa-remote2-applestrudel" 5.0.9

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/0/c0e54d4ef9eb6104a39c1b9e9b5525d3d0d54a7a.png)

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [4 May 2022 10:41 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/43 "2022-05-04T10:41:52Z")

</div>

Are you sure as when I imported the flow you had posted it came up with unknow nodes on my system?

---

<div class="post-metadata">

### Author: ![Mengi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mengi/32/60708_2.png) [@Mengi](https://discourse.nodered.org/u/Mengi)
#### Post date: [4 May 2022 10:46 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/44 "2022-05-04T10:46:40Z")

</div>

Yes, I'm sure.

It may be that for some reason I have not updated the Nodes, Node-RED, but I have exported everything, deleted the Palette, and imported the nodes again. Before I have even deleted the Alexa account from Node Red.

The same thing keeps happening to me.

Would I have to create again or does it also import, as I have done?

---

<div class="post-metadata">

### Author: ![Mengi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mengi/32/60708_2.png) [@Mengi](https://discourse.nodered.org/u/Mengi)
#### Post date: [4 May 2022 10:51 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/45 "2022-05-04T10:51:48Z")

</div>

@dynamicdave Would this be correct???, or is it that we have to do it in another way??

If this is wrong, can you please share your flow?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/0/902b11800e8f7680bffd1edcd73c434ff6b40eeb.png)

---

<div class="post-metadata">

### Author: ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)
#### Post date: [4 May 2022 12:13 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/46 "2022-05-04T12:13:24Z")

</div>

This looks like a duplicate of this post - [Alexa Routine Node does not send sound to my mobile device](https://discourse.nodered.org/t/alexa-routine-node-does-not-send-sound-to-my-mobile-device/61857)

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [4 May 2022 12:15 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/47 "2022-05-04T12:15:07Z")

</div>

Try this. I've taken part of my flow as a demo for you. Hope it works for you.

 ![Screen Shot 05-04-22 at 01.13 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/5/e56e2cdaa10dc49aa4a3b99d5e90de2d0e88e942.png)

```auto
[{"id":"59079664.dbada","type":"alexa-remote-event","z":"95c6d0af.f40018","name":"","account":"57e78a27.bf542c","event":"ws-device-activity","x":170,"y":320,"wires":[["5ff65be9.f845c4","2c68ef53.23d3f8","8a9936f2.1e3748"]]},{"id":"1e9a427a.1f34be","type":"debug","z":"95c6d0af.f40018","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":690,"y":320,"wires":[]},{"id":"ef1370b3.5babd","type":"inject","z":"95c6d0af.f40018","name":"Test: hello on saturday","props":[{"p":"payload"},{"p":"device_name","v":"Study","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Hello on saturday","payloadType":"str","x":580,"y":420,"wires":[["50e3e9e7.8c6e48"]]},{"id":"50e3e9e7.8c6e48","type":"alexa-remote-routine","z":"95c6d0af.f40018","name":"Alexa device","account":"57e78a27.bf542c","routineNode":{"type":"speak","payload":{"type":"announcement","text":{"type":"msg","value":"payload"},"devices":{"type":"msg","value":"device_name"}}},"x":790,"y":460,"wires":[[]]},{"id":"2c68ef53.23d3f8","type":"function","z":"95c6d0af.f40018","name":"Capture question","func":"var device_name = msg.payload.name;\nvar summary = msg.payload.description.summary;\n\n if ((summary != \"alexa\") && (summary != \"\")) {\n \n msg.payload = {};\n\n msg = {\n topic: \"Alexa_response\",\n device_name: device_name,\n payload: {\n \"summary\": summary\n }\n}\n node.status({text:\"Device_name is \"+ device_name + \" Summary = \" + summary});\n return msg;\n}\nelse {\n return null;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":320,"wires":[["1e9a427a.1f34be","9a97a056.7df48","8b2ac165.eaa288","962a99e7.3a24d"]]},{"id":"9a97a056.7df48","type":"switch","z":"95c6d0af.f40018","name":"","property":"payload.summary","propertyType":"msg","rules":[{"t":"cont","v":"turn on telegram","vt":"str"},{"t":"cont","v":"turn off telegram","vt":"str"},{"t":"cont","v":"turn telegram on","vt":"str"},{"t":"cont","v":"turn telegram off","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":5,"x":150,"y":460,"wires":[["21290b33.9b60e4","6bd1453d.fcf08c"],["f3712feb.cb0958","6bd1453d.fcf08c"],["21290b33.9b60e4"],["f3712feb.cb0958"],[]]},{"id":"21290b33.9b60e4","type":"function","z":"95c6d0af.f40018","name":"","func":"// msg.name =\"study\";\nmsg.payload = \"telegram function has been turned on\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":320,"y":440,"wires":[["f48d918c.d29fc8","50e3e9e7.8c6e48"]]},{"id":"f3712feb.cb0958","type":"function","z":"95c6d0af.f40018","name":"","func":"// msg.name =\"study\";\nmsg.payload = \"telegram function has been turned off\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":320,"y":480,"wires":[["f48d918c.d29fc8","50e3e9e7.8c6e48"]]},{"id":"f48d918c.d29fc8","type":"debug","z":"95c6d0af.f40018","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":510,"y":500,"wires":[]},{"id":"8a9936f2.1e3748","type":"debug","z":"95c6d0af.f40018","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":350,"y":380,"wires":[]},{"id":"57e78a27.bf542c","type":"alexa-remote-account","name":"Amazon-Alexa","authMethod":"proxy","proxyOwnIp":"192.168.1.152","proxyPort":"3458","cookieFile":"/home/pi/amazon_alexa.txt","refreshInterval":"3","alexaServiceHost":"alexa.amazon.co.uk","amazonPage":"amazon.co.uk","acceptLanguage":"en-UK","userAgent":"","useWsMqtt":"on","autoInit":"off"}]

```

---

<div class="post-metadata">

### Author: ![Mengi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mengi/32/60708_2.png) [@Mengi](https://discourse.nodered.org/u/Mengi)
#### Post date: [4 May 2022 12:30 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/48 "2022-05-04T12:30:45Z")

</div>

Yes, it's the same problem, but I didn't know how to explain my problem better, and I didn't want to bother you too much.

I have been searching, and I could read that they used a solution, which I will continue to see if it solves my error.

---

<div class="post-metadata">

### Author: ![Mengi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mengi/32/60708_2.png) [@Mengi](https://discourse.nodered.org/u/Mengi)
#### Post date: [4 May 2022 12:31 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/49 "2022-05-04T12:31:12Z")

</div>

Voucher. I'm going to try it, and now I tell you the result.

---

<div class="post-metadata">

### Author: ![Mengi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mengi/32/60708_2.png) [@Mengi](https://discourse.nodered.org/u/Mengi)
#### Post date: [4 May 2022 13:53 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/50 "2022-05-04T13:53:45Z")

</div>

Thank you very much for your help. In principle, she answers where I ask her.

For my first test, I want the temperature of my hot water temperature sensor to be answered, but I don't know how to mention the sensor and put the payload I need.

I'm sending you screenshots in case you can help me, since it's hard for me to explain in another language.

This is the data (44.5 at this time)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/f/cf828f167e9b650e8167d81dfed607a113925d7f.png)

This is the entity

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/b/fb278d80464dafed4585c52c3a0d57eb039591c1.png)

This is the response message I need, which I have edited from your example of your flow

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/c/1cb59393e2520a7ec16fde8e064fee6965d1da23.png)

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [4 May 2022 14:32 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/51 "2022-05-04T14:32:24Z")

</div>

Although I know nothing about Home Assistant, it looks like the temperature is in msg.payload.  
So maybe in your function node you could try...

```auto
msg.payload = "La temperatura del....... es" + msg.payload + "grados";
return msg;

```

I'm assuming the function node connects to your HA node.

You could also test the function node on its own with this...

```auto
msg.payload = 44.5;
msg.payload = "La temperatura del....... es" + msg.payload + "grados";
return msg;

```

Just tried it on one of my RPi(es) and it works fine.

---

<div class="post-metadata">

### Author: ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)
#### Post date: [4 May 2022 14:47 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/52 "2022-05-04T14:47:55Z")

</div>

You should not double post.  
Then the people trying to help you in the other post are just left waiting for a response, so its actually more bother 😉

There is a working solution in the other post - As I tried to explain all you need to do is provide the temperature reading to the function.

Based on what I see here it looks like this comes from the home assistant node, in message payload is that correct ?

If so can you reply back to the other thread please?

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [4 May 2022 16:57 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/53 "2022-05-04T16:57:49Z")

</div>



---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [4 May 2022 19:42 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/54 "2022-05-04T19:42:20Z")

</div>



---

<div class="post-metadata">

### Author: ![DiverRich](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diverrich/32/64523_2.png) [@DiverRich](https://discourse.nodered.org/u/DiverRich)
#### Post date: [15 July 2022 21:32 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/55 "2022-07-15T21:32:51Z")

</div>

Thanks a ton @dynamicdave for sharing your tutorial with me. I've been trying for quite some time to get Alexa to work with dynamic verbal commands. Your post here was very helpful! I'm finally able to put the cherry on top of my flows using the ecolect node (node-red-contrib-ecolect) to parse the commands and a version of your functions for routing. 🙂

 ![Screenshot 2022-07-15 at 2.30.15 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/7/d766be5520f6e39c67662653c38e829799ebe1b7.png)

 ![Screenshot 2022-07-15 at 2.27.23 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/8/18f9ffb2b9baf5ac25b43ae63ee3dcbc131a7ecd.png)

In case anyone is wondering...

The top flow listens to my alexa events and when I issue a verbal command (in this case for the lights) it sends it to the ecolect node for some local fuzzy logic parsing.

I can say things like "Alexa, turn on the bedroom lights for ten minutes." Or, even, "Alexa, turn off the bedroom lights for 3 seconds."

Because I can just say things that don't include a specific room or a time the function nodes route the message based on what values have been discovered by ecolect and output specific responses from Alexa to acknowledge what she heard. Thanks to the function node it also responds from the specific echo I'm talking to (I have 11 of the damn things) so I literally don't hear echos all around the house.

The command is routed to the correct room and then the numbers and units are joined to set the variedly timer. If no values are set, I have it to default to 60 minutes. Using the@yadomi/node-red-contrib-philipshue-events nodes, the lights are turned on/off and the motion sensor is disabled/enabled. Further along, the lights also respond to the house/alarm mode, sleep presence, and has a resettable delay timer (using a trigger node) to make sure the lights come on and goes off with motion as desired.

I should also mention that I used an Alexa skill blueprint to set each light up. So I have four conditions for each, "Alexa, turn on the bedroom lights, "Alexa, turn off the bedroom lights," "Alexa, turn off the lights in the bedroom," and, "Alexa, turn on the lights in the bedroom." Here required response is "ok," which in brief mode just gives a chime. Then she sends back, "Turning on the lights..." adding the area "in the bedroom" and adding the time "for 5 minutes," if an area and/or time have been part of the request.

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [16 July 2022 04:01 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/56 "2022-07-16T04:01:30Z")

</div>

Thanks for the positive feedback. Really glad some of my information was useful to you.

---

<div class="post-metadata">

### Author: ![haegar33](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haegar33/32/38805_2.png) [@haegar33](https://discourse.nodered.org/u/haegar33)
#### Post date: [5 August 2022 15:19 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/57 "2022-08-05T15:19:19Z")

</div>

> [@DiverRich](#):
>
> I can say things like "Alexa, turn on the bedroom lights for ten minutes." Or, even, "Alexa, turn off the bedroom lights for 3 seconds."  
> ...  
> I should also mention that I used an Alexa skill blueprint to set each light up. So I have four conditions for each, "Alexa, turn on the bedroom lights, "Alexa, turn off the bedroom lights,..

To follow up on your setup - this combination of basic blueprint phrases and extra info like time/duration does not work with my blueprint 🤔  
If I extend my basic blueskill phrase like "switch on bathroom light" with "in 10 minutes" Alexa does not understand the command..

Do I miss something here?

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [5 August 2022 15:58 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/58 "2022-08-05T15:58:53Z")

</div>

I don't think you have missed anythng - as all Blueprints will do is send the response "string".  
I've not tried it, but maybe you could use a 'Switch' node to see if the response contains the follow-on text.  
 ![alexa_acces](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/8/e860558c9c0e3ee8668e6bf21f7921f0b75e50e3.png)

As you can see, Alexa returns the exact request, so maybe you could do something with that?

 ![bathroom](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/9/f9df3a90fba5f68063a7d7f7296357b67500f8d9.png)

---

<div class="post-metadata">

### Author: ![haegar33](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haegar33/32/38805_2.png) [@haegar33](https://discourse.nodered.org/u/haegar33)
#### Post date: [5 August 2022 16:44 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/59 "2022-08-05T16:44:44Z")

</div>

I think you missunderstood my problem. Its not on the NodeRed side. Its how you define the blueprint phrases. If I dont speak precisley the phrases defined (with no additional words) Alexa does not understand me. Well I can retrieve my "not understood" phrase back in NR and proceed further but I dont want Alexa to answer all the time "I did not get you..." when I want to switch on a light 😉

Thus all the variations possible with the ecolect node (at least to user @DiverRich ) do not work this way?

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [5 August 2022 16:56 UTC](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867/60 "2022-08-05T16:56:53Z")

</div>

OK - understand. Let's hope @DiverRich jumps-in and offers some suggestions.

[Previous page](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867.md?page=2)

[Next page](https://discourse.nodered.org/t/pure-fun-with-alexa-and-alexa-skills/46867.md?page=4)
