HowTo: Voice control of BCS with Amazon Alexa

Describe your system and processes, and post your config file.
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 » Tue Oct 09, 2018 8:28 pm

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

User avatar
JonW
Site Admin
Posts: 1627
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 Oct 10, 2018 12:02 am

You could always use a dynamic DNS service and point the Lambda function to that name instead of an IP. For a while they weren't letting you select V2, so good you were able to do so. If I get time one of these days, I'll update it for V3. Not really sure how many people actually use it.

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 » Wed Oct 10, 2018 9:41 pm

Got the dynamic DNS rolling and slapping a cron job on my RaspberryPi to keep it updated.

I found these links that detail the difference between payload v2 and v3. I may give it a go in the next couple of weeks.

https://developer.amazon.com/docs/smart ... code-to-v3
https://developer.amazon.com/blogs/alex ... -skill-api

User avatar
oakbarn
Posts: 810
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 » Sun Oct 28, 2018 7:29 pm

I use it. It works great. I am going to look into a dynamic DNS as they keep changing my Public IP. Looks like some significant code changes in V3 as to how it works. Without knowing much, it looks like V3 would handle setpoints much better than V2.

I am still on V2

User avatar
JonW
Site Admin
Posts: 1627
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 » Sun Oct 28, 2018 10:09 pm

V3 is much better for a lot of things. I use it already for home automation but I haven't had time to re-do the BCS control to be compatible.

I'm actually thinking of writing a plugin for an open source home control program called OpenHAB. Having the BCS tied to that would give BCS users customizable mobile control screens, plus Alexa and Siri integration.

User avatar
oakbarn
Posts: 810
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 Nov 09, 2018 6:23 am

Until you get the openHAB code, I am hoping to have two states "turned on" with the same command.

I modified JonW code (mostly by creating variables) so that I can use Alexa to jump to a different State with the Voice command. It works very well.

The following code jumps to my “Obtain Strike” State in my “Mash” Process.


var p1State1 = "State Obtain Strike";
var p1State1DESC = "Process 1 Mash State 1 Obtain Strike";

{
"applianceId": "CUSTOM_Process_1_State_1",
"friendlyName": p1State1,
"friendlyDescription": p1State1DESC,
"manufacturerName": "Embedded Control Concepts",
"modelName": "BCS",
"version": "2",
"isReachable": true,
"additionalApplianceDetails": {
"extraDetail1": "",
"extraDetail2": "",
"extraDetail3": "/api/process/1",
"extraDetail4": JSON.stringify({"current_state": 1})
},
"actions": [
"turnOn"
]
},


What I want to do is also “turn on” Process 0 State 2 with the same command at the same time:

“Alexa, Turn On State Obtain Strike”


I know this code might work, but how do I integrate it into the above code. I know just enough Java Script to be dangerous.
{
"extraDetail3": "/api/process/0",
"extraDetail4": JSON.stringify({"current_state": 2)
},
"actions": [
"turnOn"
]

My desired code would cause both My “Brew Day” Process 0 and “Mash” Process to jump to different state simultaneously.

I do that now by using a DIN connected to a Push Button and use that as an Exit for both the States I want to Exit.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests