Making Lamps Smart using Sonoff Basic

Why can’t my lights switch themselves on and off?

This was the question I had after falling asleep many times and forgetting to turn my bedroom lamps off. So, I decided to make them smart. How? by adding in an internet connected relay to the cord!

(Note: This guide was published in 2020 and is now likely out of date. Please find a more up-to-date tutorial if any instructions no longer make sense.)

What relay you ask? I chose the Sonoff Basic for these pros:

  1. Cheap
  2. Available in SA
  3. Compatible with Google Home
  4. Can be flashed with custom firmware (eg. Tasmota)

And I calculate that they outweigh the cons:

  1. The cabling for the lamp must be cut and you’ll need to wire in the device.
  2. You’re adding a device that (without being alarmist) will have full access to your network, has a bi-directional communication with a server somewhere¬†and isn’t made by a big tech company known for updates and security. I run a separate network for guests and IoT that mitigates this somewhat.
  3. No native compatibility with Apple HomeKit

And if the cons didn’t scare you away, we move on!

Shopping List (with costs @ 07/12/2019)

  1. Sonoff Basic (I bought 4 @ R120 + R60 Shipping = R540 from SmartKit)

Other Requirements

  1. A WiFi connection with Internet Access
  2. An iOS or Android Device (I used an iPhone X)

Wiring and App Setup

You can find a multitude of guides and videos online that show you to wire the device and setup the eWeLink app that is used to control it.

One such example is the embedded video from Geek Street below:

You may want to Google a more recent video if you are reading this very far in the future as (such is the nature of tech) some steps may have changed and/or been renamed.

Post-Implementation Summary

At this stage I’ve wired lamps in multiple rooms and have been able to control them on on my iPhone locally (when at home) and over the cellular network when away. Using the eWeLink app I’m able to schedule times for on and off as well as (to solve my initial problem) set an “off timer” that I can set and fall asleep knowing that the light will go off itself!

My Smart Home Setup after this Implementation

¬†(How I see the interplay between apps, cloud providers and controlled devices may not and, in some cases, definitely doesn’t reflect reality. I just use it as a handy map.)

The Future

As happy as I am now, I’d love to easily share the control of the lamps with others and be able to control the lamps from all my devices (eWeLink makes that more annoying than it should). Also, integrating it with more established platforms (eg. Apple Homekit and Google Home) will be great once I have more types of smart devices at home. Posts covering these are all in the pipeline so stay tuned. If you have any questions/would like to share your experience with Smart Switches, please leave a reply below. Thanks for reading!

One of the lamps (with the usually hidden Sonoff Basic visible)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑