This is an example with lights. This way you will just have to say ‘Turn the light on’ (or whichever sentence Alexa understands to turn a light on) and the appropiate light will turn on depending on the area you are in. That applies to any device: fans, tvs, curtains, ‘the mirror’ and so on… just one word for them all and no need to create a dozen routines to cover all kinds of sentences.
you will need: node-red-contrib-alexa-remote2
First section, ‘Setting currently listening device’: https://pastebin.ubuntu.com/p/vdYV7FQbqj/
First node listens to Alexa’s events, acknowledges which device you’re talking to and sets a flow.echodevice containing the name of the listening device. You needn’t change anything in the nodes without a label, leave them as they are. In fact you only need to add you account to the first node, leave everything else as is. Don’t worry abou having several devices near listening to you, the node picks the right device
Second section, ‘Turn light on according to which device listened’: https://pastebin.ubuntu.com/p/hCZsRg8pTg/
You have to create an account and an alexa device called ‘Light’ or ‘The light’ in: https://alexa-node-red.bm.hardill.me.uk/docs
after creating the device ‘Light’, go to your Alexa app and install the Node Red Skill, which will allow Alexa to discover the device ‘Light’
Once discovered, you must read the documentation to understand how to make requests. It allows turning on/off, changing color and white temperature, increasing and setting brightness percentages.
In the node ‘Echo Device’, you must set the name of your devices as they show in your Alexa app
for the Action Node, read the documentation
It works really nice!
Final flow: https://pastebin.ubuntu.com/p/3xb8VZsKtQ/