Posts: 2
Joined: Wed Sep 13, 2017 2:56 pm

An assistant for Google Home

Wed Sep 13, 2017 7:34 pm

I am new to the forum so this is my first posting.
Over the past few weeks I have been experimenting with getting my Google Home to interact with my own data using a Pi Personal Assistant.

I can now say to my Google Home: "OK Google, ask Pi ----" with questions like "where does someone live" or "tell me the name of someone's children" or "tell me about my home insurance"
After about 20 seconds pi responds with the answer via a small amplified speaker connected to its audio socket.

My solution uses Google Home, IFTTT, a google spreadsheet and Pi2.
My Pi has a usb wifi dongle, a small amplified loudspeaker which plugs into the audio socket and a plug in USB stick.
Pi is running a “start after boot” python script which calls on the Google Sheets API and runs GTTSX and Mplayer.

This has been my first attempt at writing code for Pi and my first time with Python (as I have only ever used Microsoft Basic)
I can provide more info if of interest.

User avatar
Posts: 4540
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: An assistant for Google Home

Thu Sep 14, 2017 1:20 pm

Are the questions sent to the Pi using WebHooks in IFTTT or are you relaying them via the Google spreadsheet ?
Or are the spreadsheet just for storing the answers.

What is GTSSX, when I google that I just get Scrabble hints.

Posts: 2
Joined: Wed Sep 13, 2017 2:56 pm

Re: An assistant for Google Home

Thu Sep 14, 2017 4:39 pm

I am using IFTTT to send the question to the spreadsheet which generates the appropriate response (without using macros) which Pi picks up by polling the spreadsheet with an API call every 2 seconds.

I initially used IFTTT to send the question as the title of an email to my Google Mail Box. I was able to get a push from Gmail to know when Pi should read the email, so avoiding pollingl. It worked fine but I end up with loads of emails and the spreadsheet has the advantage of generating the response.

An oops! on my part. For GTSSX read GTTS! I got it scrambled with PYTTX and ended up with jibberish. Sorry.

Pi notices if the spreadsheet has changed and so says the response using GTTS. (or PYTTX as I have procedures in the code that can use either)
There is a third speech alternative in my code which is to use the calendar API to update a calendar event on the 1st Jan by changing the title of the event to the response text. That way by asking GH what I'm doing on that date it answers without Pi needing to speak.
It works but I don't use it because it can take up to a minute for the API call to update my calendar.

Return to “Other projects”

Who is online

Users browsing this forum: Baidu [Spider] and 15 guests