HowTo: Voice control of BCS with Amazon Alexa

Describe your system and processes, and post your config file.
Post Reply
JonW
Site Admin
Posts: 1726
Joined: Sun Jul 18, 2010 7:51 am
Bot?: No
Location: Huntington Beach, CA
Contact:

HowTo: Voice control of BCS with Amazon Alexa

Post by JonW »

I have created a JavaScript function that allows you to control your BCS using Amazon Alexa.

Example voice commands could be:
Alexa, turn on Mash Process.
Alexa, turn on Boil Kettle Pump.
Alexa, set Strike Temperature to 162.
Alexa, set Boil Element to 55

This interface uses the Amazon "Smart Home Skill" to define the voice interaction with devices. This includes using the On, Off, set (level) commands for outputs and the set temperature commands for setpoints and useful in state exit conditions. Note that the "Smart Home Skill" only includes pre-defined commands used to control devices and as such, you are limited to working within the "Smart Home Skill" framework. Please see this link for details on the complete Smart Home Skill API: https://developer.amazon.com/public/sol ... -reference.

You will be required to setup a (free) Amazon developer account in order to use this skill.

The steps for doing the setup are located here: https://developer.amazon.com/public/sol ... home-skill . Note: When following those instructions, there are a couple of changes to be made. At step 8, choose "Node.js 4.3' as the runtime instead of "Python 2.7". Also, at step 10, do not copy and paste their example code, instead substitute the contents of the file "Alexa_BCS.txt" that I have included. This is a JavaScript file that includes the definitions of your BCS device and functions for controlling the BCS.

All defined processes, outputs, temp settings, etc. are listed in the JSON structure near the end of the provided file in the function handleDiscovery. You will want to modify those names to be more Alexa friendly (e.g. instead of "Process 0", you may want "Mash Process"). Additionally, you may want to define custom voice commands to allow you to switch states or even set a temperature and map it to multiple outputs or exit conditions. (see examples in function).

At a minimum, you will need to change the "host", "port" and "user" variables. It is also suggested to change the "friendlyName" for each device as that is the voice command name that you use. If you leave the defaults, you would need to say "Alexa, turn on Process 0", but if you change it, you could instead say, "Alexa turn on Mash Process".
Alexa_BCS_V2_Beta.txt
(50.45 KiB) Downloaded 410 times

Below is an overview of the communications that occurs when you ask Alexa to control your BCS.

Image
User avatar
oakbarn
Posts: 846
Joined: Thu Jan 05, 2012 2:28 pm
Bot?: No
Location: Texas
Contact:

Re: HowTo: Voice control of BCS with Amazon Alexa

Post by oakbarn »

Too cool. I just ran into this. I have been playing with the HMI from BBraley and trying to re write my Large Temp and Time screens. I have started to modify the txt file. I think I may change my Timer Names to reflect the new "friendly name" in the Process Editor.
jward
Posts: 69
Joined: Sun Oct 04, 2009 9:38 pm
Bot?: No

Re: HowTo: Voice control of BCS with Amazon Alexa

Post by jward »

Alexa, pour me a beer.
User avatar
oakbarn
Posts: 846
Joined: Thu Jan 05, 2012 2:28 pm
Bot?: No
Location: Texas
Contact:

Re: HowTo: Voice control of BCS with Amazon Alexa

Post by oakbarn »

Entering the IP Address: I see there is an "http" var so is it

'http://192.168.1.218'

or
'//192.168.1.218'

'192.168.1.218'

Also if no Authenication, the User Password ""?
JonW
Site Admin
Posts: 1726
Joined: Sun Jul 18, 2010 7:51 am
Bot?: No
Location: Huntington Beach, CA
Contact:

Re: HowTo: Voice control of BCS with Amazon Alexa

Post by JonW »

oakbarn wrote:
Tue Feb 21, 2017 6:21 am
Entering the IP Address: I see there is an "http" var so is it

'http://192.168.1.218'

or
'//192.168.1.218'

'192.168.1.218'

Also if no Authenication, the User Password ""?
host name or IP only - no http or // prefix.

You can leave the user/pass in there as it is ignored by the BCS if not using it.

Since you have to open a port on your firewall to allow remote access to your BCS, I'd suggest using the authentication. Addditionally, I access mine externally through a high port number like 46000 so simple port scanners for port 80 don't find it. Most port scanning only looks at the "well known" ports. You can leave the BCS on port 80 but just have your firewall forward from the high number port externally to the standard 80 internally.
User avatar
oakbarn
Posts: 846
Joined: Thu Jan 05, 2012 2:28 pm
Bot?: No
Location: Texas
Contact:

Re: HowTo: Voice control of BCS with Amazon Alexa

Post by oakbarn »

I do use a high number and need to add the password. I have one on my Fermentor BCS, just lazy. I got BBralley's HMI working very well and just need this for the Lazy Boy!
JonW
Site Admin
Posts: 1726
Joined: Sun Jul 18, 2010 7:51 am
Bot?: No
Location: Huntington Beach, CA
Contact:

Re: HowTo: Voice control of BCS with Amazon Alexa

Post by JonW »

Amazon just updated the API with the ability to query both current temperatures and setpoints, so I'll be doing some updates to the script to support that.

You'll now be able to ask "Alexa, what is the fermenter temp?" or "Alexa, what is the kegerator setpoint?".

More to come....
wyowolf
Posts: 53
Joined: Sun Nov 08, 2015 1:58 pm
Bot?: No

Re: HowTo: Voice control of BCS with Amazon Alexa

Post by wyowolf »

Wow, thank you so much! I just got an Alexa... as soon as I figure all this out will be super happy!!
wyowolf
Posts: 53
Joined: Sun Nov 08, 2015 1:58 pm
Bot?: No

Re: HowTo: Voice control of BCS with Amazon Alexa

Post by wyowolf »

Ok, on step 8. Code entry type, am I supposed to copy and paste the code that you wrote in that space?
JonW
Site Admin
Posts: 1726
Joined: Sun Jul 18, 2010 7:51 am
Bot?: No
Location: Huntington Beach, CA
Contact:

Re: HowTo: Voice control of BCS with Amazon Alexa

Post by JonW »

wyowolf wrote:
Mon Mar 13, 2017 3:40 am
Ok, on step 8. Code entry type, am I supposed to copy and paste the code that you wrote in that space?
At step 8, you choose node.js as the code type. I believe it is step 10 where you copy in my code instead of their starter code.
Post Reply