ProtoSem IoT · Viswes Vijayaragavan Sivakumar · 24BCS321

Task 3 — IFTTT + Adafruit IO Voice Automation

"Okay Google, activate Bulb On": voice control through IFTTT and Adafruit IO, with no firmware changes.

1Overview

Objective. Switch the same bulb by voice: saying "Okay Google, activate Bulb On" turns it on, and "…activate Bulb Off" turns it off.

How. Two IFTTT applets listen for those Google Assistant phrases and write ON or OFF to the bulb-relay feed from Task 2. The ESP32 is already subscribed to that feed, so the bulb reacts with no change to the firmware.

2Concepts

IoT automation

Automation means a device acts on an event without someone pressing its button: a spoken phrase, a time of day, a sensor reading, a message from another service.

What IFTTT is and why it is used

IFTTT ("If This Then That") connects online services with small rules called applets. It already has integrations for Google Assistant and Adafruit IO, so I could join them without writing or hosting any code.

Trigger → action

Every applet has one trigger (the If) and an action (the Then). Here the trigger is Google Assistant's Activate scene with the scene name "Bulb On", and the action is Adafruit IO's Send data to the feed bulb-relay.

Role of Adafruit IO

IFTTT can't reach the ESP32 directly; the ESP32 is behind a home router. Adafruit IO is the meeting point: IFTTT writes to the feed over the internet, and the broker pushes the value to the ESP32 over the MQTT connection it keeps open.

3System Design

Task 3 data flowVoice command"Okay Google,activate Bulb On"Google Assistantscene triggerIFTTT appletIf → ThenAdafruit IOfeed bulb-relayESP32 → relay→ bulbtrigger"ON" / "OFF"MQTT

The trigger reaches the device through three cloud services. The ESP32 only sees the last hop: an MQTT message on bulb-relay.

4Hardware & Software

HardwareSoftware / services
Same rig as Task 2 (ESP32, relay, bulb)IFTTT account with Google Assistant and Adafruit services connected
A phone with Google AssistantAdafruit IO feed bulb-relay
Task 2 firmware, unchanged

5Wiring / Setup

Unchanged from Task 2: relay IN on GPIO26, VCC on VIN, GND to GND, bulb live wire through COM/NO.

6Implementation

No new firmware. The Task 2 sketch already treats "ON" (or "1") as on and anything else as off, so the strings IFTTT sends work as they are:

void handleMessage(AdafruitIO_Data *data) {
  String val = data->value();
  bool on = (val == "1" || val.equalsIgnoreCase("ON"));
  setRelay(on);
}

That is the point of this task: the automation lives in the cloud, and the device stays simple. Full sketch: bulb_v2_adafruitio_relay.ino.

7Configuration

AppletIf (trigger)Then (action)
Bulb OnGoogle Assistant → Activate scene, scene name Bulb OnAdafruit → Send data to Adafruit IO, feed bulb-relay, data ON
Bulb OffGoogle Assistant → Activate scene, scene name Bulb OffAdafruit → Send data to Adafruit IO, feed bulb-relay, data OFF
  1. ifttt.com → Create → If This → Google Assistant → Activate scene → scene name Bulb On.
  2. Then That → Adafruit → Send data to Adafruit IO → feed bulb-relay, data to save ON.
  3. Repeated for Bulb Off / OFF. Both applets show as Connected under My Applets.
My Applets: both applets connected
My Applets: both applets connected

8Evidence

Tested conditions

TestWhat to check
Bulb On, then Bulb OffBulb follows each command
Same command twiceSecond command leaves the bulb as it is
Voice command, then dashboard toggle, then voice againBoth controllers work on the same feed
ESP32 reset while the bulb is onBulb comes back on after reconnecting (last value fetched on boot)

9Challenges & Fixes

Problem. The voice command was not recognised as a scene.

Why. Google Assistant scene names must not include "Ok Google" or "Activate"; the phrase is "Okay Google, activate <scene name>".

Fix. Named the scenes just Bulb On and Bulb Off.

Problem. One applet could not both switch the bulb on and off.

Why. On the free IFTTT plan an applet has one trigger and one action, and the account is limited to two applets.

Fix. Used exactly two applets, one per state, each sending a fixed value (ON or OFF) to the same feed.

Problem. IFTTT sends text, while the dashboard toggle could send numbers.

Why. Different publishers can write different formats to the same feed.

Fix. The firmware accepts both "1" and "ON" (case-insensitive), so every publisher works.

10Reflection

The device didn't need to change to gain a new behaviour. Because the ESP32 only listens to a feed, anything that can write to that feed becomes a controller: a dashboard, a voice assistant, a schedule. The trade-off is that a voice command now depends on Google, IFTTT and Adafruit IO all being up, and the chain adds a noticeable delay compared with the local web server in Task 1.

11Repository Link

Configuration notes and screenshots: https://github.com/TringyTrongy/protosem-iot/tree/main/task3-ifttt-automation · firmware (shared with Task 2): https://github.com/TringyTrongy/protosem-iot/tree/main/task2-adafruit-io-mqtt

✓Checklist coverage

Every item from the IoT Portfolio Guide for this task, and where it is on this page.

Guide itemWhere
Objective of the IoT automation1. Overview
Basic concept of IoT automation2. Concepts
What IFTTT is and why it is used2. Concepts
Trigger → action concept2. Concepts
Role of Adafruit IO in the automation2. Concepts
Hardware and software used4. Hardware & Software
IFTTT applet / workflow created and documented7. Configuration
Trigger used identified7. Configuration
Action performed identified7. Configuration
How the trigger reaches the IoT system3. System Design
Communication / data-flow diagram3. System Design
ESP32 source code6. Implementation
Screenshots of the IFTTT configuration7. Configuration
Screenshots of the Adafruit IO dashboard / feed8. Evidence
Photographs of the working prototype8. Evidence
Automation tested under different conditions8. Evidence
Problems and solutions9. Challenges & Fixes
What I learned about cloud-based automation10. Reflection
Reflection10. Reflection