Installing a smart controller (ESP32)

Wire the relay controller, connect it to Wi-Fi and check it is online.

These steps are for the Smart Relay 4CH (ST-R4) and Smart Plug 1CH (ST-R1C3) controllers.

Safety: relays switch mains voltage (230 V). Wiring to mains must be done by a qualified electrician with the power switched off at the breaker. Never touch the board while it is connected to mains.

What you need

  • The controller, its power supply (5 V USB or the supply given with the board).
  • The Wi-Fi name and password of the place (2.4 GHz; 5 GHz-only Wi-Fi does not work).
  • The label with serial and claim code.

Wiring

BoardUse
Relay 1-4 (COM, NO, NC)COM and NO switch the load on when the channel is On. Use NC for "on when the controller is off".
Input 1 (GPIO 32), Input 2 (GPIO 35)Dry contacts (switch, float, door) between the input and GND.
3.3 V / GNDSensor power (DHT22 temperature/humidity on GPIO 4, if fitted).
  • A board relay is usually rated 10 A. Pumps, motors and air-conditioners must be switched through a contactor driven by the relay, never directly.
  • Input 2 (GPIO 35) has no built-in pull-up: fit a 10 kΩ resistor from GPIO 35 to 3.3 V, or that input will report random changes.

Connecting to Wi-Fi

  1. Power the controller. A new controller has no Wi-Fi saved, so it opens its own Wi-Fi called ST-SETUP-xxxx.
  2. Connect your phone to ST-SETUP-xxxx with the password smartthings.
  3. Open http://192.168.4.1 in the phone browser.
  4. Type the Wi-Fi name and password. Leave Server URL and Device token as they are (the factory fills them in), then press Save. The controller restarts.
  5. The blue LED lights when the controller has reached the server.
  6. In the portal, add it with Add device (see Adding a device); it shows Online within a minute.

If the Wi-Fi password is wrong or the router changes, the controller tries three times, then opens ST-SETUP-xxxx again so you can enter the new details.

Warning: the setup Wi-Fi password is the same on every unit. Do the setup and leave; the setup Wi-Fi closes as soon as the controller connects.