Search code examples
node-redgoogle-assistant-sdkgoogle-home

Simple phrase passed from google assistent as a webhook, then node red logic


I have node red sercer that handles my home automation. I have also 3 google speakers (1 hub a 2 mini). I want to be able to say some phrases in google assistent, and he should pass them as a webhook to designated URL. Node red will do the rest. Node red part is easy, but I cant figure out google assisten part. I can do that with IFTTT but I dont want to use it, raw google integration seems to be better practice. Can You help me with that?


Solution

  • So you can't teach your Google Assistant device itself to respond to a phrase and send it to your webhook. You can create an Action for Google Assistant that functions just like an app on your phone. You teach this action to respond to certain phrases when someone interacts with your action.

    You can choose between two types of Actions:

    • Conversational Actions: Designed around a conversation.
    • Smart Home Action: Designed around command based interactions and smart home devices

    Depending on which types on conversations you wish to make, you can choose one or the other. By the sound your description a conversational action would be preferred as you are only sending data to a webhook and you aren't interacting with a smart home device directly.

    To send the data, your Action can also use a webhook. It can't directly connect to your node red webhook, because the actions requires code that handles the information from the device. Using one of Googles code libraries you can then make HTTP calls or whatever you need for Node Red via code and make Node Red handle it.