Edit 8/3/2022: Something changed on Google's side that caused an odd problem. If my command included a number, it didn't work correctly and asked me to try again. I would repeat the exact same phrase and then it worked correctly. I assumed it was a bug on their end and they would fix it but I got impatient and created a work around. When coming here to post an update it appeared as if my previous files had been removed. No matter, I needed to post new ones anyway. Along with these new files, your Google Cloud Function will need to be updated to use Node 16. (my post on this update: https://forums.homeseer.com/forum/ho...43#post1560543)
Edit 6/7/2019: I've updated this post with new files and screenshots required to enable conversation functionality. If HS returns a response with a ? question mark in it, the Google device will listen again for another command. This is most useful with Jon00's Alexa helper but can also be used to confirm certain HS commands that require confirmation, such as "Run event _____".
Changes include:
1) Update Default Welcome Intent to deselect "Set this intent as end of conversation"
2) Updates to index.js and package.json in the attached zip file
-------------------------------------------------------------------------------------------------------------
It was much harder than it could have been, but I think I figured it out. Here are the steps as best I remember them. If you encounter troubles let me know and I'll amend this as needed.
FYI, I use Jon00's Alexa helper for the custom responses.
This solution utilizes HomeSeer's JSON API for request=voicecommand
1) Create Dialogflow project
2) Under Intents, click "Default Welcome Intent" to edit it. Make it look like this:


3) Now go to the Fulfillment page and enable the inline editor. Paste in the code I supplied in the attached files, after editing the URL and username/password in index.js. I'm using a direct URL to my HS machine, but you should be able to use your MyHS URL as well.
4) Test in Dialogflow to make sure your custom webhook is working correctly (see caveat below about making http calls)
5) Go to Integrations, click on Google Assistant, and then Test. You will be taken to Actions on Google where you can test using the complete Assistant experience. Run some tests
6) Go to Invocation and change Display Name to "HomeSeer". You will get an error. Edit the pronunciation and enter "Home Seer" in two words. The error should go away. Now you can invoke your action using "Tell HomeSeer", "Ask HomeSeer", etc., however you will hear an annoying introductory message about getting your test app. You can get rid of this later by clicking on the Device icon in the Simulator tab located in the upper right to disable testing on your devices. Note: you could choose a different word/name for the Invocation if you wanted to.
7) Go to Release, and Deploy your action to Alpha with you and anyone else that you want as the whitelisted testers. You will need to fill out a bunch of fields elsewhere before it will let you deploy an alpha. I just entered "test" and other garbage information. Nobody should ever see this. When entering testers, copy and email yourself the opt-in link. You will need to open this on a phone with Assistant installed. Do so and accept the Alpha tester status. You may need to wait until the deployment is complete to finish this step. Deployment can take some time.
8) Be sure to disable Device Testing in Actions on Google in the Simulator by clicking on the device icon in the upper right. If this is enabled you will continue to receive the introductory test message when invoking your action.
I think that's it. Let me know if you hit any snags.
Some caveats:
- When you first start using this action, Google may say, "Ok, getting HomeSeer" before starting the action. Once you use the action enough times, this introductory message is removed.
- You need to link a Google billing account to this Google Project before you can make http calls to your HomeSeer machine from the code in the Inline editor. From my understanding, this type of code/traffic will never go beyond the free and/or credited use. I've been using this for months now and have not paid anything.
- You must store a HS username and password in the code in plain text (if someone knows how to obfuscate, please let me know)
- After your command, you will hear a 'ding', the HS response, then another 'ding'. This is to let you know your Action is starting/stopping
- The spoken HS response will not use the typical Assistant voice. You must select 1 from a list in Actions on Google Invocation tab. I disabled the option that only showed US voices so I could select a British GB voice
- I have inadvertently re-enabled device testing by poking around either Dialogflow or Actions on Google, which re-enables that introductory message. I think it is due to the option in Dialogflow under Assistant Integrations that automatically pushes changes. If that happens to you, just return to Actions on Google Simulator tab and disable device testing again.
I hope it works for you. Enjoy!
Edit 6/7/2019: I've updated this post with new files and screenshots required to enable conversation functionality. If HS returns a response with a ? question mark in it, the Google device will listen again for another command. This is most useful with Jon00's Alexa helper but can also be used to confirm certain HS commands that require confirmation, such as "Run event _____".
Changes include:
1) Update Default Welcome Intent to deselect "Set this intent as end of conversation"
2) Updates to index.js and package.json in the attached zip file
-------------------------------------------------------------------------------------------------------------
It was much harder than it could have been, but I think I figured it out. Here are the steps as best I remember them. If you encounter troubles let me know and I'll amend this as needed.
FYI, I use Jon00's Alexa helper for the custom responses.
This solution utilizes HomeSeer's JSON API for request=voicecommand
1) Create Dialogflow project
2) Under Intents, click "Default Welcome Intent" to edit it. Make it look like this:
3) Now go to the Fulfillment page and enable the inline editor. Paste in the code I supplied in the attached files, after editing the URL and username/password in index.js. I'm using a direct URL to my HS machine, but you should be able to use your MyHS URL as well.
4) Test in Dialogflow to make sure your custom webhook is working correctly (see caveat below about making http calls)
5) Go to Integrations, click on Google Assistant, and then Test. You will be taken to Actions on Google where you can test using the complete Assistant experience. Run some tests
6) Go to Invocation and change Display Name to "HomeSeer". You will get an error. Edit the pronunciation and enter "Home Seer" in two words. The error should go away. Now you can invoke your action using "Tell HomeSeer", "Ask HomeSeer", etc., however you will hear an annoying introductory message about getting your test app. You can get rid of this later by clicking on the Device icon in the Simulator tab located in the upper right to disable testing on your devices. Note: you could choose a different word/name for the Invocation if you wanted to.
7) Go to Release, and Deploy your action to Alpha with you and anyone else that you want as the whitelisted testers. You will need to fill out a bunch of fields elsewhere before it will let you deploy an alpha. I just entered "test" and other garbage information. Nobody should ever see this. When entering testers, copy and email yourself the opt-in link. You will need to open this on a phone with Assistant installed. Do so and accept the Alpha tester status. You may need to wait until the deployment is complete to finish this step. Deployment can take some time.
8) Be sure to disable Device Testing in Actions on Google in the Simulator by clicking on the device icon in the upper right. If this is enabled you will continue to receive the introductory test message when invoking your action.
I think that's it. Let me know if you hit any snags.
Some caveats:
- When you first start using this action, Google may say, "Ok, getting HomeSeer" before starting the action. Once you use the action enough times, this introductory message is removed.
- You need to link a Google billing account to this Google Project before you can make http calls to your HomeSeer machine from the code in the Inline editor. From my understanding, this type of code/traffic will never go beyond the free and/or credited use. I've been using this for months now and have not paid anything.
- You must store a HS username and password in the code in plain text (if someone knows how to obfuscate, please let me know)
- After your command, you will hear a 'ding', the HS response, then another 'ding'. This is to let you know your Action is starting/stopping
- The spoken HS response will not use the typical Assistant voice. You must select 1 from a list in Actions on Google Invocation tab. I disabled the option that only showed US voices so I could select a British GB voice
- I have inadvertently re-enabled device testing by poking around either Dialogflow or Actions on Google, which re-enables that introductory message. I think it is due to the option in Dialogflow under Assistant Integrations that automatically pushes changes. If that happens to you, just return to Actions on Google Simulator tab and disable device testing again.
I hope it works for you. Enjoy!
Comment