Connecting Google Home with ESP32 via IFTTT enables voice control of your DIY smart home devices without commercial smart home hubs. Google Nest Mini (₹2000–₃000 in India) plus ESP32 (₹250–₅00) creates an affordable, customisable voice-controlled smart home. This tutorial covers three methods: IFTTT Webhooks for simple projects, Home Assistant + Google Home integration, and direct Google Actions SDK for advanced makers.
Table of Contents
- Methods for Google Home ESP32 Integration
- IFTTT + Google Assistant + ESP32
- ESP32 Webhook Server
- Home Assistant + Google Home
- SinricPro with Google Home
- Voice Commands Reference
- India-Specific Use Cases
- Frequently Asked Questions
Methods for Google Home ESP32 Integration
Three approaches, from simplest to most powerful:
- IFTTT + Webhooks: “Hey Google, trigger [applet]” → IFTTT sends HTTP to your ESP32. Simple, free tier available, but adds cloud latency.
- SinricPro: Dedicated service for ESP8266/ESP32 that integrates with both Alexa and Google Home. Free tier available.
- Home Assistant + Nabu Casa: Best integration — full state feedback, all device types supported, works with routines.
IFTTT + Google Assistant + ESP32
Setup steps:
- Create account at ifttt.com (free tier: 3 applets)
- Create New Applet → If: Google Assistant → “Say a specific phrase”
- Set phrase: “turn on the [room] light”
- Then: Webhooks → Make a web request
- URL:
http://your-esp32-ip/light/on(your ESP32 must be accessible from internet) - Method: GET
- For internet access: use ngrok (free) or port forwarding
For local network only (simpler), use Google Home routines with a local Home Assistant server. IFTTT is only needed for internet-accessible ESP32 endpoints.
// ESP32 Web Server for IFTTT Webhooks
#include <WiFi.h>
#include <WebServer.h>
const char* ssid = "YourWiFi";
const char* password = "YourPassword";
WebServer server(80);
#define RELAY_PIN 26
void handleLightOn() {
digitalWrite(RELAY_PIN, HIGH);
server.send(200, "text/plain", "Light turned ON");
}
void handleLightOff() {
digitalWrite(RELAY_PIN, LOW);
server.send(200, "text/plain", "Light turned OFF");
}
void handleStatus() {
String state = digitalRead(RELAY_PIN) ? "ON" : "OFF";
server.send(200, "application/json", "{"light":"" + state + ""}");
}
void setup() {
pinMode(RELAY_PIN, OUTPUT);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) delay(500);
server.on("/light/on", handleLightOn);
server.on("/light/off", handleLightOff);
server.on("/status", handleStatus);
server.begin();
Serial.println("ESP32 ready at: " + WiFi.localIP().toString());
}
void loop() {
server.handleClient();
}
ESP32 Webhook Server
// More complete webhook server with authentication
#include <WiFi.h>
#include <WebServer.h>
#include <ArduinoJson.h>
WebServer server(80);
// Secret token for basic security
const String AUTH_TOKEN = "my_secret_token_2024";
// Device states
bool light1State = false;
bool fan1State = false;
void checkAuth(std::function<void()> handler) {
if (!server.hasHeader("X-Auth-Token") ||
server.header("X-Auth-Token") != AUTH_TOKEN) {
server.send(401, "application/json", "{"error":"Unauthorized"}");
return;
}
handler();
}
void handleControl() {
checkAuth([&]() {
String device = server.arg("device");
String action = server.arg("action");
if (device == "light1") {
light1State = (action == "on");
digitalWrite(26, light1State);
} else if (device == "fan1") {
fan1State = (action == "on");
digitalWrite(27, fan1State);
}
StaticJsonDocument<64> doc;
doc["device"] = device;
doc["state"] = (action == "on");
String response;
serializeJson(doc, response);
server.send(200, "application/json", response);
});
}
// IFTTT Webhook URL example:
// https://YOUR_NGROK.ngrok.io/control?device=light1&action=on
// Headers: X-Auth-Token: my_secret_token_2024
Home Assistant + Google Home
# Most complete integration via Home Assistant:
# 1. Install Home Assistant on Raspberry Pi
# 2. Subscribe to Nabu Casa OR set up free Cloudflare Tunnel
# 3. In HA: Settings → Voice Assistants → Google Home
# Google Home skill configuration in HA:
google_assistant:
project_id: your-google-project-id # From Google Actions Console
service_account: !include SERVICE_ACCOUNT.json
report_state: true
exposed_domains:
- switch
- light
- climate
- fan
entity_config:
switch.living_room_light:
name: "Living Room Light"
room: "Living Room"
climate.bedroom_ac:
name: "Bedroom AC"
room: "Bedroom"
# With this setup:
# "Hey Google, turn on the living room light"
# "Hey Google, set bedroom to 24 degrees"
# "Hey Google, turn off all the fans"
SinricPro with Google Home
#include <ESP8266WiFi.h> // or ESP32WiFi
#include <SinricPro.h>
#include <SinricProSwitch.h>
// SinricPro supports both Alexa AND Google Home
// Same device, same code, both voice assistants work
#define APP_KEY "your-app-key"
#define APP_SECRET "your-app-secret"
#define DEVICE_ID "your-device-id"
bool onPowerState(const String &deviceId, bool &state) {
digitalWrite(26, state);
return true;
}
void setup() {
WiFi.begin("YourSSID", "YourPass");
while (WiFi.status() != WL_CONNECTED) delay(500);
SinricProSwitch &mySwitch = SinricPro[DEVICE_ID];
mySwitch.onPowerState(onPowerState);
SinricPro.begin(APP_KEY, APP_SECRET);
}
void loop() { SinricPro.handle(); }
// Setup:
// 1. Create device at portal.sinric.pro
// 2. Enable both Alexa and Google Home in the SinricPro app
// 3. Link skill in both Alexa and Google Home apps
// 4. Discover devices in both apps
Voice Commands Reference
| Action | Google Home Command |
|---|---|
| Turn on/off | “Hey Google, turn on/off [device name]” |
| Control all in room | “Hey Google, turn off all lights in [room]” |
| Query state | “Hey Google, is the [device] on?” |
| Set temperature | “Hey Google, set [AC name] to 24 degrees” |
| Dim lights | “Hey Google, dim [light] to 50%” |
| Routine trigger | “Hey Google, good night” (custom routine) |
India-Specific Use Cases
- Morning routine: “Hey Google, good morning” → starts geyser, coffee maker, turns on news TV
- Power saving: “Hey Google, save power” → reduces AC temperature, turns off non-essential lights
- Study mode: “Hey Google, start study time” → turns off TV, sets lights to bright, blocks notifications
- Festival lighting: “Hey Google, festive mode” → activates decorative LED strips in specific colour patterns
- Monsoon mode: “Hey Google, monsoon mode” → turns on extra lights, adjusts fan speed for humidity
Frequently Asked Questions
Is IFTTT free for Google Home ESP32 projects in India?
IFTTT free tier allows 3 applets (automations). The Pro plan at ~₹700/year allows unlimited applets. For simple projects (3 devices), the free tier is sufficient. For more complex smart homes, Home Assistant with Google Home integration is better value.
Why is there a 2–3 second delay with IFTTT + Google Home?
IFTTT routes through Google → IFTTT servers → your ESP32, adding cloud latency. This is normal for cloud-based integrations. For instant response, use local integrations (Home Assistant local API) or direct Google Home routines with local IFTTT alternatives like Node-RED.
Does Google Home support Hindi commands for smart home control?
Google Home supports Hindi (हिन्दी) for general commands but smart home device control works best in English. You can set a bilingual configuration in the Google Home app to mix Hindi and English. Device names must be in English or the transliterated version Google can recognise.
My ESP32 IP address changes — how do I keep IFTTT webhook URL working?
Set a static IP for your ESP32 in your router’s DHCP settings (reserve IP based on MAC address). Alternatively, use mDNS: in ESP32, call MDNS.begin("esp32-home") and use esp32-home.local as the hostname in IFTTT URL.
Can I use Google Home with both Alexa for redundancy?
Yes — both can control the same ESP32 devices simultaneously using SinricPro (supports both) or Home Assistant (supports both via separate integrations). Many Indian families have both Google and Amazon Echo devices, and running both is perfectly normal.
Add comment