The question is in the title, but i will give some background information (maybe there is a complete different solution).
I like to talk to my google nest audio (google home) and be able to control / get responses from home assistant.
The problem is not the default google assistant integration. That is working fine (switches are available and i am able to execute scripts (with voice commands)).
What i currently want to do is talking to the home assistant shopping list. But that is just a starting point; if the concept works i can expand the idea and make other questions/actions.
What i have found so far:
Use IFTTT: There were some post on the web that use the IFTTT integration so you can talk to IFTTT and IFTTT will call a home assistant webhook. I got this almost working; looks promissing. But there are few downsizes about this: only 3 recipes are free; only 1 variable can be used; dutch is not supported.
Dialogflow: When i found this; i directly started to build; looks perfect to me. HomeAssistant is also supporting Dialogflow as integration! I already got almost everything running, but i got stuck when i want to enable Dialogflow for my GoogleNestAudio (Google assistant). And i could not found if personal (test) use was free.
Action builder: Somehow i ended up to the actions builder page. Just like the GoogleAssistant integration you needed to make a project; but you don’t choose SmartHome, but Custom. Some blogs on the web tells if you press that button you will be directed to DialogFlow. That was not my case (guess google changed that recently). But from there you get to a page where you can build actions almost like dialogflow. I can now talk to my GoogleNestAudio and get response from ActionBuilder. Action builder can call a webhook. So from there i should be able to do what i want.
However since i saw the Dialogflow intergration support for home assistant i was wondering. Is there also support for ActionBuilder? Or should i be able to use the DialogFlow integration in HomeAssistant combined with ActionBuilder (looks like it does not)? Because HA Dialogflow integration is able to give direct response to the same audio device as you talk to (not sure if i will get that working with a normal webhook integration).
Dialogflow should do the work.
After building all your intents on the Dialogflow console, you have to click on Integrations then you will be able to configure Google Assistant. Click on the link "continue integration.
Click on Manage assistant app, in overview you will have the option to give a name to your app.
Back to the Dialogflow console click test.
After that you will have to says “Hey Google, talk to my app” then you will be able to call your intents.
You can also say “hey google, ask my app” followed by the intent you set, to do so you have to add the sentence “ask my app to…” to the training texts of you intent.
About action builder, I also don’t know if it is usable with Home Assistant but Dialogflow is still working for me.
Thank you for your response.
Welll “Google Assistant” is not listed as integration option (in dialogflow) for me.
Maybe it is only available for a combination of language/country/region or at least not for my combination.
I found it, stuppid me…
Just overlooked the hyperlink… i was thinking that if i clicked it i would migrate my app… therefore i did not even include it in my previous post. But it is right there on the integration page.
Thank you @Nardol
i have added a sensor so it will list all items at one easy to read sensor. Then i added a intent flow that will reponse the value of this sensor in the dialogflow config.
#!/usr/local/bin/python
# coding: utf8
import json
with open('/config/.shopping_list.json') as data_file:
shoppingListData = json.load(data_file)
content = u""
for entry in shoppingListData:
if not entry['complete']:
content += u"%s\n" % entry['name']
print(content)
shoppinglist_info:
speech:
text: >
{% if is_state('sensor.boodschappenlijstje', '') %}
Er staat nog niks op je boodschappenlijstje.
{% else %}
Op het boodschappenlijstje staat {{ states('sensor.boodschappenlijstje') }}
{% endif %}
and i have started to adjust and add services for the shoppinglist component;
so it will uncheck completed items if you add them again
never adds twice the same item
it will only complete items that were yet not completed (so if you have somehow twice the same item, and call complete service twice it will complete both items and not the same item twice)
added service so it will remove items.
and i wanted to add
some logic that if you add “milk” and this already exists it will ask if it should be changed in “milk 2x”
support sorting of items or maybe even better; using a template for sorting (so i can configure the store walking route)
but i paused working on the integration of this; because
there were some other hadware integrations that got my attention
the “test” dialogflow integration is sometimes gone; if a ask Google to talk with “home assistant” it does not repond, i have to go again to the dialogflow page and click “test” to make the service active/available again. But maybe i should publish/release the dialogflow before it will stay alive (haven’t played with this)
i don’t like the flow of Google that i first have to ask Google to talk with “homeassistant” then Google explains it will get the “homeassistant” service, and once it started have to add only “milk”… and yes; you can say “hey Google, add milk to home assistant” and google will then talk about getting the home assistant service and will directly fire the correct intent… however this is still not ideal;
And the last problem; my wife likes the GoogleKeep list, and working together on 1 list is worth something as well… to bad google does not support GoogleKeep as shoppinglist for my country.
Hope this will give you an idea; if i got, one day, a complete working setup; then i will post it.
When I click on continue with the Integration it leads me to the Google Actions console, Test page. I have created an intent and action (and configured the integration within HA), in fact I can test the intent in Dialog Flow page, but I am unable to make it work from Google Assistant…
Apparently I should say something like (by default) “ok google, speak to my test app”. When I say this GA says it will find the latest version of the test app, and then it says it doesn’t respond and I should test later…
I’m working on all this as well (I’ve got things working to my satisfaction in Dialogflow), so…excited to chime in. A few thoughts:
@Doomic it’s not your fault, the path to the Google Assistant is one of the worst UI flows I’ve ever seen. It’s not only hidden but doesn’t even really look like something that can be toggled or enabled. Stupid Google. Or: perhaps it was a conscious choice to do that since Dialogflow is sunsetting next year?
@adumont in my experience sometimes the Google Assistant integration drops or temporarily breaks. And I get “I don’t understand” or just silence after my initial query. I usually wait a bit and it automagically works again later (though as @Doomic mentioned, I have also re-enabled the integration a few times too).
Something I learned from another thread on this topic: a shortcut to running your query is to say, “OK Google, ask [name of your Dialogflow agent] [trigger for your intent]?”
E.g., “OK Google ask the house what’s the temperature in the living room?” instead of, “OK Google talk to the house…[yada yada]…what’s the temperature in the living room?”
Finally: @Doomic as Dialogflow is closing down next year, I’m also wondering if you got everything working through Actions? I’ve poked at it a bit, but not very far. I thought I might have seen something about “webhooks not working/allowed” or perhaps I dreamed it. Curious what you know!
Oh actually one more question. I’m trying to wrap my brain around the “text” field that we populate in the “intent_script” integration. Specifically: things work great as long as (a) you follow jinja2 syntax and whatever you enter resolves to something printable/speakable, and (b) that includes of course all our sensor attributes and states. But…I wonder if some variation of templating works so that, e.g., a command is kicked off that resolves in a text response. Like: a command-line sensor that triggers an API call that returns a joke-of-the-day.
Oh wait, I think I figured it out…or at least…a command-line sensor has a scan interval so basically it’s state is always available and the text field will simply read it. Hmmm…the question still stands…could we insert a template that triggers a one-time action?