← Skill library
home

Household Switches

Switch real lights, fans and plugs by voice

Download v1.0.0 6.0 KB · .zip

Install from your dashboard:
Library → Install skill → upload this file.

Wire an ESP32 to a relay module and Jarvis can switch anything mains-powered -- lights, fans, plugs -- by voice, in English, Hinglish or Hindi. Onboard as many boards as you like from the dashboard; naming a switch there changes what the voice command means immediately, with no reflash.

What it does

  • Turns named switches on and off, individually or all at once
  • Reads names from your own registry, so 'bedroom light' means whatever you called it
  • Runs on a deterministic local fast path -- typically ~0.03s, and works with no internet

Things you can say

“turn on the bedroom light” “switch on the hall light” “bedroom light on karo” “pankha chala do” “geyser on kar do” “लाइट ऑन करो”

Hardware you need

  • ESP32-S3-WROOM-1 or classic ESP32 (WROOM-32) devkit

    Both are supported. The dashboard prints the exact GPIO for each relay once you pick the board type.

  • Relay module (1, 2, 4, 8 or 16 channel)

    Opto-isolated boards are strongly preferred when switching mains.

  • 5V power supply for the relay board

    Power the ESP32 from its own clean supply and share only ground -- see the note below.

  • USB cable (data, not charge-only)

    Only needed for the one-time flash. After that the board runs over WiFi.

Supported boards & pins

These GPIO numbers come from the same table the firmware is compiled from, so what you see here is what the board actually drives.

ESP32-S3 (WROOM-1) esp32:esp32:esp32s3

The newer board. Often has two USB ports -- see the note below.

1GPIO4 2GPIO5 3GPIO6 4GPIO7 5GPIO15 6GPIO16 7GPIO17 8GPIO18 9GPIO8 10GPIO9 11GPIO10 12GPIO11 13GPIO12 14GPIO13 15GPIO14 16GPIO21

Relay 1 uses the first pin, relay 2 the second, and so on.

ESP32 (classic WROOM-32 devkit) esp32:esp32:esp32

The older, wider devkit with a single micro-USB port.

1GPIO23 2GPIO22 3GPIO21 4GPIO19 5GPIO18 6GPIO17 7GPIO16 8GPIO4 9GPIO13 10GPIO14 11GPIO25 12GPIO26 13GPIO27 14GPIO32 15GPIO33

Relay 1 uses the first pin, relay 2 the second, and so on.

Firmware

relay_board.ino

Flashed for you from the dashboard's Relays page -- you do not need the Arduino IDE.

Download sketch

Setting it up

  1. Open the Relays page in your dashboard and plug the board in over USB.
  2. Pick your board type and how many relays it has. The page prints the exact GPIO for each one.
  3. Wire the relay INs to those GPIOs, and share a common ground with the ESP32.
  4. Give each relay a name (and a room, e.g. name 'light', room 'bedroom').
  5. Flash from the page, test each relay while still on the cable, then unplug and run it from any adapter.
Worth knowing

Your ESP32 must join a 2.4GHz network -- ESP32s cannot see 5GHz at all. Onboarding checks this and reads the board's own verdict back over USB, so a wrong password fails in about 20 seconds instead of becoming a board that mysteriously never appears.