Linking ChatGPT with Google Home via n8n: Possible?

Hi everyone, I’m trying to set up a cool project but I’m stuck. I want to ask my Google Home to talk to ChatGPT through n8n. The idea is to say “Hey Google, ask GPT” and get a response from ChatGPT.

I’ve got n8n set up with a workflow, an OpenAI key, and a Google cloud account. I’ve done some stuff with certbot and opened ports. I even filled out some OAuth2 configurations on Google’s side, but I’m lost on what scope to use.

Has anyone done this before? Is it even possible now that DiagFlow is gone? I’m not sure if I’m on the right track or if there’s a better way to set it up.

Main questions:

  1. What OAuth scope should I use?
  2. How can I configure n8n to handle voice queries from Google Home devices?

Any tips or guidance would really help. Thanks!

I’ve actually tackled a similar project recently, and it’s definitely possible, albeit with some challenges. Instead of using DiagFlow, I found success with Actions on Google. It allows you to create custom voice commands for Google Home.

For OAuth scopes, you’ll want to use “https://www.googleapis.com/auth/assistant-sdk-prototype” to access the Google Assistant API. This should give you the necessary permissions.

As for configuring n8n, you’ll need to set up a webhook node as an endpoint for your Google Action. Then, create a flow that processes the incoming voice query, sends it to ChatGPT via the OpenAI node, and returns the response.

One tricky part was handling the audio output. I ended up using Text-to-Speech conversion to create an audio file, which I then served back to Google Home.

It’s a complex setup, but once you get it working, it’s pretty impressive. Good luck with your project!

yo, i’ve messed around with similar stuff. actions on google is ur best bet now. for oauth, try ‘https://www.googleapis.com/auth/assistant-sdk-prototype’. in n8n, set up a webhook to catch google home requests. the tricky part is getting the audio back to google home - maybe look into text-to-speech conversion. good luck!

Having worked on integrating various AI models with smart home devices, I can confirm this is achievable, though it requires some workarounds. The key is using Actions on Google to create a custom action for your Google Home. You’ll need to set up a webhook in n8n that acts as an endpoint for this custom action.

For OAuth, the scope ‘https://www.googleapis.com/auth/assistant-sdk-prototype’ should suffice. In n8n, create a workflow that processes incoming voice queries, sends them to ChatGPT, and returns the response. The trickiest part is usually handling the audio response. Consider using a Text-to-Speech service to convert ChatGPT’s text output into audio for Google Home to play back.

Remember to thoroughly test your setup, as latency can be an issue with this kind of integration. Also, be mindful of rate limits on both Google’s and OpenAI’s APIs to avoid disruptions in service.