Custom commands for Google Assistant SDK












0















I've got a raspberry pi running the Google Assistant SDK, and it's working amazingly so far. I'm just wondering how I could make custom commands for the assistant, that would then trigger bash commands on the pi.
Any help would be greatly appreciated.










share|improve this question



























    0















    I've got a raspberry pi running the Google Assistant SDK, and it's working amazingly so far. I'm just wondering how I could make custom commands for the assistant, that would then trigger bash commands on the pi.
    Any help would be greatly appreciated.










    share|improve this question

























      0












      0








      0








      I've got a raspberry pi running the Google Assistant SDK, and it's working amazingly so far. I'm just wondering how I could make custom commands for the assistant, that would then trigger bash commands on the pi.
      Any help would be greatly appreciated.










      share|improve this question














      I've got a raspberry pi running the Google Assistant SDK, and it's working amazingly so far. I'm just wondering how I could make custom commands for the assistant, that would then trigger bash commands on the pi.
      Any help would be greatly appreciated.







      raspberry-pi google-assistant-sdk






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 2 '17 at 7:37









      DigitonDigiton

      1412




      1412
























          2 Answers
          2






          active

          oldest

          votes


















          1














          As far as i know what you are looking for is more complicated than that.
          the assistant does not have direct access to its environment where it's installed.



          So if it's on your phone you cannot just run something on the phone directly.



          what you're looking for is to create an action on google:




          • https://console.actions.google.com


          the action on google that you will create will be triggered with your command on the assistant then it will it self trigger a webhook (function running in the cloud) hosted possibly in your pi (if you have a web server that you can access publicly) and then from there you can run whatever script you are talking about.
          i have done that using my:




          • google home ==> actions on google ==> api.ai ==> raspberrypi ==> run action


          feel free to ask if you have any thing unclear.






          share|improve this answer
























          • I've heard of the webhooks approach, but I have no idea how to get that to work. Is there any tutorial I could follow, maybe? Thanks for responding, by the way.

            – Digiton
            Aug 3 '17 at 10:34











          • yes, but first let me give you a quick explanation on how it work: you create a google action on console.actions.google.com Once done you need something for NLP (natural language processing) which in my case is API.ai and it's a google product. then from there API.ai you have a section called fulfillment where you specify a url for a backend (webhook) that will make some computation for you and comeback with an anwser that will be sent to your google assistant device to host your fulfilment locally search for ngrok the video that i used: youtube.com/watch?v=Y26vvxCb3zE

            – Ayoub
            Aug 4 '17 at 11:11











          • I cannot accept that it is this complicated. They have this demo included in the code. I just haven't managed to get it to work. github.com/google/aiyprojects-raspbian/blob/aiyprojects/src/…

            – Bruno Bronosky
            Dec 30 '17 at 19:25











          • Give my answer a shot and tell me if it can be used to do what you need. stackoverflow.com/a/48047201/117471

            – Bruno Bronosky
            Jan 1 '18 at 4:47



















          1














          You can add your own functions, call external commands, etc. using the pattern in assistant_library_with_local_commands_demo.py from the aiyprojects-raspbian project on GitHub. Here is a commit where I add my own custom local commands to Google Assistant.



          You do have to jump through the hoops to use the Cloud Speech API, but it's still using the Google Assistant. You don't have to use "actions on Google" stuff described by @Ayoub above.



          Note: If you fail to include the assistant.stop_conversation() as I first did,
          you get a weird response with 2 voices talking to you.






          share|improve this answer

























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f45454415%2fcustom-commands-for-google-assistant-sdk%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            As far as i know what you are looking for is more complicated than that.
            the assistant does not have direct access to its environment where it's installed.



            So if it's on your phone you cannot just run something on the phone directly.



            what you're looking for is to create an action on google:




            • https://console.actions.google.com


            the action on google that you will create will be triggered with your command on the assistant then it will it self trigger a webhook (function running in the cloud) hosted possibly in your pi (if you have a web server that you can access publicly) and then from there you can run whatever script you are talking about.
            i have done that using my:




            • google home ==> actions on google ==> api.ai ==> raspberrypi ==> run action


            feel free to ask if you have any thing unclear.






            share|improve this answer
























            • I've heard of the webhooks approach, but I have no idea how to get that to work. Is there any tutorial I could follow, maybe? Thanks for responding, by the way.

              – Digiton
              Aug 3 '17 at 10:34











            • yes, but first let me give you a quick explanation on how it work: you create a google action on console.actions.google.com Once done you need something for NLP (natural language processing) which in my case is API.ai and it's a google product. then from there API.ai you have a section called fulfillment where you specify a url for a backend (webhook) that will make some computation for you and comeback with an anwser that will be sent to your google assistant device to host your fulfilment locally search for ngrok the video that i used: youtube.com/watch?v=Y26vvxCb3zE

              – Ayoub
              Aug 4 '17 at 11:11











            • I cannot accept that it is this complicated. They have this demo included in the code. I just haven't managed to get it to work. github.com/google/aiyprojects-raspbian/blob/aiyprojects/src/…

              – Bruno Bronosky
              Dec 30 '17 at 19:25











            • Give my answer a shot and tell me if it can be used to do what you need. stackoverflow.com/a/48047201/117471

              – Bruno Bronosky
              Jan 1 '18 at 4:47
















            1














            As far as i know what you are looking for is more complicated than that.
            the assistant does not have direct access to its environment where it's installed.



            So if it's on your phone you cannot just run something on the phone directly.



            what you're looking for is to create an action on google:




            • https://console.actions.google.com


            the action on google that you will create will be triggered with your command on the assistant then it will it self trigger a webhook (function running in the cloud) hosted possibly in your pi (if you have a web server that you can access publicly) and then from there you can run whatever script you are talking about.
            i have done that using my:




            • google home ==> actions on google ==> api.ai ==> raspberrypi ==> run action


            feel free to ask if you have any thing unclear.






            share|improve this answer
























            • I've heard of the webhooks approach, but I have no idea how to get that to work. Is there any tutorial I could follow, maybe? Thanks for responding, by the way.

              – Digiton
              Aug 3 '17 at 10:34











            • yes, but first let me give you a quick explanation on how it work: you create a google action on console.actions.google.com Once done you need something for NLP (natural language processing) which in my case is API.ai and it's a google product. then from there API.ai you have a section called fulfillment where you specify a url for a backend (webhook) that will make some computation for you and comeback with an anwser that will be sent to your google assistant device to host your fulfilment locally search for ngrok the video that i used: youtube.com/watch?v=Y26vvxCb3zE

              – Ayoub
              Aug 4 '17 at 11:11











            • I cannot accept that it is this complicated. They have this demo included in the code. I just haven't managed to get it to work. github.com/google/aiyprojects-raspbian/blob/aiyprojects/src/…

              – Bruno Bronosky
              Dec 30 '17 at 19:25











            • Give my answer a shot and tell me if it can be used to do what you need. stackoverflow.com/a/48047201/117471

              – Bruno Bronosky
              Jan 1 '18 at 4:47














            1












            1








            1







            As far as i know what you are looking for is more complicated than that.
            the assistant does not have direct access to its environment where it's installed.



            So if it's on your phone you cannot just run something on the phone directly.



            what you're looking for is to create an action on google:




            • https://console.actions.google.com


            the action on google that you will create will be triggered with your command on the assistant then it will it self trigger a webhook (function running in the cloud) hosted possibly in your pi (if you have a web server that you can access publicly) and then from there you can run whatever script you are talking about.
            i have done that using my:




            • google home ==> actions on google ==> api.ai ==> raspberrypi ==> run action


            feel free to ask if you have any thing unclear.






            share|improve this answer













            As far as i know what you are looking for is more complicated than that.
            the assistant does not have direct access to its environment where it's installed.



            So if it's on your phone you cannot just run something on the phone directly.



            what you're looking for is to create an action on google:




            • https://console.actions.google.com


            the action on google that you will create will be triggered with your command on the assistant then it will it self trigger a webhook (function running in the cloud) hosted possibly in your pi (if you have a web server that you can access publicly) and then from there you can run whatever script you are talking about.
            i have done that using my:




            • google home ==> actions on google ==> api.ai ==> raspberrypi ==> run action


            feel free to ask if you have any thing unclear.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 2 '17 at 13:32









            AyoubAyoub

            629




            629













            • I've heard of the webhooks approach, but I have no idea how to get that to work. Is there any tutorial I could follow, maybe? Thanks for responding, by the way.

              – Digiton
              Aug 3 '17 at 10:34











            • yes, but first let me give you a quick explanation on how it work: you create a google action on console.actions.google.com Once done you need something for NLP (natural language processing) which in my case is API.ai and it's a google product. then from there API.ai you have a section called fulfillment where you specify a url for a backend (webhook) that will make some computation for you and comeback with an anwser that will be sent to your google assistant device to host your fulfilment locally search for ngrok the video that i used: youtube.com/watch?v=Y26vvxCb3zE

              – Ayoub
              Aug 4 '17 at 11:11











            • I cannot accept that it is this complicated. They have this demo included in the code. I just haven't managed to get it to work. github.com/google/aiyprojects-raspbian/blob/aiyprojects/src/…

              – Bruno Bronosky
              Dec 30 '17 at 19:25











            • Give my answer a shot and tell me if it can be used to do what you need. stackoverflow.com/a/48047201/117471

              – Bruno Bronosky
              Jan 1 '18 at 4:47



















            • I've heard of the webhooks approach, but I have no idea how to get that to work. Is there any tutorial I could follow, maybe? Thanks for responding, by the way.

              – Digiton
              Aug 3 '17 at 10:34











            • yes, but first let me give you a quick explanation on how it work: you create a google action on console.actions.google.com Once done you need something for NLP (natural language processing) which in my case is API.ai and it's a google product. then from there API.ai you have a section called fulfillment where you specify a url for a backend (webhook) that will make some computation for you and comeback with an anwser that will be sent to your google assistant device to host your fulfilment locally search for ngrok the video that i used: youtube.com/watch?v=Y26vvxCb3zE

              – Ayoub
              Aug 4 '17 at 11:11











            • I cannot accept that it is this complicated. They have this demo included in the code. I just haven't managed to get it to work. github.com/google/aiyprojects-raspbian/blob/aiyprojects/src/…

              – Bruno Bronosky
              Dec 30 '17 at 19:25











            • Give my answer a shot and tell me if it can be used to do what you need. stackoverflow.com/a/48047201/117471

              – Bruno Bronosky
              Jan 1 '18 at 4:47

















            I've heard of the webhooks approach, but I have no idea how to get that to work. Is there any tutorial I could follow, maybe? Thanks for responding, by the way.

            – Digiton
            Aug 3 '17 at 10:34





            I've heard of the webhooks approach, but I have no idea how to get that to work. Is there any tutorial I could follow, maybe? Thanks for responding, by the way.

            – Digiton
            Aug 3 '17 at 10:34













            yes, but first let me give you a quick explanation on how it work: you create a google action on console.actions.google.com Once done you need something for NLP (natural language processing) which in my case is API.ai and it's a google product. then from there API.ai you have a section called fulfillment where you specify a url for a backend (webhook) that will make some computation for you and comeback with an anwser that will be sent to your google assistant device to host your fulfilment locally search for ngrok the video that i used: youtube.com/watch?v=Y26vvxCb3zE

            – Ayoub
            Aug 4 '17 at 11:11





            yes, but first let me give you a quick explanation on how it work: you create a google action on console.actions.google.com Once done you need something for NLP (natural language processing) which in my case is API.ai and it's a google product. then from there API.ai you have a section called fulfillment where you specify a url for a backend (webhook) that will make some computation for you and comeback with an anwser that will be sent to your google assistant device to host your fulfilment locally search for ngrok the video that i used: youtube.com/watch?v=Y26vvxCb3zE

            – Ayoub
            Aug 4 '17 at 11:11













            I cannot accept that it is this complicated. They have this demo included in the code. I just haven't managed to get it to work. github.com/google/aiyprojects-raspbian/blob/aiyprojects/src/…

            – Bruno Bronosky
            Dec 30 '17 at 19:25





            I cannot accept that it is this complicated. They have this demo included in the code. I just haven't managed to get it to work. github.com/google/aiyprojects-raspbian/blob/aiyprojects/src/…

            – Bruno Bronosky
            Dec 30 '17 at 19:25













            Give my answer a shot and tell me if it can be used to do what you need. stackoverflow.com/a/48047201/117471

            – Bruno Bronosky
            Jan 1 '18 at 4:47





            Give my answer a shot and tell me if it can be used to do what you need. stackoverflow.com/a/48047201/117471

            – Bruno Bronosky
            Jan 1 '18 at 4:47













            1














            You can add your own functions, call external commands, etc. using the pattern in assistant_library_with_local_commands_demo.py from the aiyprojects-raspbian project on GitHub. Here is a commit where I add my own custom local commands to Google Assistant.



            You do have to jump through the hoops to use the Cloud Speech API, but it's still using the Google Assistant. You don't have to use "actions on Google" stuff described by @Ayoub above.



            Note: If you fail to include the assistant.stop_conversation() as I first did,
            you get a weird response with 2 voices talking to you.






            share|improve this answer






























              1














              You can add your own functions, call external commands, etc. using the pattern in assistant_library_with_local_commands_demo.py from the aiyprojects-raspbian project on GitHub. Here is a commit where I add my own custom local commands to Google Assistant.



              You do have to jump through the hoops to use the Cloud Speech API, but it's still using the Google Assistant. You don't have to use "actions on Google" stuff described by @Ayoub above.



              Note: If you fail to include the assistant.stop_conversation() as I first did,
              you get a weird response with 2 voices talking to you.






              share|improve this answer




























                1












                1








                1







                You can add your own functions, call external commands, etc. using the pattern in assistant_library_with_local_commands_demo.py from the aiyprojects-raspbian project on GitHub. Here is a commit where I add my own custom local commands to Google Assistant.



                You do have to jump through the hoops to use the Cloud Speech API, but it's still using the Google Assistant. You don't have to use "actions on Google" stuff described by @Ayoub above.



                Note: If you fail to include the assistant.stop_conversation() as I first did,
                you get a weird response with 2 voices talking to you.






                share|improve this answer















                You can add your own functions, call external commands, etc. using the pattern in assistant_library_with_local_commands_demo.py from the aiyprojects-raspbian project on GitHub. Here is a commit where I add my own custom local commands to Google Assistant.



                You do have to jump through the hoops to use the Cloud Speech API, but it's still using the Google Assistant. You don't have to use "actions on Google" stuff described by @Ayoub above.



                Note: If you fail to include the assistant.stop_conversation() as I first did,
                you get a weird response with 2 voices talking to you.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 1 '18 at 20:21

























                answered Jan 1 '18 at 4:46









                Bruno BronoskyBruno Bronosky

                34.8k47984




                34.8k47984






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f45454415%2fcustom-commands-for-google-assistant-sdk%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

                    Alcedinidae

                    Origin of the phrase “under your belt”?