Why Sonoff Is the Backbone of Practical SA Home Automation
If you have spent any time in South African DIY electronics circles, you have seen the white Sonoff enclosures. They hit a sweet spot: affordable ESP8266 or ESP32-based hardware, mains-rated relays, and a straightforward path from stock firmware to fully custom control. For local makers, the appeal goes deeper than price. Most Sonoff devices operate from 100-240V AC, which matches our 230V/50Hz supply, and the eWeLink app works without a dedicated hub. But the real magic starts when you flash them with open-source firmware and integrate them with sensors, logic, and dashboards you control entirely.
In this guide, we walk through three hands-on builds that go beyond a simple app toggle. Each project assumes you have basic soldering skills, a multimeter, and a healthy respect for mains voltage. If you are new to the Sonoff ecosystem, start with the Sonoff brand range to see which models are in stock locally - anything from the basic R2 to the POW R2 with energy monitoring.
Project 1: Geyser Timer with Temperature Feedback
Electric geysers are one of the largest single loads in a South African home. A Sonoff POW R2 (or the newer POW R3) can switch the element and report power consumption, but adding a DS18B20 waterproof temperature sensor gives you real feedback instead of blind scheduling.
What You Need
- Sonoff POW R2 or POW R3 (mains-rated relay with energy monitoring)
- DS18B20 waterproof temperature sensor (TO-92 or stainless probe)
- 4.7kΩ resistor (pull-up for the OneWire bus)
- ESPHome or Tasmota firmware
- 3-core mains cable, geyser-rated enclosure, and cable glands
Wiring and Flashing
Isolate the geyser circuit at the DB board before you touch any wiring. The POW R2 has clearly marked live, neutral, and earth terminals. The DS18B20 connects to the Sonoff's GPIO pins (often GPIO1 or GPIO3 on the ESP8266), with the 4.7kΩ resistor between data and 3.3V. Because the Sonoff sits inside a metal or plastic enclosure, run the sensor cable through a gland and seal it with silicone. Flash the device using a USB-to-serial adapter and the usual header pins - Communica stocks the USB-serial adapters and jumper wires you need.
YAML Logic Example (ESPHome)
Below is a simplified automation that heats the geyser only when the water temperature drops below 45°C and the time is between 05:00 and 06:30. This avoids heating when the geyser is already warm from a previous cycle.
| Component | Configuration |
|---|---|
| sonoff_pow | UART TX/RX pins for flashing |
| dallas | Pin GPIO3, update_interval 60s |
| switch | Relay output, restore_mode ALWAYS_OFF |
| binary_sensor | Temperature threshold 45°C |
With this setup, you can log daily kWh usage and see exactly how much load-shedding shifts your heating schedule. For more sensor options, browse the sensors collection.
Project 2: Offline Load-Shedding Alert with Battery Backup
Load-shedding schedules change constantly, and relying on an internet feed is risky when the power goes out. This project uses a Sonoff Basic R2 flashed with Tasmota, a small 5V relay, and a 12V sealed lead-acid battery to create a local alarm that triggers when grid power fails.
Concept
The Sonoff Basic R2 monitors the mains input via its own power supply. When the grid drops, the ESP8266 loses power - but if you add a small 5V USB power bank or a 12V-to-5V buck converter fed from a battery, the Sonoff stays alive. The firmware detects the loss of mains on a separate GPIO (via an opto-isolated 230V sensor) and triggers a buzzer or flashing LED. You can also send an MQTT message to a local Raspberry Pi dashboard.
Parts and Local Notes
- Sonoff Basic R2 (or Sonoff Mini for zero-neutral installations)
- AC opto-isolator (e.g., H11AA1) and resistors for mains sensing
- 12V 7Ah SLA battery and 12V-to-5V 3A buck converter
- Active buzzer and LED indicators
A common mistake is trying to power the Sonoff from the same mains it is monitoring. During an outage, the Sonoff dies and cannot alert you. The battery-backed approach keeps the logic running. All these parts are available from the power and thermal management range - look for the DC-DC converters and sealed lead-acid batteries.

























