• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Codemotion Magazine

We code the future. Together

  • Discover
    • Events
    • Community
    • Partners
    • Become a partner
    • Hackathons
  • Watch
    • Talks
    • Playlists
    • Edu Paths
  • Magazine
    • Backend
    • Frontend
    • AI/ML
    • DevOps
    • Dev Life
    • Soft Skills
    • Infographics
  • Talent
    • Discover Talent
    • Jobs
    • Manifesto
  • Companies
  • For Business
  • IT
  • ES
Home » Dev Life » Events » Get More Out of Your Smart Home with Google Home API
Events

Get More Out of Your Smart Home with Google Home API

Ready to tinker with your Google Smart Home? We take a deep dive through the Google API and all you need to integrate your gadgets with Google Assistant

October 19, 2020 by Cate Lawrence

google-home
Table Of Contents
  1. Understanding the Google Smart Home API
  2. Smart Home API: Standard devices and traits
  3. Home Graph
  4. Smart home provider UI components
  5. Voice User Interface platform for the Google Assistant
  6. Looking for more IoT tutorials?
  7. Want to launch a developer event despite the challenges of COVID-19?

IoT is a great opportunity for developers and smart home passionates, wanting to learn how to use electronics in a hands-on way. According to IoT enthusiast Orestes Carracedo: “If you’re a creative developer or a creative person you can do whatever you want to do with electronics. If you’ve never gotten started with electronics, there’s a bunch of kits that you can buy for Arduino and for other open hardware platforms. They are very, very cheap nowadays.”

Orestes Carracedo is the co-founder of Lighthorse Consulting and an enthusiastic IoT hacker. He’s also a consultant, speaker, mentor, and community lead and co-organiser of  GDG Vigo and the VigoTech.org Community Cluster. At Codemotion Madrid last year he took a deep dive through all the pieces you’ll need to integrate your nifty gadgets with the Google Assistant.

He also provided a couple of great demos. This is a basic overview of the tutorial detailed in Orestes’ talk. For the full tutorial and discussion, take a look at the video below:

Loading the player...

Understanding the Google Smart Home API

Google Home is structured in three main components:

  • Google Home/Mobile Device – the surface to interact with the Assistant
  • The Google Assistant – a conversation between you and Google that helps you get things done in your world 
  • Actions on Google – How developers can extend the ecosystem

In the following, we’ll try to understand how such components are used together to form the whole user experience we’re used to when chatting with Google Assistant.

Smart Home API: Standard devices and traits

How do you trust the user voice? How do you understand user voice? How do you extract intent? What do they want to do? So for that we have the Google Platform.

So the Smart Home API knows how about pretty much anything you can think of at the device. You have definitions for starting and stopping, turning on off, changing colour settings with different colour schemes, changing brightness, speed, etc. You can do pretty much whatever!

Home Graph

Smart Home Actions rely on Home Graph, a database that stores and provides contextual data about the home and its devices. The Home Graph database stores information about structures (for example, home or office), rooms (for example, bedroom or living room), and devices (for example speaker and light bulb). For example, Home Graph can store the concept of a home with a living room that contains multiple types of devices from different manufacturers such as a light, television, and speaker.

This information is available to Google Assistant in order to execute user requests based on the appropriate context. State data, such as if a light bulb is on, is not stored in the long term – it’s ephemeral and is only used in the Home Graph.

Home Graph is essentially a logical map of your home. It allows you to have a natural conversation with Google Assistant. If you are sitting in the den and you want to turn the den lights off, you would just say Hey Google, turn off the lights and would not mention the room that you are currently in.

Smart home provider UI components

The UI components available using this platform are two:

  • User registration and authentication (based on Firebase)
  • Device management, allowing you to add additional labels (e..g adding another door, adding another camera, etc.) This usually needs to be configured on a web interface

Voice User Interface platform for the Google Assistant

Let’s see how can we setup our Actions on a Google Project.

First, navigate to https://actions.google.com. From here, log in with your Google Account and then create new Actions on Google Project. Pick any project name you want. You can select any support language.

Setup Google Smart Home API actions

If you get the following screen, click on SKIP on the top right:

Setup Google Smart Home API actions

Make sure you pick the Smart Home template, shown below:

Setup you smart home control

Pick a display name. This will be displayed in your list of Smart Home providers in the Google Home app.

Setup Google Smart Home API actions

Go to the list of actions and click on the only action that shows on the list

In the settings for the action, enter the endpoint URI for your request Firebase Cloud Function:

Create Smart Home actions

Now go the Advanced Options > Account Linking page and select the following options:

Google API: account linking

You can enter any client ID and client secret you want, while for the Authorization URL, use the URL that the Firebase Hosting provided you with Fore the Token

You’re done creating your smart home functionalities!

Now you can ask the Google Assistant to

  • Turn on  the light
  • Turn off the light
  • Set the light to green
  • Set the light to 50%

You should see the logs in the Serial Monitor and your RGB light following your commands.

Looking for more IoT tutorials?

There’s a plethora of great IoT tools and tutorials available to get you started.

IoT

If you are interested, check out some of them in our Codemotion Magazine:

  • Controlling Drones with Javascript
  • Tweet my Wedding dress

We also have our upcoming Codemotion Conference. We’ll gather all IT professionals with different backgrounds and levels of experience providing them with technical excellence, cutting-edge technologies as well as hands-on activities, best practices & case studies.

Want to launch a developer event despite the challenges of COVID-19?

If you want to know more about how modern technologies and tools can support you for – and during – the organisation of a virtual event, don’t miss this article showcasing the best tools we used to host our online conferences since the COVID-19 outbreak.

facebooktwitterlinkedinreddit
Share on:facebooktwitterlinkedinreddit
Of Unicorns in Tech and of the Value of LGBTIQ+
Previous Post
What Are the Main Areas of Development for a Data Analyst’s Career?
Next Post

Related articles

  • Never Be Bored with a Career in IoT
  • How to teach Alexa to pronounce your name
  • Tweet My Wedding Dress
  • IoT Innovation and Bluetooth® mesh networks
  • Smart City: IoT and Microservices to build Oracle Proxima City

Primary Sidebar

Free Whitepaper: The Ultimate Azure Cybersecurity Handbook.

Codemotion Talent · Remote Jobs

Flutter Developer

3Bee
Full remote · Android · Flutter · Dart

Python Back-end Developer

h-trips.com
Full remote · Django · Pandas · PostgreSQL · Python

AWS Cloud Architect

Kirey Group
Full remote · Amazon-Web-Services · Ansible · Hibernate · Kubernetes · Linux

AWS SysOps Administrator

S2E | Solutions2Enterprises
Full remote · Amazon-Web-Services · Terraform · Linux · Windows · SQL · Docker · Kubernetes

Latest Articles

Anche le grandi idee falliscono, tech fails

Tech Fails: When Brilliant Ideas Go Bust

Stories

Javascript color library. Discover how to use it in this guide.

Unsupervised Learning in Python: A Gentle Introduction to Clustering Techniques for Discovering Patterns

Languages and frameworks Machine Learning

Ai and compliance: discover how to solve this common problem with GenerativeShield in this infographics with insights from S2E.

Combining Company Data with Generative Conversational AI Without Losing Privacy and Compliance

Infographics

microservices digital transformation. From monolith to microservices concept.

Why You Need Application Mapping for Your Microservices Applications

Microservices

Footer

  • Magazine
  • Events
  • Community
  • Learning
  • Kids
  • How to use our platform
  • Contact us
  • Become a Contributor
  • About Codemotion Magazine
  • How to run a meetup
  • Tools for virtual conferences

Follow us

  • Facebook
  • Twitter
  • LinkedIn
  • Instagram
  • YouTube
  • RSS

© Copyright Codemotion srl Via Marsala, 29/H, 00185 Roma P.IVA 12392791005 | Privacy policy | Terms and conditions

Follow us

  • Facebook
  • Twitter
  • LinkedIn
  • Instagram
  • RSS