Can I develop a private action only accessible via my google home or linked account?

醉酒当歌 提交于 2019-11-27 20:43:53

问题


I have raspberry pi controlling my garage door and I want to be able to have an action to open or close it via google home / assistant.

This action is custom and only specific to my needs and I'd like to be able to leverage google to interact with it, but I don't want to publish it for others since it is custom for me. Can this be done? I believe with Alexa it is possible and a quick browse through the docs nothing jumped out at me for this scenario.


回答1:


Unfortunately private stand-alone actions that you can use just on your local devices are not implemented yet. Actions on Google Developers official Google+ community




回答2:


The accepted answer is incorrect as the OP specified publishing isn't required. It also provides a link to a different question, namely whether it's possible to retrieve personal information to use personalized actions per user.

The correct answer is yes, you can create a private action for your Google Home. You can create the action within API.ai and preview it locally on your Google Home also within API.ai. This doesn't publish your action, but rather it allows you to use your created action only on your Google Home. Here's a video that confirms this Actions on Google: Introduction to Conversation Actions

To do this, create your action within API.ai. For a screencast on how to do this, check out this video Actions on Google: Building Assistant Actions using API.AI. When you hit "Preview" in API.ai, your created action will be available in the web simulator and the Google Home device that has the same Google account as the one you're signed into API.ai with.




回答3:


In the gactions cli tool you can change the preview time limit with the '-preview_mins' flag.

D:\test> gactions preview -preview_mins 999999999 -action_package=action.json -invocation_name="my action"
Pushing action 'my action' for testing...
'my action' is now available for you until 3918-04-09 12:01AM CST (a long while from now)

That will give you ~2000 years of 'preview' time.




回答4:


Yes, you can. Here the steps to keep your action private:

  • Download Google gactions cli.
    Note: on Mac and Linux run $chmod +x gactions in a terminal to make the binary executable.
  • Copy the executable inside my_project_dir (your project directory).
  • Initialize gaction, open a terminal and run: $ cd <my_project_dir> $ ./gaction init
  • gaction creates a file named ‘action.json’
  • Open a browser developer console (for Chrome: click the three dots in the upper right corner -> More tools -> Developer Tools ).
  • Click the ‘Network’ tab.
  • Open your API.AI project and open the ‘Integrations’ window.
  • Click “AUTHORIZE” button.
  • Click “PREVIEW” button
  • In the browser developer console inspect the XHR response from: https://console.api.ai/api/agent/googleassistant/preview
  • Copy the content of the response and paste it into the file ‘action.json’
  • Save the file.
  • To set your preview to last forever in a private mode, open a terminal and run $ cd <my_project_dir> $ ./gactions preview -action_package <template_dir>/action.json -preview_mins 999999999 -invocation_name [invocation_name_here]

This command will send the Action (‘action.json’ file, same as the the API.AI project) to your Google Home and will run it as a preview for 999999999 minutes (about 2000 years).

For more detailed information you can follow this tutorial: How to create a custom private Google Home Action with API.AI and Google App Engine




回答5:


One thing you may want to try is using the Assistant IFTTT channel

With it you can register your own, private, voice commands to trigger an IFTTT action, which could be a call to a custom webhook using the Maker channel, which controls your garage door.

The downfall of this method is that it only allows you to register one off commands, you can't implement a whole dialog like this.




回答6:


Only for 30 minutes is my understanding. After 30 minutes you have to refresh the developer mode to get the actions back.




回答7:


If you use Api.ai, you can preview your private actions for up to 30 minutes (default) or extend to up to 24 hours. After this period, your private actions won't be available. Reference: Make google actions development project preview persist longer



来源:https://stackoverflow.com/questions/41052273/can-i-develop-a-private-action-only-accessible-via-my-google-home-or-linked-acco

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!