I’d like to trigger automations using voice commands without using the cloud. I’d prefer to do this in Node-RED. Is anyone already doing this? If so, could you please share how it’s done? If it’s not currently possible, does anyone have a workaround they like?
I can’t see how this is possible with Amazon Alexa or Google Home because both are cloud services.
For example, I’m using this flow to allow for “room-aware” commands. In the kitchen, I can say “Set light to 50” and the Kitchen Alexa (an ecobee Switch+) will hear it and set the Kitchen Light to 50% as opposed to asking me “Which light?” The flow determines which Alexa heard it and chooses that room’s default light (or fan because the flow also handles commands like “Turn on the fan.”)
Effectively, I have custom voice commands to set default lights and fans in various rooms. However, the spoken command itself is still processed by Amazon’s Alexa cloud service and the action to turn a device on/off is also issued by the cloud service.
If you want “less cloud”, and you have Apple devices, there’s Siri and HomeKit (but that’s a separate discussion).
Thanks for the response! Room-based automations sounds very cool!
I’ve seen posts that talk about an “Alexa Local Node” (usually in the context of Node-RED, so maybe it’s Node-RED specific and/or maybe I’m misunderstanding what such a node actually does) so I assumed it provided some means of intercepting Alexa’s outbound message and then performing some action.
The “Alexa Local Node” you described is one of several variations of “emulated hue”. Amazon Alexa devices are able to discover Philips Hue devices. The “emulated hue” pretends to be a Philips Hue Bridge and presents a list of devices to Amazon Alexa (devices that do not need to be true-blue Philips-branded devices).
In my case, I tried Home Assistant’s very own Emulated Hue integration but did not get good results. I understand it has been recently updated so the deficiencies I encountered may have been corrected.
In place of that integration, I used https://flows.nodered.org/node/node-red-contrib-amazon-echo. The only downside is that it represents devices as lights and only lights. In contrast, the Emulated Hue integration offers to present a device as either a light or a switch (avoids the silliness of depicting your fountain as a dimmable light).
That particular node has worked for me (since January 2020). However, I take its “No cloud dependencies” claim with a grain of salt because Alexa without access to its cloud service isn’t going to work out all that well. The claim is limited to the node itself and not to the end-to-end process of issuing a verbal command and having it turn something on or off.
In contrast, the other node that I use to achieve “room awareness” is https://flows.nodered.org/node/node-red-contrib-alexa-remote2. That one is definitely cloud-dependent because you have to supply your Amazon credentials so that the node can remain connected to Alexa’s cloud services.
I’ll just leave this here:
Lots of buzz when support for it was first announced (November 2019) and then … tumbleweeds and crickets.
If you do use it, please post your adventures.
I do not. And have actually heard/seen that’s it’s pretty dumb compared to some of the less privacy based assistants.
Just thought I’d put it out there as an option.
I just saw that Alexa Local Node has been superseded by node-red-contrib-amazon-echo. I wonder if it could be modified to send an MQTT message. (I submitted a feature request on github.) If so, you could use an Alexa routine so that [any trigger phrase] could call “set {device} to X%” where X references 1 of 100 possible MQTT messages. With 100 (actually 101 counting zero) per device, you could do anything/everything you could possibly ever want — locally.
I looked into that when all that buzz was happening. It was never clear to me what clients were supported. They talk about the Almond Server but what device(s) can you use to send it messages/trigger stuff? Alexa? Google Assistant? Some RasPi built thing?
Not sure I’m following you there. I don’t see the need to modify node-red-contrib-amazon-echo.
If you need to send an MQTT message, just add the MQTT Out node to your flow. Here’s a fragment of the flow I use with node-red-contrib-amazon-echo.
This makes Amazon Alexa aware of a light called “Bay Window Light”. If I ask Alexa to turn it on, the spoken phrase is translated in the cloud and the resulting command is processed by the flow. It runs through the “Lights” function node (which transforms the message into the appropriate MQTT topic and payload) and then gets published to my MQTT broker.