Sign in
Log inSign up
Raspberry Pi Home Automation with Google Assistant integration — Part 3 (Assistant integration)

Raspberry Pi Home Automation with Google Assistant integration — Part 3 (Assistant integration)

Sidhant Panda's photo
Sidhant Panda
·Nov 2, 2018

Part 1: Raspberry Pi Home Automation with Google Assistant integration — Part 1 (Software)

Part 2: Raspberry Pi Home Automation with Google Assistant integration — Part 2 (Hardware)

So up till now you have been able to control the switches with the React based frontend. Time to take things up a little notch. We’ll be integrating Google Assistant to control the services on our Raspberry Pi.

We’ll use IFTTT to setup our trigger statement and have it make an API call to the NodeJS server exposed via ngrok to the world We’ll run ngrok inside a tmux or screen shell as the URL generated for the device changes on every load.

Install tmux $ sudo apt-get install tmux $ tmux new -s ngrok Download the latest ngrok (ARM64 version). Ngrok version at the time of writing this was at bin.equinox.io/a/nmkK3DkqZEB/ngrok-2.2.8-l…

$ unzip /path/to/ngrok.zip $ ./ngrok authtoken <YOUR_AUTH_TOKEN> $ ./ngrok http 80 Take a note of the external HTTPS url generated by ngrok. Now you can detach from tmux by ctrl + bfollowed by d.

Create IFTTT trigger Head over to ifttt.com and sign in /sign up.

Next , authenticate the Google Assistant service with your Google account which you use on your phone or Google Assistant enabled speaker or device.

Once that is done, go the Create Applet and then select Google Assistant service. Select the “Say a simple phrase” trigger.

Screenshot 2018-11-03 at 4.00.46 AM.png

Next, choose the “Webhook” action service and the “Make a web request” action. Screenshot 2018-11-03 at 4.02.36 AM.png

And save the trigger.

And you’re all set! You’ve successfully set up Google Assistant to control your Raspberry Pi and the attached relay module.

Here’s my setup:

Raspberry Pi + Google Assistant Integration

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct