Pure fun with Alexa and Alexa Skills

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

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

image

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

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?

@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?

This looks like a duplicate of this post - Alexa Routine Node does not send sound to my mobile device

1 Like

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

[{"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"}]

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.

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

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

This is the entity

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

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...

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...

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.

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 :wink:

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?

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. :slight_smile:

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.

7 Likes

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

To follow up on your setup - this combination of basic blueprint phrases and extra info like time/duration does not work with my blueprint :thinking:
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?

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

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

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 :wink:

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

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