Approaches to room aware voice commands for Alexa with Node-Red

I found a way to get this working with the sentences: “Set the fan to high”, “Set fan to level medium”, “turn on fan to low”, “Turn fan to 1”, “set the fan to 2”, “Turn fan to level 3”, “Turn fan on to level 2”, “turn the fan on to 1”, “Put fan at 3” etc etc etc… 1 low, 2 medium, 3 high. It should also allow saying set to minimun, maximum, middle, low, medium, high, 1, 2, 3, spelling level or not… pretty flexible I believe, let me know please, I can’t test it out in english.

Alexa won’t complain, at least in Spanish, and you can set colours, white temperatures, increse/drecrease and set%'s of brightness/speed and turn on/off of course

Catch the first section from here:

Get the Fan example from here:

FWIW, this ability was described several posts ago. A function node converts text to numbers. For example, the ‘twenty-five’ in the command ‘Set light to twenty five’ is converted to 25. It uses a map so it’s trivial to add other phrases like high, medium, low or pretty much anything like super bright, extra dim, night time, etc.

Within the received phrase, Alexa reports the brightness level using words , not numbers. The first function node (“Parse”) converts the words to numbers (because the command to set a light’s level requires a numeric value). The conversion is performed using a map. It’s possible to enhance the map by adding words like “low”, “medium”, and “high”, or even “night time”, with corresponding numeric values. Otherwise, there’s no need for the end-user to change anything within the first function node.

oh ok sorry, every time I come across a function node I just don’t read it :smiley:

and when you say, set the light night time, doesn’t alexa complain? Isn’t there any situation where alexa complains?

Been playing around with this flow as well as another one in hope of creating a room aware echo setup…While setting this up I ran into a snag while trying to set my Fan percentage levels in their respective nodes. I use a Homeseer FC200+ switch and although the Alexa app shows the 4 stages of power levels:
off
1
2
3
NR won’t let me add a percentage?! Any thoughts?

Imgur: The magic of the Internet is how I approach it. I also have two Alexa accounts combined, but because they share the same household, it ends up in duplicate messages, unless you use something like dropping a message.

[{"id":"7d72b9e8.14de78","type":"tab","label":"Drop Message","disabled":false,"info":""},{"id":"f073080b.a7cae","type":"change","z":"7d72b9e8.14de78","name":"Strip Wake Word","rules":[{"t":"change","p":"payload.description.summary","pt":"msg","from":"^(alexa )?","fromt":"re","to":"","tot":"str"},{"t":"change","p":"payload.description.summary","pt":"msg","from":"^(amazon )?","fromt":"str","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":945,"y":199,"wires":[[]]},{"id":"7cde2905.64fb2","type":"delay","z":"7d72b9e8.14de78","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"2","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":745,"y":139,"wires":[["f073080b.a7cae"]]},{"id":"940bae50.427d4","type":"switch","z":"7d72b9e8.14de78","name":"Alexa hears","property":"payload.description.summary","propertyType":"msg","rules":[{"t":"regex","v":"alexa|amazon","vt":"str","case":true},{"t":"regex","v":"^(?:(?!amazon|alexa).)+$","vt":"str","case":true}],"checkall":"false","repair":false,"outputs":2,"x":525,"y":179,"wires":[["7cde2905.64fb2"],["9d206b72.b9ddd"]],"outputLabels":["Turn on",""]},{"id":"9d206b72.b9ddd","type":"delay","z":"7d72b9e8.14de78","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"2","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":745,"y":239,"wires":[["f073080b.a7cae"]]}]

Regarding this, have you tried creating two HUE devices called “Fan to medium” and “Fan on medium”? I believe Alexa would take care of the rest… articles or not, whichever verb… As you said, even one device called “Fan medium” would do it. It might work, I can’t test it out though

As I said here: Approaches to room aware voice commands for Alexa with Node-Red - #12 by quadhammer if you use a different skill to emulate the fan properly, you don’t need to mess around with fake routines to avoid the error messages.

1 Like

Didn’t read that, sorry

1 Like

I have a similar reaction when I see a flow with many duplicated nodes.

The reason I used function nodes is because it allows me to do more with less. Those five nodes handle 8 devices (4 lights and 4 fans) in 4 rooms. It supports brightness commands as well as custom phrases and can easily handle more devices.

Without question, Alexa will complain if the phrase contains words it doesn’t support. For example, ‘Set light to medium’ isn’t understood and will result in a reply along the lines of “I don’t know how to do that.”

The solution is explained in the first post:

I have created a routine that responds “OK” when it hears the phrase “Set light to medium”. In addition, I added a key to the dictionary in the Parse node to identify medium as a value of 50:

Screenshot from 2021-01-22 08-52-26

That’s all there is to it. Now when I say “Alexa, set light to medium”, in any of the 4 rooms, Alexa responds “OK” and the light in that room is set to 50% brightness.

1 Like

Yeah, don’t get me wrong, I don’t read function nodes because I don’t still understand them. Hopefully someday I’ll be able to use them. Good job you all did here.

Huge thanks for this, really helped get room aware stuff working that I’ve been wanting to do for years with Alexa. Thought I’d share some small tweaks I made to the original approach to cut down on some repetition. Main changes from the original posted at top of the thread:

  • Check the domain is “HomeAutomation” which filters out extra calls from other Echos in the area
  • Cleared the data payload to avoid some down flow errors
  • Set actions in the msg body earlier in the flow so there isn’t duplication
  • Route based on device name as opposed to serial number
  • Added replies for devices where the command doesn’t apply

Few other notes:

  • 586837r doesn’t seem to be maintaining node-red-contrib-alexa-remote2 anymore, I strongly suggest using the node-red-contrib-alexa-cakebaked fork instead
  • This flow doesn’t actually create any of the devices in Alexa, you’ll need to create dummy devices through one of the many other means (for example I have a device named “fan” that doesn’t actually control anything)

Here is my config that controls a series of Fans, TVs (including inputs for TiVo, Shield, & Games), and Blinds.

[{"id":"35964044.fcf53","type":"tab","label":"Contextual Alexa Routines","disabled":false,"info":""},{"id":"35bdb0e0.53f29","type":"alexa-remote-event","z":"35964044.fcf53","name":"","account":"bdd909b1.9333d8","event":"ws-device-activity","x":170,"y":460,"wires":[["a35c1f26.931b78"]]},{"id":"545ebb02.da3e74","type":"switch","z":"35964044.fcf53","name":"Contextual Route Fan","property":"payload.description.summary","propertyType":"msg","rules":[{"t":"regex","v":"turn off (the )?fan","vt":"str","case":false},{"t":"regex","v":"turn (the )?fan off","vt":"str","case":false},{"t":"regex","v":"(set|turn) (the )?fan ((on|to) )?low","vt":"str","case":false},{"t":"regex","v":"turn on (the )?fan","vt":"str","case":false},{"t":"regex","v":"turn (the )?fan on","vt":"str","case":false},{"t":"regex","v":"(set|turn) (the )?fan ((on|to) )?medium","vt":"str","case":false},{"t":"regex","v":"(set|turn) (the )?fan ((on|to) )?high","vt":"str","case":false}],"checkall":"true","repair":false,"outputs":7,"x":240,"y":700,"wires":[["a5e841f2.f27e3"],["a5e841f2.f27e3"],["ccb08023.484cf"],["1c9d257.9d0bedb"],["1c9d257.9d0bedb"],["1c9d257.9d0bedb"],["71a0931e.3c22dc"]],"outputLabels":["Turn off","Turn off","Set low","Turn on","Turn on","Set medium","Set high"]},{"id":"a26a3b25.554268","type":"change","z":"35964044.fcf53","name":"Strip Wake Word","rules":[{"t":"change","p":"payload.description.summary","pt":"msg","from":"^(alexa )?","fromt":"re","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":460,"wires":[["b85b7c8f.607a2"]]},{"id":"5a07462b.4472c","type":"switch","z":"35964044.fcf53","name":"Route on Echo","property":"payload.name","propertyType":"msg","rules":[{"t":"eq","v":"Basement","vt":"str"},{"t":"eq","v":"Bathroom","vt":"str"},{"t":"eq","v":"Cai","vt":"str"},{"t":"eq","v":"Dining Room","vt":"str"},{"t":"eq","v":"Family Room","vt":"str"},{"t":"eq","v":"GR Charcoal","vt":"str"},{"t":"eq","v":"GR Gray","vt":"str"},{"t":"eq","v":"Garage","vt":"str"},{"t":"eq","v":"Guestroom","vt":"str"},{"t":"eq","v":"Immi","vt":"str"},{"t":"eq","v":"Kitchen","vt":"str"},{"t":"eq","v":"Living Room","vt":"str"},{"t":"eq","v":"Loft","vt":"str"},{"t":"eq","v":"Master Bedroom","vt":"str"},{"t":"eq","v":"Office","vt":"str"},{"t":"eq","v":"Storage Room","vt":"str"}],"checkall":"false","repair":false,"outputs":16,"x":820,"y":700,"wires":[["543e5a18.1f3c7c"],["93c46a5.7c6d698"],["db111ac0.9fbb98"],["543e5a18.1f3c7c"],["543e5a18.1f3c7c"],["543e5a18.1f3c7c"],["543e5a18.1f3c7c"],["543e5a18.1f3c7c"],["15edaef8.5de451"],["cd349e29.dc0088"],["543e5a18.1f3c7c"],["543e5a18.1f3c7c"],["f0e77184.cf113"],["6c0dbee5.0fb8f8"],["3e1e5997.8e223e"],["543e5a18.1f3c7c"]]},{"id":"21d6328e.003396","type":"api-call-service","z":"35964044.fcf53","name":"Bathroom Fan","server":"3ddda582.b891ea","version":1,"debugenabled":false,"service_domain":"switch","service":"{{ my_service }}","entityId":"switch.master_bath_fan_switch","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1220,"y":460,"wires":[[]]},{"id":"db111ac0.9fbb98","type":"api-call-service","z":"35964044.fcf53","name":"Cais Fan","server":"3ddda582.b891ea","version":1,"debugenabled":false,"service_domain":"fan","service":"{{ my_service }}","entityId":"fan.v_cai_fan","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1040,"y":520,"wires":[[]]},{"id":"6c0dbee5.0fb8f8","type":"api-call-service","z":"35964044.fcf53","name":"Master Bedroom Fan","server":"3ddda582.b891ea","version":1,"debugenabled":false,"service_domain":"fan","service":"{{ my_service }}","entityId":"fan.v_master_fan","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1080,"y":820,"wires":[[]]},{"id":"f0e77184.cf113","type":"api-call-service","z":"35964044.fcf53","name":"Loft Fan","server":"3ddda582.b891ea","version":1,"debugenabled":false,"service_domain":"fan","service":"{{ my_service }}","entityId":"fan.v_loft_fan","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1040,"y":760,"wires":[[]]},{"id":"cd349e29.dc0088","type":"api-call-service","z":"35964044.fcf53","name":"Immis Fan","server":"3ddda582.b891ea","version":1,"debugenabled":true,"service_domain":"fan","service":"{{ my_service }}","entityId":"fan.v_immi_fan","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1050,"y":640,"wires":[[]]},{"id":"15edaef8.5de451","type":"api-call-service","z":"35964044.fcf53","name":"Guest Room Fan","server":"3ddda582.b891ea","version":1,"debugenabled":false,"service_domain":"fan","service":"{{ my_service }}","entityId":"fan.v_guest_room_fan","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1070,"y":580,"wires":[[]]},{"id":"3e1e5997.8e223e","type":"api-call-service","z":"35964044.fcf53","name":"Office Fan","server":"3ddda582.b891ea","version":1,"debugenabled":false,"service_domain":"fan","service":"{{ my_service }}","entityId":"fan.v_office_fan","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1050,"y":880,"wires":[[]]},{"id":"b85b7c8f.607a2","type":"change","z":"35964044.fcf53","name":"Clear Data","rules":[{"t":"delete","p":"payload.data","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":460,"wires":[["64f34a83.dfdb14"]]},{"id":"a35c1f26.931b78","type":"switch","z":"35964044.fcf53","name":"Check for Domain is HA","property":"payload.data.domain","propertyType":"msg","rules":[{"t":"eq","v":"HomeAutomation","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":390,"y":460,"wires":[["a26a3b25.554268"],[]]},{"id":"a5e841f2.f27e3","type":"change","z":"35964044.fcf53","name":"Set Service Off","rules":[{"t":"set","p":"my_service","pt":"msg","to":"turn_off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":640,"wires":[["5a07462b.4472c"]]},{"id":"ccb08023.484cf","type":"change","z":"35964044.fcf53","name":"Set Service Low","rules":[{"t":"set","p":"my_service","pt":"msg","to":"set_percentage","tot":"str"},{"t":"set","p":"payload.data","pt":"msg","to":"{\"percentage\":\"33\"}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":680,"wires":[["5a07462b.4472c"]]},{"id":"1c9d257.9d0bedb","type":"change","z":"35964044.fcf53","name":"Set Service Medium","rules":[{"t":"set","p":"my_service","pt":"msg","to":"set_percentage","tot":"str"},{"t":"set","p":"payload.data","pt":"msg","to":"{\"percentage\":\"66\"}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":720,"wires":[["5a07462b.4472c"]]},{"id":"71a0931e.3c22dc","type":"change","z":"35964044.fcf53","name":"Set Service High","rules":[{"t":"set","p":"my_service","pt":"msg","to":"set_percentage","tot":"str"},{"t":"set","p":"payload.data","pt":"msg","to":"{\"percentage\":\"100\"}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":760,"wires":[["5a07462b.4472c"]]},{"id":"93c46a5.7c6d698","type":"change","z":"35964044.fcf53","name":"Fix Service","rules":[{"t":"change","p":"my_service","pt":"msg","from":"set_speed","fromt":"str","to":"turn_on","tot":"str"},{"t":"delete","p":"payload.data","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":460,"wires":[["21d6328e.003396"]]},{"id":"64f34a83.dfdb14","type":"link out","z":"35964044.fcf53","name":"","links":["cc31fdeb.12866","aae19fb5.03a968","752ea04e.199d","8a0ffdcc.f54ff"],"x":895,"y":460,"wires":[]},{"id":"cc31fdeb.12866","type":"link in","z":"35964044.fcf53","name":"","links":["64f34a83.dfdb14"],"x":95,"y":700,"wires":[["545ebb02.da3e74"]]},{"id":"9e64cd95.94afd8","type":"switch","z":"35964044.fcf53","name":"Contextual Route TV","property":"payload.description.summary","propertyType":"msg","rules":[{"t":"regex","v":"turn off (the )?tv","vt":"str","case":false},{"t":"regex","v":"turn (the )?tv off","vt":"str","case":false},{"t":"regex","v":"turn on (the )?tv","vt":"str","case":false},{"t":"regex","v":"turn (the )?tv on","vt":"str","case":false},{"t":"regex","v":"turn on (the )?shield","vt":"str","case":false},{"t":"regex","v":"turn (the )?shield on","vt":"str","case":false},{"t":"regex","v":"turn on (the )?tivo","vt":"str","case":false},{"t":"regex","v":"turn (the )?tivo on","vt":"str","case":false},{"t":"regex","v":"turn on (the )?games","vt":"str","case":false},{"t":"regex","v":"turn (the )?games on","vt":"str","case":false}],"checkall":"true","repair":false,"outputs":10,"x":240,"y":980,"wires":[["f0064aef.d42ea8"],["f0064aef.d42ea8"],["50771b1a.865df4"],["50771b1a.865df4"],["50771b1a.865df4"],["50771b1a.865df4"],["53f2024b.1785b4"],["53f2024b.1785b4"],["7213a01d.4b8a"],["7213a01d.4b8a"]],"outputLabels":["Turn off","Turn off","Turn on","Turn on","","","","","",""]},{"id":"aae19fb5.03a968","type":"link in","z":"35964044.fcf53","name":"","links":["64f34a83.dfdb14"],"x":95,"y":980,"wires":[["9e64cd95.94afd8"]]},{"id":"c932d4e.8cf19a8","type":"switch","z":"35964044.fcf53","name":"Route on Echo","property":"payload.name","propertyType":"msg","rules":[{"t":"eq","v":"Basement","vt":"str"},{"t":"eq","v":"Bathroom","vt":"str"},{"t":"eq","v":"Cai","vt":"str"},{"t":"eq","v":"Dining Room","vt":"str"},{"t":"eq","v":"Family Room","vt":"str"},{"t":"eq","v":"GR Charcoal","vt":"str"},{"t":"eq","v":"GR Gray","vt":"str"},{"t":"eq","v":"Garage","vt":"str"},{"t":"eq","v":"Guestroom","vt":"str"},{"t":"eq","v":"Immi","vt":"str"},{"t":"eq","v":"Kitchen","vt":"str"},{"t":"eq","v":"Living Room","vt":"str"},{"t":"eq","v":"Loft","vt":"str"},{"t":"eq","v":"Master Bedroom","vt":"str"},{"t":"eq","v":"Office","vt":"str"},{"t":"eq","v":"Storage Room","vt":"str"}],"checkall":"false","repair":false,"outputs":16,"x":720,"y":1000,"wires":[["8ee233f8.3f8ba"],["8ee233f8.3f8ba"],["8ee233f8.3f8ba"],["1e5ddcfb.b25833"],["1e5ddcfb.b25833"],["8ee233f8.3f8ba"],["8ee233f8.3f8ba"],["8ee233f8.3f8ba"],[],["8ee233f8.3f8ba"],["1e5ddcfb.b25833"],["1e5ddcfb.b25833"],["8ee233f8.3f8ba"],["9e17091e.f6885"],["9c4dad67.291ca"],["8ee233f8.3f8ba"]]},{"id":"1e5ddcfb.b25833","type":"api-call-service","z":"35964044.fcf53","name":"Family Room TV","server":"3ddda582.b891ea","version":1,"debugenabled":true,"service_domain":"remote","service":"{{ my_service }}","entityId":"remote.family_room_hub","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":960,"y":940,"wires":[[]]},{"id":"f0064aef.d42ea8","type":"change","z":"35964044.fcf53","name":"Set Service Off","rules":[{"t":"set","p":"my_service","pt":"msg","to":"turn_off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":920,"wires":[["c932d4e.8cf19a8"]]},{"id":"9e17091e.f6885","type":"api-call-service","z":"35964044.fcf53","name":"Master Bedroom TV","server":"3ddda582.b891ea","version":1,"debugenabled":true,"service_domain":"remote","service":"{{ my_service }}","entityId":"remote.master_bedroom_hub","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":980,"y":1060,"wires":[[]]},{"id":"9c4dad67.291ca","type":"api-call-service","z":"35964044.fcf53","name":"Office TV","server":"3ddda582.b891ea","version":1,"debugenabled":false,"service_domain":"remote","service":"{{ my_service }}","entityId":"remote.office_hub","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":940,"y":1120,"wires":[[]]},{"id":"50771b1a.865df4","type":"change","z":"35964044.fcf53","name":"Set Service Shield","rules":[{"t":"set","p":"my_service","pt":"msg","to":"turn_on","tot":"str"},{"t":"set","p":"payload.data","pt":"msg","to":"{\"activity\":\"Shield\"}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":960,"wires":[["c932d4e.8cf19a8"]]},{"id":"53f2024b.1785b4","type":"change","z":"35964044.fcf53","name":"Set Service Tivo","rules":[{"t":"set","p":"my_service","pt":"msg","to":"turn_on","tot":"str"},{"t":"set","p":"payload.data","pt":"msg","to":"{\"activity\":\"Live TV - TiVo\"}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":1000,"wires":[["c932d4e.8cf19a8"]]},{"id":"7213a01d.4b8a","type":"change","z":"35964044.fcf53","name":"Set Service Games","rules":[{"t":"set","p":"my_service","pt":"msg","to":"turn_on","tot":"str"},{"t":"set","p":"payload.data","pt":"msg","to":"{\"activity\":\"Games\"}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":1040,"wires":[["c932d4e.8cf19a8"]]},{"id":"8ee233f8.3f8ba","type":"alexa-remote-routine","z":"35964044.fcf53","name":"No TV Here","account":"bdd909b1.9333d8","routineNode":{"type":"speak","payload":{"type":"regular","text":{"type":"str","value":"You know there is no TV in this room"},"devices":{"type":"msg","value":"payload.name"}}},"x":950,"y":1000,"wires":[[]]},{"id":"543e5a18.1f3c7c","type":"alexa-remote-routine","z":"35964044.fcf53","name":"No Fan Here","account":"bdd909b1.9333d8","routineNode":{"type":"speak","payload":{"type":"regular","text":{"type":"str","value":"You know perfectly well that there is no fan in this room"},"devices":{"type":"msg","value":"payload.name"}}},"x":1050,"y":700,"wires":[[]]},{"id":"8a0ffdcc.f54ff","type":"link in","z":"35964044.fcf53","name":"","links":["64f34a83.dfdb14"],"x":95,"y":1320,"wires":[["1ee69e09.660c6a"]]},{"id":"544b1da8.3708c4","type":"switch","z":"35964044.fcf53","name":"Route on Echo","property":"payload.name","propertyType":"msg","rules":[{"t":"eq","v":"Basement","vt":"str"},{"t":"eq","v":"Bathroom","vt":"str"},{"t":"eq","v":"Cai","vt":"str"},{"t":"eq","v":"Dining Room","vt":"str"},{"t":"eq","v":"Family Room","vt":"str"},{"t":"eq","v":"GR Charcoal","vt":"str"},{"t":"eq","v":"GR Gray","vt":"str"},{"t":"eq","v":"Garage","vt":"str"},{"t":"eq","v":"Guestroom","vt":"str"},{"t":"eq","v":"Immi","vt":"str"},{"t":"eq","v":"Kitchen","vt":"str"},{"t":"eq","v":"Living Room","vt":"str"},{"t":"eq","v":"Loft","vt":"str"},{"t":"eq","v":"Master Bedroom","vt":"str"},{"t":"eq","v":"Office","vt":"str"},{"t":"eq","v":"Storage Room","vt":"str"}],"checkall":"false","repair":false,"outputs":16,"x":720,"y":1320,"wires":[["ba1670d5.0887d8"],["ba1670d5.0887d8"],["33ad898c.47a7e6"],["ba1670d5.0887d8"],["ba1670d5.0887d8"],["ef14fb09.3303b"],["ef14fb09.3303b"],["ba1670d5.0887d8"],["ba1670d5.0887d8"],["ba1670d5.0887d8"],["ba1670d5.0887d8"],["ba1670d5.0887d8"],["ba1670d5.0887d8"],["ba1670d5.0887d8"],["ba1670d5.0887d8"],["ba1670d5.0887d8"]]},{"id":"ef14fb09.3303b","type":"api-call-service","z":"35964044.fcf53","name":"Game Room Blinds","server":"3ddda582.b891ea","version":1,"debugenabled":true,"service_domain":"cover","service":"{{ my_service }}","entityId":"cover.game_room_blind","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":950,"y":1320,"wires":[[]]},{"id":"ba1670d5.0887d8","type":"alexa-remote-routine","z":"35964044.fcf53","name":"No Blinds Here","account":"bdd909b1.9333d8","routineNode":{"type":"speak","payload":{"type":"regular","text":{"type":"str","value":"You know there are no blinds in this room"},"devices":{"type":"msg","value":"payload.name"}}},"x":940,"y":1380,"wires":[[]]},{"id":"1ee69e09.660c6a","type":"switch","z":"35964044.fcf53","name":"Contextual Route Blinds","property":"payload.description.summary","propertyType":"msg","rules":[{"t":"regex","v":"open (the )?blind(s)?","vt":"str","case":false},{"t":"regex","v":"close (the )?blind(s)?","vt":"str","case":false}],"checkall":"true","repair":false,"outputs":2,"x":250,"y":1320,"wires":[["33a52ec9.d6846a"],["63fb65aa.39d62c"]],"outputLabels":["Open","Close"]},{"id":"33a52ec9.d6846a","type":"change","z":"35964044.fcf53","name":"Set Service Open","rules":[{"t":"set","p":"my_service","pt":"msg","to":"open_cover","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":1300,"wires":[["544b1da8.3708c4"]]},{"id":"63fb65aa.39d62c","type":"change","z":"35964044.fcf53","name":"Set Service Close","rules":[{"t":"set","p":"my_service","pt":"msg","to":"close_cover","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":1340,"wires":[["544b1da8.3708c4"]]},{"id":"33ad898c.47a7e6","type":"api-call-service","z":"35964044.fcf53","name":"Cais Blinds","server":"3ddda582.b891ea","version":1,"debugenabled":true,"service_domain":"cover","service":"{{ my_service }}","entityId":"cover.cais_blinds","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":930,"y":1260,"wires":[[]]},{"id":"bdd909b1.9333d8","type":"alexa-remote-account","name":"Alexa Account","authMethod":"proxy","proxyOwnIp":"192.168.0.5","proxyPort":"3456","cookieFile":"/data/alexa-auth-file","refreshInterval":"3","alexaServiceHost":"pitangui.amazon.com","amazonPage":"amazon.com","acceptLanguage":"en-US","userAgent":"","useWsMqtt":"on","autoInit":"on"},{"id":"3ddda582.b891ea","type":"server","name":"Home Assistant","legacy":false,"addon":false,"rejectUnauthorizedCerts":false,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

I’m impressed that you got that one to work. I had to switch from 586837r’s no-longer functional version to cakebaked’s and it failed for me. I posted a detailed Issue but there was no support available from anyone. The node connects but requests ultimately end in “smarthome entity not found” or “unexpected response layout”. Ultimately I closed the Issue in cakebaked’s repo (due to zero response) and abandoned my long-working but now inoperative flow.

I had it running oriongally on 586837r’s for a while but then it stopped and I had to switch over to cakebaked’s version. I had to tweak a few things in my flow as the data coming in was slightly different but it’s working fairly consistently.

When you switched over did you export and delete all your flows prior to removing and installing the new version?

Found and took a look at your GitHub issue. You’re using the component differently than I am. I’m only using the plugin for input into my flow (and to announce failure), the actual device commands I’m routing through Home Assistant instead of trying to send them back to Alexa.

No because it was ultimately determined(by others) that it’s unnecessary and amounts to nothing more than hocus-pocus. I did what others did and that’s remove all nodes in the flow (just two) that referred to 586837r’s version then replace them with cakebaked’s version (after having completely removed all traces of 586837r’s nodes from Node-Red).

The fact is it works partially. The “On Device Activity” node connects, listens for requests, receives them, passes them to the balance of the flow where they are successfully processed . Where it fails is in the final “SmartHome Action” node seen below. The error message suggests that the data submitted by the node is not in a valid format.

I may try that but my concern is that Alexa won’t get feedback to the command it just submitted and will result in “I’m sorry, something has gone wrong.” However, maybe I should try it first and see what happens.

Yesterday, I discovered that you can create a Alexa Skill Blueprint Custom Q&A and replace all of the dummy routines into the one skill. I do similar Room Aware Voice Commands thru Hubitat and was able to delete all of my dummy routines.

2 Likes

I tried it when it was first announced and didn’t find it to be sufficiently flexible. The speech parser in my flow can easily handle various permutations of noun, verb, and subject for a variety of devices. An Alexa Blueprint requires explicitly specifying all the permutations.

I’ll take a look at it again but, based on your screenshot, it doesn’t appear to have evolved much since I last tried it.

Did you delete the config bit, not just the nodes, under alexa-remote-account? I went the whole hog, and deleted the flows after exporting. Can’t hurt to try.

I just put a timestamp on Smarthome Action, and it turned on what it should, using cakebake. I just call the device from a home assistant service node normally though, and emulated device to avoid error messages.

Another way to do it, especially if you have different accounts/household Echoes is to limit the messages/sec, eg.

[{"id":"3aeafa0e.2a27c6","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"8f9d4238.ea0608","type":"change","z":"3aeafa0e.2a27c6","name":"Strip Wake Word","rules":[{"t":"change","p":"payload.description.summary","pt":"msg","from":"^(alexa )?","fromt":"re","to":"","tot":"str"},{"t":"change","p":"payload.description.summary","pt":"msg","from":"^(amazon )?","fromt":"str","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":440,"wires":[[]]},{"id":"4b0721a5.681f5","type":"alexa-remote-event","z":"3aeafa0e.2a27c6","name":"Alexa Account","account":"","event":"ws-device-activity","x":430,"y":400,"wires":[["36208ab5.dda8be"]]},{"id":"9bd0d6f8.d1c4c8","type":"alexa-remote-event","z":"3aeafa0e.2a27c6","name":"Alexa Account #2","account":"","event":"ws-device-activity","x":440,"y":500,"wires":[["36208ab5.dda8be"]]},{"id":"471a3042.6ed8c","type":"delay","z":"3aeafa0e.2a27c6","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"2","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":860,"y":400,"wires":[["8f9d4238.ea0608"]]},{"id":"36208ab5.dda8be","type":"switch","z":"3aeafa0e.2a27c6","name":"Alexa hears","property":"payload.description.summary","propertyType":"msg","rules":[{"t":"regex","v":"alexa|amazon","vt":"str","case":true},{"t":"regex","v":"^(?:(?!amazon|alexa).)+$","vt":"str","case":true}],"checkall":"false","repair":false,"outputs":2,"x":650,"y":440,"wires":[["471a3042.6ed8c"],["8ef758e0.afdcf"]],"outputLabels":["Turn on",""]},{"id":"8ef758e0.afdcf","type":"delay","z":"3aeafa0e.2a27c6","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"2","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":860,"y":500,"wires":[["8f9d4238.ea0608"]]}]

2021-04-30