project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

Smart Home Agent

Smart Home Agent is a fully on-chain smart agent IOT application deployed on the Galadriel chain. Users can control devices in their home with a simple chat interface through the website and Converse App powered by XMTP Message Kit.

Smart Home Agent

Created At

ETHOnline 2024

Winner of

trophy

Messaging Mini apps (Bot, Agents & Frames)

Project Description

Smart Home Agent is a fully on-chain IoT application deployed on the Galadriel chain, allowing users to control devices in their homes through a simple chat interface available on the website and the Converse App, powered by XMTP Message Kit.

Devices are registered on a SmartHomeRegistry smart contract on the Galadriel chain, which is responsible for managing device states and generating system database prompts.

When a user submits a prompt, the smart contract prepends a system prompt that provides ChatGPT with the current state of the devices. The oracle then submits the response back to the smart contract. If the response starts with "TGLOON," the light will be turned on; if it starts with "TGLOFF," the light will be turned off for the specified room.

Turning the light on and off involves emitting event on the smart contract, and a relayer will forward these emitted events to the XMTP address associated with each IoT device, which then reacts to turn the light on or off physically.

Users can also interact with the system via Converse by sending prompts to our XMTP relayer address, which submits the prompt to the contract on Galadriel.

How it's Made

This project, Smart Home Agent, leverages several cutting-edge technologies to create a fully on-chain IoT system for home automation. The following are the technical details that make up its architecture:

Technologies Used: Galadriel Chain: The backbone of the system, Galadriel chain is a decentralized blockchain platform used to deploy smart contracts. All device interactions and control commands are handled via smart contracts deployed on this chain.

Smart Contracts: We created a SmartHomeRegistry smart contract responsible for storing the states of registered devices and generating relevant prompts for system interaction. This contract acts as the core controller of the home automation logic, managing all device data and interactions.

XMTP Protocol: XMTP (Extensible Message Transport Protocol) is integrated for messaging between users and IoT devices. The messaging interface is accessible through the Converse App, allowing seamless communication between the user’s prompts and the IoT devices via the on-chain system.

XMTP Message Kit: The message kit is employed to bridge communications between the user interface (chat-based) and the smart contract. It provides a chat-like experience for users to control devices, which abstracts away the underlying blockchain complexity.

Oracles: An oracle is used to bridge off-chain data (prompts and responses) with the on-chain smart contract. When a user submits a control prompt, the oracle fetches the latest device states from the smart contract, prepends this to the user’s prompt, and then forwards it to ChatGPT. The oracle also processes the returned response and triggers actions on the smart contract, such as emitting events for device control.

Relayer: A relayer service is employed to forward emitted events from the smart contract to the respective XMTP addresses linked to IoT devices. This ensures that when a response from ChatGPT starts with "TGLOON" or "TGLOFF," the appropriate IoT device (in this case, a light) is turned on or off physically in the user's home.

Project Benefits: Partnering with XMTP provided an essential messaging layer that allowed us to bypass complex UI and focus on chat-based interactions. This also offered seamless integration into the Converse App, allowing users to access home automation features without navigating traditional IoT interfaces. Galadriel Chain was chosen for its decentralized and efficient contract deployment, ensuring the entire system remains transparent and tamper-proof. Hacky Details: One of the key innovations in this project was using the ChatGPT response system to control device states. The SmartHomeRegistry contract dynamically prepends the current state of devices to each prompt, ensuring that ChatGPT makes contextually aware decisions based on real-time information. This allowed us to build a smart system without requiring extensive AI training. We also introduced a simple event-driven architecture where device control is dictated purely through text-based commands ("TGLOON" and "TGLOFF"). While this seems basic, it allowed us to streamline the communication process between smart contracts and IoT devices via the XMTP protocol. By blending blockchain, messaging, and IoT, Smart Home Agent represents a novel approach to home automation that stays fully on-chain while offering users an intuitive chat interface

background image mobile

Join the mailing list

Get the latest news and updates