Tasmota for Mere Mortals
A smart plug you buy today usually phones home. You tap a button in a vendor's app, the tap travels to a data centre on another continent, and a command travels back to the plug sitting two metres from your phone. If the vendor's cloud goes down, or the vendor goes away, or you simply lose internet, the plug forgets how to be smart. Tasmota is the way out of that arrangement. It is open-source firmware — a replacement brain — for the ESP8266 and ESP32 microcontrollers inside a great many smart plugs, switches, light bulbs and relay boards. Flash it once, and the device stops talking to a stranger's cloud and starts answering to you: a web page on your own network, commands you can send four different ways, and telemetry your own systems can read.
This guide explains what Tasmota is and is not, how it gets onto a device, and how a device is run once it is there: the web interface, the single command language that the console, the serial line, HTTP and MQTT all speak, the telemetry a device publishes, and the rules engine that lets a plug make its own decisions with no hub and no cloud at all. On ESP32 devices there is also a real scripting language, Berry. The guide ends with the part most firmware write-ups skip: it builds the firmware from source, twice — once for each chip family — and reports the real sizes, because on a chip with one megabyte of flash, size is not a detail.
One warning belongs here, before anything else, and it is repeated in its own chapter: many Tasmota devices switch mains electricity. Flashing is done with the case open and the board exposed, and you must never do it while a device is connected to mains power. People have been electrocuted getting this wrong. The full safety chapter is chapter two, and it is short on purpose.
Everything in this guide that describes the
firmware itself was checked against the
real thing. The lab cloned the project's
source at its current stable release,
v16.0.0, and built two firmware images
from it; the command tables, MQTT message
shapes, web pages and variant list in these
chapters were read out of that source code,
not out of other people's blog posts. The
parts that need a physical device in a
physical wall socket — flashing, wiring,
watching a relay click — are labelled
documented-only and follow the project's
official documentation, because the lab has
no devices and does not pretend otherwise.
The transcripts and dissection notes are in
tasmota-lab/.
Part of the series
This guide is one of the For Mere Mortals guides: plain-language guides to the tools programmers and makers use.
Related guides:
- ESPHome for Mere Mortals
- WLED for Mere Mortals
- ESP32 for Mere Mortals
- PlatformIO for Mere Mortals
- MQTT for Mere Mortals
- Home Assistant for Mere Mortals
- Zigbee2MQTT for Mere Mortals
License
The writing in this guide is licensed under CC BY 4.0. Code examples and lab scripts are licensed under the MIT License.