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

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.

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.

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.

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

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

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.

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

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

Related

Share button not found (anymore) in Google smart home action test simulator

We are developing a google smart home action. As per this and this guides we added testers as viewer and shared action and it worked few months ago. Now we don't see this share button in our simulator anymore. Wonder how to share with testers anymore? As guides still wants us to share the project through this button.
Screenshot from documentations:
Screenshot of my simulator:
We are able to add the tester in IAM project, but tester is unable to see the action like owner does ([test] ABC agent) in google assistant app.
Edit 1:
It doesn't work even sharing an action with owner rights. Second user is unable to see that action in Home Control under google assistant app
As per discussion with 'Actions on Google Support Team' they say that "There has been a slight modification on the interface in the simulator page. Unfortunately, the current documentation hasn't been updated yet to reflect this change."
You can still share your Action without the share button. To recap:
Go to the Actions console and select your project.
In the right navigation menu, select the three dot icon and then Manage User Access.
This redirects you to the IAM page for your project.
Click ADD to set a team member's access to your project. You must be an owner of the project.
Type the member's email address in the Members box. To assign view access, from the Roles menu, select Project and then Viewer. The members you add will be able to see the Action on their console. Please note that the system does not proactively notify the added members.
Tester/Viewer will have to login in to console and Enable testing in simulator to see the action in Google Assistant App.
Happy Coding !

Whitelisted user cannot open opt-in link

I have published an alpha version of my action quite a while ago. I'm trying to determine the bare minimum to get it visible to testers.
I have whitelisted the one email account I had created for this test.
If I add them and send them the opt in link, it opens a page with the title "null" and says something along the lines of "we can't find what you're looking for..."
If I open the same link as the owner of the action it works fine.
What do I need to do to enable white listed users to access the action on their devices?
The link must be opened on a mobile device that has the Assistant installed. It can't be opened on the web. (The Assistant is the one that actually needs to go to the page - not a browser.)
The approach I usually use is:
In the Assistant, make sure it is set to the account you want to use. I usually go to the "Explore" screen and click my user avatar in the upper right to set it to the right one.
Send the link to the authorization page via email, hangouts, or some other chat.
Open that link by clicking on it. If you're prompted for an app to use to open the link, select Google or Google Assistant.

Where can you find your actions in google-home app which is not deployed but still in development phase

I am developing actions for google home. It is still in development phase. I have developed music actions and the songs are playing fine in google-home. I am performing account linking which is also working properly by getting account linking card in home page of google home app. All I want to know is where can i find my actions in google-home app where i can see link/unlink buttons to my actions.
Like in Alexa app i was able to see my skills in your skills -> dev skills section. Is there any way in google-home app like this where i can link/unlink actions. I have checked but i am not able to find this.
You will need to look the Actions Directory. On your phone, you can search and find the action, and then see specific controls for the action like unlinking and clearing user storage.

DialogFlow: Google Calendar Event function from Google Actions (Oauth2)?

I have created an agent in DialogFlow that interacts with the user giving her the ability to check for details like demographic from a back-end database. I have achieved this using Fulfillment/Webhook calls and have successfully parsed/returned different types of Responses to the user to play with. I have tested this on both an Android device and the Google Actions Simulator.
Now, what I want to achieve is to give user the ability to "Set a Reminder" on a platform like Google Calendar or similar through my App. By default, Google Assistant does this by simply telling it to "remind me..." and Google creates a reminder in the calendar. But as soon as I invoke my app, the Assistant is out of scope so using the "remind me" command won't work. I want to use the Google Calendar for example to create a reminder through my agent so that the user is notified at the due time.
I understand that when the user invokes an App in Google Assistant, she is using her Google credentials so I guess if I want to use the App to create a reminder, I should have the option. I have had a look at the Calendar API but I am not sure if I should proceed that way. Is there a better way of achieving this?
Please note, I want to use a reminder service that is available to the user without subscribing to a third-party service.
The Calendar API is the way to go. Details here.
In those docs you'll see reference to the access token, which you can get by using the helper intent askForSignIn (example of use here in one of Google's example projects).
Hope this helps!
So for all those who are facing the same issue, here is what I did:
First created an account on https://auth0.com
Followed this guide to configure the necessary settings to link to Google Assistant (ignored the Jovo part)
Used Auth0 guide to configure and link to my Google project credentials (ignored the Admins SDK Service part)
Now when I run my Google Actions App on the device, a button "Link [App Name] to Google" showed up. Clicking on that "signed me in".
Parsed the response in my webhook to grab originalRequest.data.user.accessToken
This is the token mentioned in #lukedavis answer. The next step was to use the token to execute a call to the Calendar API. Upon trying that, I am facing a different problem which I am trying to find the solution for. But the above should assist those who wish get the accessToken.

Desktop notifications from GitHub

How can I get a desktop notification when new pushes appear at projects which I select?
Any RSS reader should do.
Go to your dashboard page on GitHub where it says "your news feed" - in the upper right corner is the orange rss icon with the text "News Feed", that you can subscribe to.
Axibase has designed a great little tool which leverages GitHub Webhook functionality to send desktop notifications via the messenger service of your choice. The basic mechanics of the tool are shown in the workflow below, and this guide will take you through the process step by step.
The configuration should only take about 10 minutes and the notifications can be sent anywhere the supported messenger service is installed, be it your desktop or smartphone.
Good luck!
(Full disclosure, I work for the team that designed ATSD which is the database that supports this tool)