Cheap Homekit Relay With The Sonoff Basic

sonoff basic

If you are anything like me then you have tried to automate everything everything in your house. As someone who's family lives in the iOS ecosystem, using anything but Apple's Homekit isn't an option.

Homebridge is an open source project written in NodeJS that runs on your home network and interfaces with Apple's Homekit by emulating its API. Homebridge's GitHub wiki page has great instructions on getting Homebridge up and running on a Raspberry Pi.

The Sonoff units come pre flashed with their own code to be used with their EWlink app system. That can easily be changed.

At the heart of the Sonoff is the maker friendly ESP line of microcontrollers which is just begging for us to hack it.

Sonoff Motherboard
The Sonoff Basic motherboard

The motherboard board conveniently provides pins on the motherboard for a serial connection, all you have to do is solder a header to it.

Sonoff Serial Pins
The Sonoff Basic motherboard with pins soldered on

The ESP isn't 5V tolerable, so you have to make sure you use a 3.3V USB UART TTL Converter/Programmer when programming it or terrible things just might happen.

I used the Sonoff-Tasmota firmware in order to enable http and mqtt support on these devices. Their wiki page provides detailed instructions on configuring and flashing these devices.

DIY Hacker uses cookies to support technical features that enhance your experience as a user.

We also use analytics & advertising services. To opt-out, click More Info.