Node Red Room aware Alexa voice commands

A straightforward workaround is to create a routine in Alexa app for that sentence. In the action section put your device ‘Fan’ to on and brightness 2. Not ideal but it’ll do it for now. In spanish it works great

In spanish it does work saying “Set the fan to medium level”. Does Alexa complain when you try that request or is it just that it doesn’t set the fan to medium?

Do increase/decrease work?

I thought about that, but I have have 3 fans in the house and I haven’t figured how to get Alexa to control them based on Room Aware until I found this flow…If I say Alexa set fan to “medium” it will trigger all three fans in the house.

I was looking at this post: Approaches to room aware voice commands for Alexa with Node-Red

and it looks like he uses NR to break out the voice command for medium and route it correctly. Could that be incorporated into this sequence?

If you check the cons, they say alexa complains… she will set the fan to the appropiate level but she’ll complain that fan cannot do that or something of the sort. If you do what I told you, create a routine, the apropiate fan will turn on and Alexa won’t complain

The routine must be if I say ‘set the fan to medium’ then the virtual device fan you created (not the actual fan) turns on and level 2. I have couple of routines like this and they still function according to the room, just try it out

Btw, put very different names to your other fans to avoid confusions to alexa. I mean, the actual fans, if they appear in the Alexa app, rename them to something very different.

Hmmmm…I’m sitting here trying to think this through…If I create a virtual fan call: “SpeedFan1” and create a routine in Alexa That says: “Alexa, set Fan to Medium” to set the fan speed to 2 on “SpeedFan1"”…Won’t that same routine trigger from any Alexa device in the house instead of that particular room like the NR flow?

I know this will work for that fan, but I’m confused if I create another routine for another fan “SpeedFan2” how Alexa will know the difference based on Room aware?

Wait, don’t create anything, you already have everything you need, just read carefully. You already have two created devices right? or one, I dunno.

The fan

right? Create a routine in the Alexa app that, when you say ‘Alexa, set fan to medium’ then in the action section, either the device ‘Fan’ or ‘The fan’, which you have already created, turns on at brightness 2%.

You needn’t create no more devices, delete those

Is pretty simple, you are overdoing it. Just follow what I say and see what happens

By changing the device ‘Fan’ state in the Alexa app, you’re actually triggering the NR flow, which takes care of the room selection

Ahhhhhh I see what you’re doing!! Ok, I’m on board now. Let me test it out when I get home and I’ll report back…If this works, that’s pretty genius!

Well that didn’t deliver the expected results…I added a device call “The Fan” and discovered it. However it really delivered mixed results. Before adding the new device the flow seemed to work pretty well. After adding it it seemed to deliver a lot of false positives. I would acknowledge turning on the device yet nothing happened. I never could get the “medium” routine working correctly…Alexa kept responding with: “I don’t know how to set fan to that setting”

Maybe it just wasn’t meant to be…lol

You’re doing something wrong… Have you added the device ‘the fan’ to the NR flow?.

To put things more simply, just remove the device ‘The fan’ and do what I told you with the device ‘Fan’ you already had. It’s either create both and add them both to NR, or just use the one you had.

If you set the routine ‘Set the fan to medium’ and ask alexa exactly that, it is impossible that she responds that.

I have it working that way with zero problems


Try triggering the scene trough the Alexa app first instead that using the voice

If for some reasom it doesn’t work, remember you can still use set fan to 1, 2, 3 which should work flawlessly

Maybe i added the new device “The Fan” in the wrong spot of the flow?


it’s on the right spot. And make sure you have no more devices called fan in your alexa app. :crossed_fingers:

@mboarman to troubleshoot this, Make sure Auto acknowledge is enabled in your two NR fan devices:

After that, I’d create two routines. One with ‘set fan to medium’ and another with ‘set the fan to medium’. If she still complains, I’d go to the voice history from your alexa app to check what the hell the missis is understanding when you make the request. If it’s different that the two created routines, add that sentence as a routine as well. If it still isn’t working, I’d give it a few hours, sometines routines need to settle. If after a few hours it’s still isn’t responding… I’ve run out of ideas

@obaldius excelent work! can you share some example for heat/climate?

Thermostat example:

Full flow:

[{"id":"5ff3cc29.ad7c04","type":"comment","z":"5701b8c7.b4f238","name":"Thermostat example","info":"","x":150,"y":260,"wires":[]},{"id":"ae3dd514.a53828","type":"switch","z":"5701b8c7.b4f238","name":"Echo Device?","property":"echodevice","propertyType":"flow","rules":[{"t":"eq","v":"First Echo Device","vt":"str"},{"t":"eq","v":"Second Echo Device","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":600,"y":380,"wires":[["53c34aa7.c4ca24"],["c146961e.7d4a48"]]},{"id":"35d04e69.baf142","type":"switch","z":"5701b8c7.b4f238","name":"Action?","property":"command","propertyType":"msg","rules":[{"t":"eq","v":"TurnOnRequest","vt":"str"},{"t":"eq","v":"TurnOffRequest","vt":"str"},{"t":"eq","v":"SetTargetTemperatureRequest","vt":"str"},{"t":"eq","v":"IncrementTargetTemperatureRequest","vt":"str"},{"t":"eq","v":"DecrementTargetTemperatureRequest","vt":"str"},{"t":"eq","v":"GetTemperatureReadingRequest","vt":"str"}],"checkall":"true","repair":false,"outputs":6,"x":880,"y":380,"wires":[["40f34c09.465034"],["71f4af2b.79088"],["54ae0cad.eedd44"],["76a4c33a.7bad1c"],["76a4c33a.7bad1c"],["e7562823.136188"]],"outputLabels":["On","Off","Set","Increment","Decrement","Get temperature"]},{"id":"53c34aa7.c4ca24","type":"change","z":"5701b8c7.b4f238","name":"","rules":[{"t":"set","p":"entity_id","pt":"msg","to":"Climate device entity related to first Echo device","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":735,"y":360,"wires":[["35d04e69.baf142"]],"l":false},{"id":"c146961e.7d4a48","type":"change","z":"5701b8c7.b4f238","name":"","rules":[{"t":"set","p":"entity_id","pt":"msg","to":"Climate device entity related to second Echo device","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":735,"y":400,"wires":[["35d04e69.baf142"]],"l":false},{"id":"38dae152.1018ce","type":"ha-wait-until","z":"5701b8c7.b4f238","name":"","server":"9405c3fe.d0a6c","outputs":2,"entityId":"input_boolean.your_input","entityIdFilterType":"exact","property":"state","comparator":"is","value":"on","valueType":"str","timeout":"7","timeoutType":"num","timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":235,"y":380,"wires":[["9f8c8be7.b582c8","3204e684.0d4daa"],[]],"l":false},{"id":"9f8c8be7.b582c8","type":"api-call-service","z":"5701b8c7.b4f238","name":"input off","server":"9405c3fe.d0a6c","version":1,"debugenabled":false,"service_domain":"homeassistant","service":"turn_off","entityId":"input_boolean.your_input","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":320,"y":320,"wires":[[]]},{"id":"40f34c09.465034","type":"api-call-service","z":"5701b8c7.b4f238","name":"On","server":"9405c3fe.d0a6c","version":1,"debugenabled":false,"service_domain":"climate","service":"turn_on","entityId":"{{entity_id}}","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1190,"y":280,"wires":[["191b3b50.76cf05"]]},{"id":"71f4af2b.79088","type":"api-call-service","z":"5701b8c7.b4f238","name":"Off","server":"9405c3fe.d0a6c","version":1,"debugenabled":false,"service_domain":"climate","service":"turn_off","entityId":"{{entity_id}}","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1190,"y":320,"wires":[["191b3b50.76cf05"]]},{"id":"54ae0cad.eedd44","type":"api-call-service","z":"5701b8c7.b4f238","name":"Set temp","server":"9405c3fe.d0a6c","version":1,"debugenabled":false,"service_domain":"climate","service":"set_temperature","entityId":"{{entity_id}}","data":"{\"temperature\":\"{{payload}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1200,"y":360,"wires":[["795bd974.53ec38"]]},{"id":"df8aff82.fcdbb","type":"alexa-home-resp","z":"5701b8c7.b4f238","x":1500,"y":440,"wires":[]},{"id":"191b3b50.76cf05","type":"change","z":"5701b8c7.b4f238","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1295,"y":300,"wires":[["df8aff82.fcdbb"]],"l":false},{"id":"795bd974.53ec38","type":"function","z":"5701b8c7.b4f238","name":"","func":"if (msg.payload < msg.min || msg.payload > msg.max) {\n    var range = {\n        min: msg.min,\n        max: msg.max\n    }\n    msg.payload = false;\n    msg.extra = range;\n    \n\n} else {\n    msg.extra = {\n        targetTemperature: {\n            value: msg.payload\n        }\n    };\n    msg.payload = true;\n}\n    \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1295,"y":360,"wires":[["df8aff82.fcdbb"]],"l":false},{"id":"76a4c33a.7bad1c","type":"api-current-state","z":"5701b8c7.b4f238","name":"","server":"9405c3fe.d0a6c","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"{{entity_id}}","state_type":"str","state_location":"climate","override_payload":"msg","entity_location":"climateData","override_data":"msg","blockInputOverrides":false,"x":1035,"y":400,"wires":[["5c880bc6.0dd234"]],"l":false},{"id":"5c880bc6.0dd234","type":"change","z":"5701b8c7.b4f238","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number(msg.climateData.attributes.temperature) + $number(msg.payload)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1095,"y":400,"wires":[["54ae0cad.eedd44"]],"l":false},{"id":"27886eb0.d6df82","type":"function","z":"5701b8c7.b4f238","name":"","func":"msg.extra = {\n    \"temperatureReading\": {\n        \"value\": msg.climateData.attributes.current_temperature\n    },\n    \"applianceResponseTimestamp\": new Date().toISOString()\n};\nmsg.payload = true;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1095,"y":440,"wires":[["df8aff82.fcdbb"]],"l":false},{"id":"e7562823.136188","type":"api-current-state","z":"5701b8c7.b4f238","name":"","server":"9405c3fe.d0a6c","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"{{entity_id}}","state_type":"str","state_location":"climate","override_payload":"msg","entity_location":"climateData","override_data":"msg","blockInputOverrides":false,"x":1035,"y":440,"wires":[["27886eb0.d6df82"]],"l":false},{"id":"3204e684.0d4daa","type":"change","z":"5701b8c7.b4f238","name":"min & max","rules":[{"t":"set","p":"min","pt":"msg","to":"5.0","tot":"num"},{"t":"set","p":"max","pt":"msg","to":"25.0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":380,"wires":[["ae3dd514.a53828"]]},{"id":"9405c3fe.d0a6c","type":"server","name":"Home Assistant","addon":true}]

Disable “Auto Acknowledge” from your device node.
Fill input nodes with your input.
Fill “min & max” node with your device’s minimum and maximum working temperatures.
Fill “Echo Device?” node with your Echo devices
Fill the subsequent nodes with your entities related to each Echo device

perfect! thank you!

I need your support here too.
I’ve been trying to set up an “Alexa room recognition” for many months. Again and again the zeal grabs me and I sit down again.
But I just can’t get any further… no matter which device I address: “Alexa, turn on the light” forwards the “switch-node (echo device?)” only to “otherwise”. But there is no path going away from any node of the individual echoes.

I don’t even know where to start explaining what I have?!?

What is really important is the first part

And setting both Input on? and input off nodes in every flow to make sure your flow is picking the right device. The rest of the code is integration dependant. That particular example you are using should work with and only with node-red-contrib-alexa-home-skill, not any other, and I haven’t used that for quite a while so who knows. If you wish to use some other integration you should build your own code yourself.

I did this one also using node-red-contrib-amazon-echo which you might find easier to set up, but don’t try to mix this code with any other integration because it won’t work.

Hope you can get this sorted out

oh hy! Thanksfor your quick answer!!

**First section, ‘Setting currently listening device’:** - I have that too of course :wink:
also with a lot of debug nodes ^^
Isn’t it usually the case that as soon as I give Alexa a command, something should be displayed here somewhere? So in one of the debug nodes?

in your first flow, the “input_boolean.alexa_helper” should actually turn_on.
but he doesn’t do it here.

but in your “main flow” you can see that it “checks” whether the helper is on.

Initially, I tried to ONLY use the “node-red-contrib-alexa-home-skill” here as well. But I’ve tried many different options. (As I said, I’ve been trying for a long time ^^)

Unfortunately, I can’t get any further with the “switch node” (echo device?)… here the node always assumes “otherwise”.

I’ll try again :wink:

Are you using cakebakeds or applestrudel’s fork? or the original node-red-contrib-alexa-remote2? cakebackeds hasn’t been maintained for months now… the original node-red-contrib-alexa-remote2 has been dead for almost two years now. The only reliable one is node-red-contrib-alexa-remote2-applestrudel.