Node-RED nodes for hubitat

I largely followed this guide when setting up the echo commands.


From the link - A “change” node is used to strip the wake word from the command, if present (i.e. if the user didn’t pause for Alexa to respond before uttering the command); the wake-word is stripped ahead of time rather than simply being matched in the regex-based router for reusability (specifically, for sharing with you all, as some of you may use a custom wake word) and also to shorten the required pattern string

If you follow along with his guide, it should give you some idea on further possibilities.

Here my flow anyway, so you can import and play..

[{"id":"23f2dc01.f66814","type":"switch","z":"20728976.2fb466","name":"Listen for phrases","property":"payload.description.summary","propertyType":"msg","rules":[{"t":"regex","v":"i'm home","vt":"str","case":false},{"t":"regex","v":"open (the )?garage door","vt":"str","case":false},{"t":"regex","v":"close (the )?garage door","vt":"str","case":false}],"checkall":"false","repair":false,"outputs":3,"x":530,"y":1260,"wires":[["be24efda.3b073"],["be24efda.3b073"],["be24efda.3b073"]],"outputLabels":["Turn on","Turn on",""]},{"id":"3c8a85e7.b229fa","type":"hubitat command","z":"20728976.2fb466","name":"Garage Door Control ","server":"26c9a23e.36f4ce","deviceId":"708","command":"childPulse","commandArgs":"1","x":940,"y":1260,"wires":[[]]},{"id":"be24efda.3b073","type":"switch","z":"20728976.2fb466","name":"Which device","property":"payload.deviceSerialNumber","propertyType":"msg","rules":[{"t":"eq","v":" G0W0SW08011403F1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":730,"y":1260,"wires":[["3c8a85e7.b229fa"]]},{"id":"fedde32a.da8ef","type":"change","z":"20728976.2fb466","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":330,"y":1260,"wires":[["23f2dc01.f66814"]]},{"id":"1d551c35.05eb04","type":"alexa-remote-event","z":"20728976.2fb466","name":"","account":"49135c4f.6bdd74","event":"ws-device-activity","x":110,"y":1260,"wires":[["fedde32a.da8ef"]]},{"id":"26c9a23e.36f4ce","type":"hubitat config","z":"","name":"Hubitat","usetls":false,"host":"192.168.20.11","port":"80","appId":"545","nodeRedServer":"http://192.168.20.10:1880","webhookPath":"/hubitat/webhook","autoRefresh":true,"useWebsocket":false},{"id":"49135c4f.6bdd74","type":"alexa-remote-account","z":"","name":"","authMethod":"proxy","proxyOwnIp":"192.168.20.10","proxyPort":"3456","cookieFile":"/data/cookie/alexa-cookie.json","refreshInterval":"3","alexaServiceHost":"alexa.amazon.com.au","amazonPage":"amazon.com.au","acceptLanguage":"en-US","userAgent":"","useWsMqtt":"on","autoInit":"on"}]

On the alexa side, i had to make a blank routine, to listen for "open garage door, then say ok"
If i didnt have this, when i said "open garage door" door would open, but alexa would respond with - "i cannot find a device called garage door"
You can use the palette node-red-contrib-amazon-echo to mimic a local device, so you don't have to use routines, but i could not get it to work, as i cant run nodered as root user!!

2 Likes