Simple control of Alexa enabled devices

image

https://simplesi.net/control-any-alexa-device-using-node-red/

I've had this idea for a while and I've finally implemented it :smiley:

The basic idea is that you use text to speech and place a speaker (or headphone earpiece) near an Alexa dot and just issues commands to your Alexa.

Thanks to @JGKK for their pico2wave node for getting it working on a Pi :slight_smile:

6 Likes

Here it is in action

1 Like

It needs some Gaffer tape for the full effect :wink:

Gaffer tape is SO last century :slight_smile:

1 Like

nice idea, but...

If you use alexa remote 2 (cakebaked or similar) you can do it much more simple and WAF friendly.

In your Alexa app build a routine. As trigger you can set anything, you won´t need it to execute the routine. As response you can set anything by using predefined answers or make your own customized answer.
In NR use a Alexa Routine node.
image

Now trigger that node with anything and alexa will say what you have defined.before.

As example i show you my hunmidity alarm where alexa tells my to open the window in the childsroom if humidity is above 60%. I added a button and a gate to stop Alexa. I added a timerange too.

[{"id":"ff0cc945.569628","type":"tab","label":"Kinderzimmer","disabled":false,"info":""},{"id":"8ba403b1.d6d42","type":"mqtt in","z":"ff0cc945.569628","name":"Sonoff TH10 Kinderzimmer  - State","topic":"sonofftemphumi/tele/SENSOR","qos":"0","datatype":"auto","broker":"330b0f73.614de","nl":false,"rap":false,"inputs":0,"x":160,"y":100,"wires":[["e6f68f82.af8a8"]]},{"id":"e6f68f82.af8a8","type":"json","z":"ff0cc945.569628","name":"","property":"payload","action":"obj","pretty":false,"x":390,"y":100,"wires":[["1649fc38.b54aa4","381c68f2.fa5298","7fa9dd96988b85e1"]]},{"id":"eb5abf0c.24b09","type":"switch","z":"ff0cc945.569628","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"Wifi","vt":"str"},{"t":"eq","v":"SI7021","vt":"str"},{"t":"eq","v":"POWER","vt":"str"},{"t":"eq","v":"Humidity","vt":"str"},{"t":"eq","v":"Temperature","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":690,"y":200,"wires":[["5e8f0dde.a89b44","1649fc38.b54aa4"],["f449455a.4b0dd8","1649fc38.b54aa4"],[],["6f8c920b.6dce6c","2028819.1c6d17e","381c68f2.fa5298","a47193e5.38103","58b15ea6.4b4c6"],["90c6aa56.dac008","f2e3f248.e969a"]]},{"id":"1649fc38.b54aa4","type":"split","z":"ff0cc945.569628","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":550,"y":120,"wires":[["eb5abf0c.24b09"]]},{"id":"2edb1cf3.68ac34","type":"mqtt in","z":"ff0cc945.569628","d":true,"name":"RESULT","topic":"sonofftemphumi/stat/RESULT","qos":"0","datatype":"auto","broker":"330b0f73.614de","inputs":0,"x":200,"y":220,"wires":[["e6f68f82.af8a8"]]},{"id":"897afef1.38816","type":"mqtt in","z":"ff0cc945.569628","d":true,"name":"SENSOR","topic":"sonofftemphumi/tele/SENSOR","qos":"0","datatype":"auto","broker":"330b0f73.614de","inputs":0,"x":200,"y":180,"wires":[["e6f68f82.af8a8"]]},{"id":"c73f6d9.b74a89","type":"comment","z":"ff0cc945.569628","name":"TH10 Feuchtigkeitsmesser im Kinderzimmer","info":"","x":190,"y":40,"wires":[]},{"id":"6f8c920b.6dce6c","type":"ui_chart","z":"ff0cc945.569628","name":"Humidity","group":"e9c7a01e.c0955","order":1,"width":7,"height":5,"label":"Luftfeuchte %","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"2","removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":920,"y":160,"wires":[[]]},{"id":"2028819.1c6d17e","type":"switch","z":"ff0cc945.569628","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"60","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":910,"y":200,"wires":[["7c70353647962c5c"]]},{"id":"381c68f2.fa5298","type":"debug","z":"ff0cc945.569628","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":930,"y":80,"wires":[]},{"id":"f449455a.4b0dd8","type":"debug","z":"ff0cc945.569628","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":930,"y":120,"wires":[]},{"id":"5e8f0dde.a89b44","type":"debug","z":"ff0cc945.569628","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":930,"y":40,"wires":[]},{"id":"a47193e5.38103","type":"ui_level","z":"ff0cc945.569628","group":"79cbaec2.dcb32","order":3,"width":3,"height":1,"name":"","label":"","colorHi":"#e60000","colorWarn":"#ff9900","colorNormal":"#00b33c","colorOff":"#595959","min":0,"max":100,"segWarn":"","segHigh":"","unit":"%","layout":"sh","channelA":"","channelB":"","decimals":"1","animations":"soft","shape":2,"colorschema":"fixed","textoptions":"default","colorText":"#eeeeee","fontLabel":"","fontValue":"","fontSmall":"","colorFromTheme":true,"textAnimations":false,"hideValue":false,"tickmode":"off","peakmode":false,"property":"payload","peaktime":3000,"x":910,"y":260,"wires":[]},{"id":"90c6aa56.dac008","type":"ui_artlessgauge","z":"ff0cc945.569628","group":"79cbaec2.dcb32","order":1,"width":3,"height":3,"name":"","icon":"","label":"Temp / Luftfeuch.","unit":"°C","layout":"radial","decimals":"2","differential":false,"minmax":false,"colorTrack":"#555555","style":"","colorFromTheme":true,"property":"payload","secondary":"secondary","inline":true,"animate":true,"sectors":[{"val":0,"col":"#ff9900","t":"min","dot":0},{"val":100,"col":"#ff9900","t":"max","dot":0}],"lineWidth":3,"bgcolorFromTheme":true,"diffCenter":"","x":940,"y":340,"wires":[]},{"id":"58b15ea6.4b4c6","type":"link out","z":"ff0cc945.569628","name":"Humi Kinderzimmer","links":["99db5b3.a97faa8"],"x":875,"y":300,"wires":[]},{"id":"f2e3f248.e969a","type":"link out","z":"ff0cc945.569628","name":"Temp Kinderzimmer","links":["84c718ad.7131f8"],"x":875,"y":380,"wires":[]},{"id":"e52f23096a45aab9","type":"link in","z":"ff0cc945.569628","name":"hzg Kizi von hzg","links":["e390c009785e69fe"],"x":295,"y":520,"wires":[["ccbe0d261a1ece97"]]},{"id":"c158b21e960d3f13","type":"link out","z":"ff0cc945.569628","name":"hzg Kizi nach hzg","links":["b8630e68590a675d"],"x":615,"y":520,"wires":[]},{"id":"ccbe0d261a1ece97","type":"ui_slider","z":"ff0cc945.569628","name":"","label":"HZG Kinderzimmer","tooltip":"","group":"e1d7a116fbdcf2f4","order":8,"width":"10","height":1,"passthru":false,"outs":"end","topic":"topic","topicType":"msg","min":"4","max":"28","step":1,"className":"","x":450,"y":520,"wires":[["c158b21e960d3f13"]]},{"id":"7fa9dd96988b85e1","type":"simpletime","z":"ff0cc945.569628","name":"","mydate":false,"myymd":true,"myyear":false,"mymonth":false,"mymonthn":false,"mydom":false,"mydoy":false,"myday":false,"myhourpm":false,"myhour":false,"mytime":false,"mytimes":true,"myminute":false,"myminutes":false,"mysecond":false,"mymillis":false,"myepoch":false,"myrawdate":false,"mypm":false,"x":570,"y":440,"wires":[["b4988cc51b5ed38b","ec40099c6ced62cc"]]},{"id":"b4988cc51b5ed38b","type":"change","z":"ff0cc945.569628","name":"","rules":[{"t":"move","p":"mytimes","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":960,"y":440,"wires":[["dc9460f97e9c5bb3","c133a252cce08afc"]]},{"id":"ec40099c6ced62cc","type":"change","z":"ff0cc945.569628","name":"","rules":[{"t":"move","p":"myymd","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":960,"y":540,"wires":[["ea7475e9ec630522","e1c84c8fedf19c2d"]]},{"id":"dc9460f97e9c5bb3","type":"link out","z":"ff0cc945.569628","name":"Kontaktzeit Kinderzimmer ","links":["9b1a9a7959b926dd","be2fdb949158ca63"],"x":1095,"y":480,"wires":[]},{"id":"ea7475e9ec630522","type":"link out","z":"ff0cc945.569628","name":"Kontaktdatum Kinderzimmer ","links":["b3591e682392f7ac","2692a415a2e7c234"],"x":1095,"y":580,"wires":[]},{"id":"1097119b603fd3a5","type":"alexa-remote-routine","z":"ff0cc945.569628","name":"","account":"9d26c7ce.162eb8","routineNode":{"type":"routine","payload":{"routine":{"type":"str","value":"amzn1.alexa.automation.fbd05935-cb2d-4d51-8e47-dc161e6ed606"},"device":{"type":"str","value":"G090U507843624GW"}}},"x":1280,"y":320,"wires":[[]]},{"id":"7c70353647962c5c","type":"time-range-switch","z":"ff0cc945.569628","name":"","lat":"52° 19' 9.80","lon":"9° 39' 19.58","startTime":"10:00","endTime":"19:00","startOffset":0,"endOffset":0,"x":1050,"y":200,"wires":[["77bb552cdb0e7047"],[]]},{"id":"659d7bcb4470a346","type":"delay","z":"ff0cc945.569628","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"30","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"outputs":1,"x":1430,"y":260,"wires":[["1097119b603fd3a5"]]},{"id":"5ef7ce8d9d18ed45","type":"gate","z":"ff0cc945.569628","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"storeName":"memory","x":1250,"y":260,"wires":[["659d7bcb4470a346"]]},{"id":"77bb552cdb0e7047","type":"ui_switch","z":"ff0cc945.569628","name":"","label":"Alexa Ausgabe stoppen","tooltip":"","group":"79cbaec2.dcb32","order":8,"width":"3","height":"2","passthru":true,"decouple":"false","topic":"topic","topicType":"msg","style":"","onvalue":"open","onvalueType":"str","onicon":"","oncolor":"","offvalue":"close","offvalueType":"str","officon":"","offcolor":"","animate":false,"className":"","x":1310,"y":200,"wires":[["0eb77c79a5fc48a4"]]},{"id":"0eb77c79a5fc48a4","type":"change","z":"ff0cc945.569628","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1520,"y":200,"wires":[["5ef7ce8d9d18ed45"]]},{"id":"c133a252cce08afc","type":"ui_template","z":"ff0cc945.569628","group":"79cbaec2.dcb32","name":"","order":4,"width":0,"height":0,"format":"<div ng-bind-html=\"msg.payload\"></div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":1160,"y":440,"wires":[[]]},{"id":"e1c84c8fedf19c2d","type":"ui_template","z":"ff0cc945.569628","group":"79cbaec2.dcb32","name":"","order":4,"width":0,"height":0,"format":"<div ng-bind-html=\"msg.payload\"></div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":1160,"y":540,"wires":[[]]},{"id":"330b0f73.614de","type":"mqtt-broker","name":"Mosquitto","broker":"192.168.178.33","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"e9c7a01e.c0955","type":"ui_group","name":"Chart","tab":"5a358c27.d35694","order":2,"disp":true,"width":7,"collapse":true},{"id":"79cbaec2.dcb32","type":"ui_group","name":"Sensoren","tab":"5a358c27.d35694","order":1,"disp":true,"width":3,"collapse":true},{"id":"e1d7a116fbdcf2f4","type":"ui_group","name":"Heizung","tab":"5a358c27.d35694","order":3,"disp":true,"width":"10","collapse":false,"className":""},{"id":"9d26c7ce.162eb8","type":"alexa-remote-account","name":"","authMethod":"proxy","proxyOwnIp":"192.168.178.33","proxyPort":"3456","cookieFile":"alexaremote2auth","refreshInterval":"1","alexaServiceHost":"layla.amazon.de","amazonPage":"amazon.de","acceptLanguage":"de-DE","userAgent":"","useWsMqtt":"on","autoInit":"on"},{"id":"5a358c27.d35694","type":"ui_tab","name":"Kinderzimmer","icon":"fa-child","order":6,"disabled":false,"hidden":false}]

My concept is for situations where you just want to simply control Alexa enabled devices without worrying about having to learn any APIs or skills :slight_smile:

Your project does something else :slight_smile:

One thing I'm using mine for is to listen to the MQTT cheerlights feed and then turn all my colour lights to the current cheerlight colour

Previously, this would have required quite a lot of configuration

FYI
I'm having to do a bit of colour name changing just to keep Alexa happy :slight_smile:

Current mapping (using Pi with pico2wave English(GB) voice) is
orange -> oranje
cyan -> sighanne
pink -> pin kk

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.