A Google Assistant Action (with an invocation name of "tiger") which controls a Honeywell VISTA-20P alarm panel and opens/closes garage doors. This Action is for private use only and is not published to the public Google Assistant directory.
- Amazon Web Services account
- Google account
- Download and install gactions CLI
- Download and install AWS CLI
- A working and Internet accessible installation of vistaicm-server
Follow these steps on the AWS Management Console to create an AWS Lambda function and corresponding API Gateway endpoint to handle requests for this Action from the Google Assistant service.
- Go to the Lambda AWS Management Console
- Create Lambda function
- Choose "Blank Function" blueprint
- On "Configure Triggers" step:
- Select "API Gateway"
- Use "google-action-tiger" as name
- Select "Open" for security
- On "Configure function" step
- Name: "google-action-tiger"
- Runtime: Node.js 4.3
- Handler: index.Handler
- Role: Choose an existing Role
- Existing role: lambda_basic_execution
- Proceed to review and then click "Create function"
- On the "Triggers" tab, note the API Gateway URL which will looks like this: https://0000ABC123.execute-api.us-east-1.amazonaws.com/prod/google-action-tiger
Although I would like to script the intial creation of the AWS Lambda function and corresponding API Gateway trigger, doing so through the AWS CLI is non-trival. There is a guide here which walks through the process and would be a good reference for future enhancement.
Copy the config.example
file to a new file named config
and update the config values:
- INVOCATION_NAME - The word used to initiate a conversation with the Google Action
- HTTP_EXECUTION_URL - The AWS API Gateway URL that points to the AWS Lambda function
- LAMBDA_FUNCTION_NAME - Name of the AWS Lambda function
- VISTA_ICM_ADDRESS - The URL for the vistaicm-server server
- VISTA_ICM_COMMAND_ARM - The vistaicm-server command to arm the alarm
- VISTA_ICM_COMMAND_DISARM - The vistaicm-server command to disarm the alarm (this is the security code)
- VISTA_ICM_COMMAND_PANIC - The vistaicm-server command to initiate the panic status
- VISTA_ICM_COMMAND_LEFT_GARAGE - The vistaicm-server command to trigger the left garage door to open/close
- VISTA_ICM_COMMAND_RIGHT_GARAGE - The vistaicm-server command to trigger the right garage door to open/close
To deploy the AWS Lambda function and the Google Assistant Action (in preview mode for 24 hours), run the following command:
./deploy.sh
Even if a very long preview_mins
value is provided when previewing the action, there is a limit to the preview duration and the action will eventually stop working. So, the preview_refresher
directory contains an Ansible playbook that will provision a server to run gactions preview ...
with a cron job every 24 hours. This way the Action will be available in preview mode indefinitely. To provision a server as a Preview Refresher:
- Copy the
preview-refresher/config.example
file to a new file namedpreview-refresher/config
and update the config values:
- [server] - On the line immediately following the
[server]
block, replace0.0.0.0
and provide the IP address for the target server - deploy_user - The name of the user on targer server under which the Preview Refresher will be installed
- deploy_directory - The directory on the target server to use for installation
- Run
./preview-refresher/provision.sh