Home Automation with Tasmota — ESP8266

Introduction

Until now, when it comes to ESP-based devices and home automation only ESPHome came to my mind, but there seems to exist another option - Tasmota.

Where ESPHome takes your configuration and generates suitable C++ code which in the next step is compiled and uploaded to the ESP-device, Tasmota takes another approach.

Tasmota feels more like a proper operating system: You upload the appropriate Tasmota image on the device and configure it from there on. Adding new Sensors? No problem. OTA updates of the firmware are also possible.

This sounds great, so I had to test it with a ESP8266.

The full setup

The sensor in use is called a BME280 and measures humidity, pressure and temperature. I connected the sensor via its I2C interface. The standard slave address with this breakout board is 0x76. By cutting the trace between the first and second solder pad and connecting the second and third solder pad changes the address to 0x77.

The BME280 Sensor

For wiring the sensor just open any pinout diagram of your ESP8266 based board. In this case I connected VIN to 3V3, GND to any GND, SCL to D1 and SDA to D2. (All from Sensor Breakout Board to ESP8266 Board.)

A clearer look here:

The wiring

Flash Tasmota - Tasmotizer

It's the easiest to install Tasmotizer with pip:

pip install tasmotizer

(Note Tasmotizer uses Python 3, you may need to call pip3 on your system.)

But for me (Debian bullseye) this was not enough, I had to also install:

apt install python3-serial python3-pyqt5 python3-pyqt5.qtserialport

After that just call tasmotizer.py in your terminal.

Tasmotizer main menu

This is the main menu and you can see I have already chosen the binary for flashing. The different releases are available over github. They have various features enabled/disabled so choose one you like or compile the source by yourself.

Flashing the image

Flashing takes a short while.

Success message

It's good to feel success.

But Tasmotizer can do even more: configure the device for us. Click on the Send config button, this should open up:

Configuration tab

In the WiFi tab set the SSID and password of your desired Wifi. If you want the device to send/receive messages over MQTT configure the IP address and port of your MQTT broker. I have not done this yet - but will soon enough.

Clicking on the Get IP button gives us the IP of the device, if it could successfully connect to the WiFi.

Getting the IP

With the IP address in our pocket we move on to configuring Tasmota on the device.

Configure GPIOs over Web Interface

Beeing in the same network as the device, open the browser of your choice and type in the IP. Tasmota should greet you:

Tasmota main menu

Click on Configure Module, from there choose the Generic (18) model and configure GPIO4 as I2C SDA (6) and GPIO5 as I2C SCL (5). Save and the device will restart.

Tasmota GPIO configuration

Upon restarting Tasmota should look different. It seems like Tasmota automatically probes the I2C bus and detects all sensors for you - no further configuration required.

Tasmota sensor values

And that's it for now. In the future I want to add an simple OLED Display preferably the SSD1306, but for this I need to compile Tasmota myself - as I both need the sensor and display drivers activated.