loading...

Google Assistant now supports "Open/Close" devices

samthor profile image Sam Thorogood ・2 min read

Blog-A-Day in June (19 Part Series)

1) Rebuild only when necessary in Node 2) Civilization is a game you never lose 3 ... 17 3) Arrow functions break JavaScript parsers 4) Detecting Select All on the Web 5) Declaring JS Variables in 2019 6) Sam's dotfiles highlights 7) Automate Reading Form Results with 🤖 Chrome 8) Beyond appendChild: Better convenience methods for HTML 9) AMA, Sam 10-yr Googler in Web DevRel 10) Disable a HTML form while in-flight using fieldset 11) PWAs that download like apps 🗜️ 12) Matching elements with selectors in JS 13) Install This PWA To Continue 14) Google Assistant now supports "Open/Close" devices 15) Modern Web Components 16) What To Expect When You're Expecting To Drop IE11 🗑️ 17) Divert Vertical Scroll To The Side ↔️ 18) Graceful Shutdown Is A Lie 19) Progress Indicator With Fetch

Sometime since I wrote this post about using Google Assistant to open and close my garage door, Google has gone through and added a few more device types. 🆕

Go, check out the post!... tl;dr: in my house, you can say "Ok Google, open the garage door" and the door opens. 🏡🎉

IFTTT commands

At the time, I used If-This-Then-That. IFTTT is easy, and it just adds random strings to your Google Assistant "profile" that it can match. Additionally, if your Google Home devices have multiple users on them (which in my case they do: myself and my partner), anyone else can trigger these commands too.

So using IFTTT, you could add a command like "Ok Google, do the dishes" which calls a REST API or anything IFTTT can do. But the major downside of IFTTT is that it has no real notion of 'failure': if your REST API returns a 404/500 etc, IFTTT has no real way to pipe that back to you, and will only say one fixed string.

Assistant Devices

For the more complex approach of devices 'properly' connected to your Assistant account (think light bulbs which are fully integrated into its ecosystem), Google did not yet support the "open" or "close" verbs.

Some folks created posts which talked about how you could control your doors by saying "Ok Google, turn my THING on" or "... THING off" (pretending to be a smart plug), but the verbs don't make sense.

The Plan

So over the next few days, I'll be working out how to emulate a real device that Google knows about, removing IFTTT support from my door, but emulating an attached device. This is possible because Google now supports:

15 👋

Blog-A-Day in June (19 Part Series)

1) Rebuild only when necessary in Node 2) Civilization is a game you never lose 3 ... 17 3) Arrow functions break JavaScript parsers 4) Detecting Select All on the Web 5) Declaring JS Variables in 2019 6) Sam's dotfiles highlights 7) Automate Reading Form Results with 🤖 Chrome 8) Beyond appendChild: Better convenience methods for HTML 9) AMA, Sam 10-yr Googler in Web DevRel 10) Disable a HTML form while in-flight using fieldset 11) PWAs that download like apps 🗜️ 12) Matching elements with selectors in JS 13) Install This PWA To Continue 14) Google Assistant now supports "Open/Close" devices 15) Modern Web Components 16) What To Expect When You're Expecting To Drop IE11 🗑️ 17) Divert Vertical Scroll To The Side ↔️ 18) Graceful Shutdown Is A Lie 19) Progress Indicator With Fetch

Posted on by:

samthor profile

Sam Thorogood

@samthor

Developer Relations for Web at Google.

Discussion

markdown guide