Sonoff Basic + Tasmota + OpenHAB + MQTT

I got Sonoff Basic and first thing after unpacking was flashing to Tasmota and integrate it with my OpenHAB. Further step is replace switch in my stand lamp over table and use 3rd gang in Sonoff T0 Wall switch to control it.

I made video how to prepare hardware and flash with Tasmota firmware:

There are also OpenHAB files required for MQTT communication between modules. Everything you find also here step by step.

Hardware preparing

Before you flash Sonoff Basic you have to go inside and identify pins for soldering in order to connect your FTDI USB flasher.

Sonoff Basic Pinout
Sonoff Basic Pinout

See photo above.There are pins marked: 3V3/RX/TX/GND. I soldered female pins to get easier to flash later.

For flashing we do not need I02. Basically 4 pins should be fine. Hardware prepared.

Software flashing

Flashing Sonoff Basic is pretty simple. There is not much difference between flashing Sonoff RF Bridge and any other ESP8266. I covered flashing in more details in THIS post. Please with it familiar first.

I downloaded the most recent version of Tasmota v6.6.0 . Just sonoff normal version. I assume that you have esptool, sonoff firmware. Before you connect flasher you have to keep button pushed. Then press enter and flashing process should begin.

done.

Initial configuration

First steps after flashing are very similar to EspEasy firmware. Also as there we get additional AP in our WiFi networks.

Connect your Sonoff Basic to a power source and grab your smartphone (or tablet or laptop or any other web and Wi-Fi capable device). Search for a Wi-Fi AP named sonoff-xxxx (where x is a number) and connect to it. In this example the Wi-Fi AP is named sonoff-5291 When it connects to the network, you may get a warning that there is no Internet connection and be prompted to connect to a different network. 

After you have connected to the Tasmota Wi-Fi AP, open http://192.168.4.1 in a web browser on the smartphone (or whatever device you used). Some devices might prompt you to sign in to Wi-Fi network which should also open the above address. In configuration UI follow steps to add your home AP. After applying settings Sonoff Basic will be trying to connect there. From now you may access it from your network.

If you don’t have access to your router you can find your newly flashed device with an IP scanner:

As the sonoff.bin is general solution for various supported hardware you have to configure it to support Sonoff Basic. Please find screenshots with ready to use settings.

First configure module and select Sonoff Basic unless is not automatically detected.

Sonoff Configure Module

Let’s adjust also logging:

Enable MQTT and define topics/hostname

Finally after few restarts you should get default view of Sonoff Basic with button state.

OpenHAB Configuration

As usual I put OpenHAB configuration snippets. I put also for context previously configured here and here items. For you relevant entries for Sonoff Basic were added as last ones in the bottom.

.things

.items

.sitemap

hopefully works.

You may also like...

Leave a Reply