Search code examples
actions-on-googlegoogle-assistant-sdkgoogle-homegoogle-smart-home

Google Home - Custom device actions


I want to support a custom action (doesn't fall into any category that is listed in the Google's Smart Home SDK) for my device.

For simplicity, let's say my device is a robot which can move. I want to be able to say "Ok, Google, ask Roger to move forward" or "Ok, Google, ask Roger to dance"

This seems to be similar to how Logitech Harmony works - "Ok, Google! ask Harmony to do ..."

But there is no documentation on how / if this is possible.

As an extension, I would like to implement a dialog between Roger and Google Home

User: "Ok, Google! Talk to Roger"    
Google Home: "This is Roger, what do you want me to do?"  
User: "Move left"  
....

I know this dialog can be implemented with DialogFlow but it's not clear to me how it can be driven by actual devices (associated with the account on Google Home).


Solution

  • I think you may be conflating two different types of integrations with the Google Assistant.

    Custom device actions are designed to be ways to extend the Google Assistant when it is embedded in IoT devices. In this manner, if you have a thermal printer, you can tell it to print a star or any other shape.

    If you want all your surfaces to have access to a device, and are not speaking to that device in particular, you can use Actions on Google. In Actions on Google, you develop a webhook that will connect to commands given by a user.

    In your case, you'll want to build an Action. With Dialogflow or another service, you can create intents for movement.

    • Intent - Move
      • User says: "Move left"

    Then you will need to host a webhook that will connects Intent - Move to your device.

    The user interaction becomes as you describe above, where the user talks to the robot through the Google Home or other Assistant surfaces.