Documentation

Welcome to the documentation for the Google Assistant Smart Home Action Node-RED node.

Create Account

Before starting you will need to create an account, if you have not yet done this you can do this here.

You can now create your first device using the wizard to pick the type and traits you need.

When you create the account please use a real email address. This address will only ever be used to allow you to reset your password and to send you messages about the state of the service.

Link Account

Now you have and account you can enable action in the Google Home app and link the account you've just created.

  • First click the "Add" button.

  • Then "Set up device"

  • And next select "Works with Google" and then finally find "NR-GAB" in the list with the following icon.

  • Finally sign in with the username and password you created earlier.

Install Nodes

There are 2 ways to install the required Node-RED nodes.

  • First using the pallet manger

    Search for node-red-contrib-googlehome

  • Second on the command line

    Make sure you are in the Node-RED userDir (normally ~/.node-red) and then run

    npm install node-red-contrib-googlehome

Building Flows

There are 2 nodes available in the pallet, google home and google home response. For most situations you can get away with using the google home as this is the node that output the commands when you ask Google Assistant to do something.

Configure Nodes

When you drag the first Google Home node on to the canvas you will need to create a config node. To do this, click on the pencil icon next to the first input. This will open a new dialog, where you can enter the same username/password from the first step and hit the "Add" button. For all subsequent nodes you should be able to just pick the entry from the drop down that matches your username.

Once you have picked the right config node, after a second or so the list of devices should be populated. If you have recently created or deleted a new device then you can hit the refresh button to the right of the drop down and the node will update it's list from the service.

To start with you should leave the Auto Acknowledge box ticked. This will assume that any incoming command has succeed and report that back to the Google Homegraph1.

The Google Home node will output a message object that looks like the following when a command arrives:

{
  topic: "",
  raw: {},
  payload: {
    command: "action.devices.commands.OnOff",
    params: {
      on: true
    }
  }
}

The msg.payload.command value will be one of the commands identified in the traits identifiers from the Google Smart Home Action API. The msg.payload.params will hold the settings to be updated on the device.

Changing Google Homegraph state without a command