Overview
Control lights, relays, or any GPIO-connected devices on a Raspberry Pi through natural language conversation. Turn devices on/off, check status, and automate with scheduled jobs. What it does:- Toggle relay or LED on/off via chat
- Control GPIO pins remotely
- Schedule automated on/off times
- Safe, authenticated edge API
Architecture
Complete Implementation
Edge API on Raspberry Pi
Setup (one-time)
Edge API Code
Createedge_api.py:
Run the Edge API
Test Edge API
Lua Agent Implementation
src/tools/SetRelayTool.ts
src/index.ts
Uses LuaAgent with scheduled jobs for automated device control (e.g., turn off lights at night).
Environment Setup
Testing
Test Edge API Directly
Test with Lua
Wiring
Relay Module (Active-Low):Production Deployment
Run Edge API on Boot
Create systemd service/etc/systemd/system/iot-edge.service:
Key Features
Remote Control
Control GPIO devices from anywhere via chat
Secure API
API key authentication protects your edge API
Scheduled Automation
Jobs for automated on/off schedules
Safety First
Confirmation before physical state changes
Next IoT Demo
Greenhouse Climate Monitor
Read temperature, humidity, and pressure from BME280 sensor

