Node Red Room Aware Voice Control

I was having issues with Amazon saving the cookie for an Australian account. (file path was correct as it had worked previously)
I have now changed to saving the cookie within NR as a variable.
There is info out there to do this.
Once I'm home tonight I can post the flow to set it up
Maybe this will help with canadian accounts also!

Edit. My NR is running in a docker container but in unraid not Windows. So I couldnt help with file path sorry

Thanks that might help. In the meantime I uninstalled docker and installed node-red directly on Windows. I then went through the process again and this time it seemed to save a cookie in the authfile.txt file. However, a short time later it turns to "Authentication Failed"

1 Like

This is my init flow

[{"id":"f3ff139b.01dd3","type":"alexa-remote-init","z":"7b84f49a.9ad5cc","name":"","account":"49135c4f.6bdd74","option":"initialise","x":260,"y":60,"wires":[["74cd0c7b.325354"]]},{"id":"ba61ab31.e4d208","type":"inject","z":"7b84f49a.9ad5cc","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"00 12 * * 2,4,0","once":false,"onceDelay":0.1,"topic":"","payload":"alexa","payloadType":"flow","x":110,"y":60,"wires":[["f3ff139b.01dd3"]]},{"id":"74cd0c7b.325354","type":"change","z":"7b84f49a.9ad5cc","name":"set","rules":[{"t":"set","p":"#:(file)::alexa","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":60,"wires":[[]]},{"id":"2a1fc81f.b96e28","type":"comment","z":"7b84f49a.9ad5cc","name":"Alexa Init","info":"","x":80,"y":20,"wires":[]},{"id":"443b92d6.132dfc","type":"inject","z":"7b84f49a.9ad5cc","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"Started!","payloadType":"str","x":100,"y":120,"wires":[["6313cbe4.e7fc64"]]},{"id":"6313cbe4.e7fc64","type":"change","z":"7b84f49a.9ad5cc","name":"set","rules":[{"t":"set","p":"payload","pt":"msg","to":"#:(file)::alexa","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":250,"y":120,"wires":[["6c43f2b4.15104c"]]},{"id":"6c43f2b4.15104c","type":"alexa-remote-init","z":"7b84f49a.9ad5cc","name":"","account":"49135c4f.6bdd74","option":"initialise","x":380,"y":120,"wires":[[]]},{"id":"49135c4f.6bdd74","type":"alexa-remote-account","name":"","authMethod":"proxy","proxyOwnIp":"192.168.20.10","proxyPort":"3456","cookieFile":"","refreshInterval":"3","alexaServiceHost":"alexa.amazon.com.au","amazonPage":"amazon.com.au","acceptLanguage":"en-US","userAgent":"","useWsMqtt":"on","autoInit":"off"}]

Also, in the Node Red setting.js file,, i needed change this line

This has worked for me so far!

1 Like

Thanks @bdydrp this seems to have fixed the issue. I am currently running node-red directly on Windows as I gave up with docker. It seems to have authorized using alexa.amazon.ca as the host and amazon.ca as the Page and en-CA as the language. Seems to be running smoothly right now. I will keep an eye on it as I move forward. Thanks so much! I also have an unraid server setup with docker. Might try node-red on their at some point.

2 Likes

Glad it worked out!
I have my NR running on unraid docker, so if you go back - I can try and help as as much as I can

Thanks! Does the Alexa init flow run continuously? How does that work?

From what I understand it should.
I admit, it take it from a other blog I saw on this alexa.remote2 node.
I believe the top line should check with the Amazon servers servers on the days checked in the inject node.
Then the 2nd line should push the cookie to the nodes on each start up.
Happy to be corrected if I'm wrong, but I believe that is what happens in a nut shell!

OK, I am getting this whenever I "Deploy"

"Initialisation was aborted!"

It is working but I wonder why it is doing it every time I deploy?

Also, when I give Alexa a command and a node flow runs, she says "she doesn't know, etc." but the node runs fine. Any way to stop this?

It probably means the phrase Alexa hears is not close enough to phrase in dummy wait routine.

@pcgirl
I have not seen the "Initialisation was aborted!" error before...
Maybe scroll through the issues on the projects github page.

Maybe we should split this topic off to keep the original??
perhaps a alexa.remote2 setup thread?? :man_shrugging:

OK, just one more problem. Went into node red today to work on it and now it is saying port 3456 already in use with the red squares. Why is this happening now?

Update....I found out that when I imported a node from someone else to look at how they are doing it, it had an Alexa account setup. I had to delete that account and now mine is working again.

3 Likes

Now here is the question. With this great tool we now have room awareness where the spoken phrase is stored to a string. Is there a way we could call a privately defined alexa skill api that would return the intent and slot entities? This would mimic a direct action in alexa without needing invocation! :slight_smile:

Just wanted to drop a note, this is working amazingly well! Has anyone been able to address my question?

"Now here is the question. With this great tool we now have room awareness where the spoken phrase is stored to a string. Is there a way we could call a privately defined alexa skill api that would return the intent and slot entities? This would mimic a direct action in alexa without needing invocation! :slight_smile:"

I just discovered that there is now a custom option in Alexa Routines Actions that will do that. I just discovered it and haven't found out how to do it thru Node Red yet.

I don't think so. This will not detect room awareness in Node Red, it also does not answer my question around how to short circuit an Alexa skill skipping invocation.

The custom option only relates to the "without needing invocation" portion of your question. I use it to open Firefox to an HE dashboard on my Echo Show due to motion. That is something I couldn't do previously without speaking the command. I just created a Routine; its not done with Node Red.

If there is a way that the Alexa2 node can access this capability, I am hopeful that phrase could be created in a template node with device names and sent to the Alexa2 node. I just discovered this capability in the Alexa app so I haven't spent any time experimenting. If this custom option is relatively new, it might not be accounted for the in the Alexa pallet... yet. Fingers crossed!!!

1 Like

I don't think it will do exactly what you want (that is still a little unclear), but you might want to look at Voiceflow.com. It allows you to build your own skill using a node-redesque type interface including intent and slot info. I have experimented with it some and have been able to pass any information I have into node red via http calls from the skill to http nodes in Node Red.

Basically I want to grab a phrase like Alexa, turn on ESPN. Within NR, I would have the room awareness via this Alexa integration, but I also want to be able to caputure the intent using NLP and slot entity value. So, in this case, I would call an API and get something back like...

{
intent: "ChangeChannel",
channelName: "ESPN",
channelNumber: 206
}

These channel number mappings would live inside the NLP platform.

This would allow me to bypass invocation process, while leveraging NLP capabilities directly.

Even if we got this to work, I think I would still need dummy channels/switches in Alexa to avoid the "I'm sorry, I can't find that device"...

Any ideas? :slight_smile: