HowTo: Voice control of BCS with Amazon Alexa

Describe your system and processes, and post your config file.
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 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: 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 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.
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:
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: 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 »

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: 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 »

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: 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 »

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.
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 »

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 »

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
TheAleMaster
Posts: 31
Joined: Thu Dec 09, 2010 12:53 pm
Bot?: No

Re: HowTo: Voice control of BCS with Amazon Alexa

Post by TheAleMaster »

Ok. I sent a message to oakbarn since I was using his guide, but I’ll toss it out here for public view, too. My Lambda works fine when I test it. The things I’ve changed thus far are my IP address and port.

I cannot however seem to get past discovery. The UI and user flow is a bit different now than when oakbarn wrote his guide, but I think I still was able to find and complete all his steps. Below is my log from CloudWatch which seems to point at a line in the Lambda JS, but I don’t know enough about this stuff to have any clue what it’s talking about.

Code: Select all

START RequestId: 61d0f09c-cc21-11e8-ab8f-9fdf40246eaa Version: 1
2018-10-10T00:13:58.199Z	61d0f09c-cc21-11e8-ab8f-9fdf40246eaa ********** Event Request **********
2018-10-10T00:13:58.247Z	61d0f09c-cc21-11e8-ab8f-9fdf40246eaa
{
    "directive": {
        "header": {
            "namespace": "Alexa.Discovery",
            "name": "Discover",
            "payloadVersion": "3",
            "messageId": "ba6231e5-8856-4fca-80d2-6d5b602548f9"
        },
        "payload": {
            "scope": {
                "type": "BearerToken",
                "token": "Atza|IwEBIBJi4DJJ-GIp3EmseAHpk6EJ371c-1w_MNl60fQZ4NdKIfu3gK0ewdIxwPnMCb13Ue10q1_Pw3hl-hoYjVnmVuXbh5tyNsUu8q0--tXix30X93ZRHv56Zgo6TuAa352nzJdZrsktRz2o-DDSbgplITs_19-MdTh_W6FeIrZp_hrXRPjXVRYnoh5MZWENjMsx3l4e-qhMC7PE-Y-w_Owaz5SqejWbZSedeQk2x5JknKh4iHKDoq0Rtgq1OH7Dus8SKV1OI1pMZkE6QtnZcowudCqLlaLaGRb3njeUlxLLBeKpFbmtKo0evYsN5edWCXGuj52szaURWGQ3I2csZME9TdCQeSzf2NzPs6n_vD0s04WnAVo8jj1iH8gheFa5lYQ9AmJS-OOFg6Tj6GhL_zm1GM4oMZwGBH2ILHF9COjburvO6IVDWQlC7PFYHOonG4k8Dn7DeiejkZK_GBN22uwKxJQOlG-_0ioU8052nyLRp4FtH_tdk4VYg1knahRbEd2wt7A"
            }
        }
    }
}

2018-10-10T00:13:58.249Z	61d0f09c-cc21-11e8-ab8f-9fdf40246eaa TypeError: Cannot read property 'namespace' of undefined
at exports.handler (/var/task/index.js:70:25)
END RequestId: 61d0f09c-cc21-11e8-ab8f-9fdf40246eaa
REPORT RequestId: 61d0f09c-cc21-11e8-ab8f-9fdf40246eaa	Duration: 90.32 ms	Billed Duration: 100 ms Memory Size: 128 MB	Max Memory Used: 19 MB	
TheAleMaster
Posts: 31
Joined: Thu Dec 09, 2010 12:53 pm
Bot?: No

Re: HowTo: Voice control of BCS with Amazon Alexa

Post by TheAleMaster »

I somehow figured it out. In my Alexa Skill I had it set Payload version = v3 per Amazon's recommendation as v2 is deprecated (screen shot below). I changed it to v2 and everything worked fine. I went back into the Lambda JS and changed the following:
  • The value for payloadVersion to 3 on lines 123, 269, 368, and 534. I didn't find any others.
  • The value for version in each appliance object to 3.
I then published the Lambda, updated the ARNs in my skill, and changed the Payload version from v2 back to v3. Didn't work. I changed it back to v2 and it worked again. I'm not sure where the update is that needs to be made to use v3.

Also, I'm assuming I'll need to change my IP address constantly unless I purchase a static IP address from my ISP, yes?

Image
Post Reply