HowTo: Voice control of BCS with Amazon Alexa

Describe your system and processes, and post your config file.
User avatar
oakbarn
Posts: 653
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 » Tue Apr 04, 2017 12:47 pm

I also commented out this code but do have a question about this:

Where is the "Set Strike" utterance that is in // Alexa, set Strike Temperature to 162 in the code?

I want to play a little more using this structure vs the extradetails and see if I have better luck with Setting Setpoints. I do know that you can use the Recipe Utility like the Temperature Setpoint Adjustment page of the GUI, but set several SetPoints at the same time.

/**
* Most control requests will be sent by the "default" handler below.
*
* Only define and send commands in response to a specific applianceId
* if you need to fire multiple events or some custom event.
* Examples of this would be if you wanted to turn on multiple outputs
* or start multiple processes with a single command, or if you wanted
* to set a temperature at multiple places with a single voice command.
* (FYI setting the temps can be used much like the web recipe utility.)
*
* You can override the "url" and/or "cmd" that is sent to the BCS.
* In these cases, the values stored in extraDetail2 , extraDetail3
* or extraDetail4 are not used and you would instead define your
* required values for the "url" and "cmd" parameters.
*/
switch (applianceId) {

// This example sets a temperature in two states plus an exit condition.
// You set the API URL for the state/process/object you're updating.
// This can be used instead of the recipe utility by simply saying:
// Alexa, set Strike Temperature to 162.
case 'STRIKE_TEMP':
// This sets the setpoint value in Process 0, State 1, Output 1.
//url = '/api/process/0/state/1/output_controllers';
// cmd = JSON.stringify({"key": 1,"value": {"setpoint": setValue}});
// new BCS_Command(context, url, cmd, function (BCS_Response1) {
// context.succeed(result);
// });

// This sets the setpoint value in Process 0, State 1, ExitCondition 0.
// url = '/api/process/0/state/1/exit_conditions';
// cmd = JSON.stringify({"key": 0,"value": {"value": setValue}});
// new BCS_Command(context, url, cmd, function (BCS_Response2) {
// context.succeed(result);
// });

// This sets the setpoint value in Process 0, State 2, Output 1.
// url = '/api/process/0/state/2/output_controllers';
// cmd = JSON.stringify({"key": 2,"value": {"setpoint": setValue}});
// new BCS_Command(context, url, cmd, function (BCS_Response3) {
// context.succeed(result);
// });

break;
// */

User avatar
JonW
Site Admin
Posts: 1440
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 » Tue Apr 04, 2017 2:08 pm

oakbarn wrote:
Tue Apr 04, 2017 12:47 pm
I also commented out this code but do have a question about this:

Where is the "Set Strike" utterance that is in // Alexa, set Strike Temperature to 162 in the code?

I want to play a little more using this structure vs the extradetails and see if I have better luck with Setting Setpoints. I do know that you can use the Recipe Utility like the Temperature Setpoint Adjustment page of the GUI, but set several SetPoints at the same time.
That is the example code to set a temperature in multiple places with one utterance. It shows that if you create an "applianceId" with the name "STRIKE_TEMP", then it will set the temperature for those three locations.

A bit further down is the default code that runs if there is no match for the specific "applianceId".

// // All normal Alexa requests are sent to the BCS with this default handler.
// default:
// new BCS_Command(context, url, cmd, function (BCS_Response) {
// // Handle "BCS_Response" here if you want to do further processing.
// context.succeed(result);
// });

User avatar
oakbarn
Posts: 653
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 » Fri Apr 07, 2017 8:33 am

I wrote some instruction on how I got the voice command to work. It is a "work in progress". I am not sure it is correct because I cannot "undo" some things and start fresh. If anyone uses it please send me some feedback in a PM.

Here is a link: (updated)
https://www.dropbox.com/s/23qb1dkhrzsuf ... 2.pdf?dl=0
Last edited by oakbarn on Wed Apr 12, 2017 1:57 pm, edited 2 times in total.

User avatar
JonW
Site Admin
Posts: 1440
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 » Fri Apr 07, 2017 10:12 am

oakbarn wrote:
Fri Apr 07, 2017 8:33 am
I wrote some instruction on how I got the voice command to work. It is a "work in progress". I am not sure it is correct because I cannot "undo" some things and start fresh. If anyone uses it please send me some feedback in a PM.

Here is a link:
https://www.dropbox.com/s/p8o44iia8uqol ... 2.pdf?dl=0
Wow, that's pretty detailed Oakbarn - nice job!

Couple of things: You need to obscure all of your client ID/secret, security profile ID, AWS Lambda function ID, etc.

Additionally, please don't include a link to your own download copy of the Javascript file. I will be making several updates to that and I would like to make sure that the only published link is to get it from the forums here.

User avatar
oakbarn
Posts: 653
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 » Fri Apr 07, 2017 8:57 pm

They are all "fake news" ! When I was looking at some examples, they were all blacked out. I could have done that but I just put in some made up ones. I removed links to the code for the test and just left the link to the one JonW has in this forum.

The Link quoted above is broken.

Here is an updated link: (also updated in previous post)

https://www.dropbox.com/s/23qb1dkhrzsuf ... 2.pdf?dl=0

User avatar
oakbarn
Posts: 653
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 » Tue May 02, 2017 10:23 am

We did our first brew with the Voice Commands. It is so fun! Alexa, turn on Brew Kettle Burner. Whoosh!

I also have a water valve that I can control which is really nice. We used to have someone standing by the water to turn on and off when cleaning. I could not use by myself but this morning I was cleaning my conicals on my lonesome. Alexa, turn on firehose and Alexa, turn off firehose worked great.

I had removed my pump control from the BCS as I was always turning them on and off manually. I am going to put them back under control as

Alexa, turn on Red Pump!

It also is just really cool!

User avatar
oakbarn
Posts: 653
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 » Wed Jun 21, 2017 6:57 am

Any thoughts on how to control two different BCS 462 at the same time? I have two BCS 462 and use one just for fermentation but it has several Outs that are free. I could use more valves on my Brewery Hot side that I could automate with those free Outs. I know that they could not be Process controlled by the Brewery BCS but a Voice command to a State that went to both the Brewery and Fermentor BCSs might work. Just Voice Command would be enough as that is the way I control my propane burners.

User avatar
JonW
Site Admin
Posts: 1440
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 » Wed Jun 21, 2017 11:48 am

Yes, you can address two different BCS units. For now, the quickest and easiest way is to make a second skill adapter and script and code each one for the devices they each control.

I have done some proof-of-concept with using a single script for multi-BCS control, but it is not ready to release. It relies on coding the host/port/credentials in one of the ExtraDetail parameters so that it is passed for each command. This allows you to use a voice command that can trigger multiple actions across the different BCS units.

ccs
Posts: 3
Joined: Wed Nov 23, 2011 6:06 pm
Bot?: No

Re: HowTo: Voice control of BCS with Amazon Alexa

Post by ccs » Wed Aug 09, 2017 10:26 am

Very good job JonW and oakbarn. Without your comprehensive documentation, it would have been very difficult to add Alexa to BCS.
It is great to control it on a brew day when ones hands are full and you need to quickly do something like turn off a pump

Thanks, Charles

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest