Tasmota

About

Receive and record telemetry data from devices running the Tasmota firmware using MQTT.

About Tasmota

Tasmota is an alternative firmware for ESP-based devices like the iTead Sonoff. It features a web UI, rules and timers, OTA updates, custom device templates and sensor support. It can be controlled over MQTT, HTTP, Serial and KNX for integrations with smart home systems.

The Tasmota logo

Tasmota - Open source firmware for ESP devices.

Total local control with quick setup and updates. Control using MQTT, Web UI, HTTP or serial. Automate using timers, rules or scripts. Integration with home automation solutions. Incredibly expandable and flexible.

See also

The Tasmota documentation.

Example devices

Sonoff TH: Temperature and Humidity Monitoring WiFi Smart Switch

Sonoff TH: Temperature and Humidity Monitoring WiFi Smart Switch

Sonoff SC: Environmental monitoring device

Sonoff SC: Environmental monitoring device

Sonoff TH

The Sonoff TH (product page) is an environmental monitoring and controlling device for measuring current temperature and humidity.

Sonoff SC

The Sonoff SC (product page) is an environmental monitoring device for measuring current temperature, humidity, light intensity, air quality (particulates) and sound levels (noise pollution).

Grafana Dashboard

Grafana Dashboard for Sonoff SC environmental monitoring device

Grafana Dashboard for Sonoff SC environmental monitoring device

Device setup

By staying as close to the vanilla documentation examples as possible, newcomers should have an easy way getting their telemetry data ingested. Kotori will recognize the Tasmota device by its MQTT topic suffix like SENSOR or STATE and will route telemetry messages through the appropriate decoding machinery.

Introduction

See also Configure MQTT for the Tasmota Firmware.

Configure MQTT using WebUI on Tasmota

Configure MQTT using WebUI on Tasmota

Configuration

This is about getting the system configured properly, so please read this section carefully.

Settings

While configuring the MQTT broker address is straight-forward, special care should be taken to configure the MQTT topic appropriately to send telemetry data to the data historian.

Topic: Unique identifier of your device (e.g. hallswitch, kitchen-light). Referenced elsewhere as %topic%.
Full Topic: A full topic definition where %topic% and %prefix% can be interpolated into.

By example

Let’s define a communication channel address and a device identifier for data acquisition.

Channel: universe/milky-way/earth-one
Device: node-42

The appropriate settings for Tasmota would then be

Topic: node-42
Full Topic: universe/milky-way/earth-one/%topic%/%prefix%/

Running this configuration will yield MQTT topics like:

universe/milky-way/earth-one/node-42/tele/SENSOR
universe/milky-way/earth-one/node-42/tele/STATE

Payload examples

Submit

Acquire an example HTTP payload message of type SENSOR and publish it to MQTT broker on localhost:

http https://raw.githubusercontent.com/daq-tools/kotori/main/doc/source/integration/tasmota/sensor-payload.json \
    | mosquitto_pub -h localhost -t universe/milky-way/earth-one/node-42/tele/SENSOR -s

Acquire an example HTTP payload message of type STATE and publish it to MQTT broker on localhost:

http https://raw.githubusercontent.com/daq-tools/kotori/main/doc/source/integration/tasmota/state-payload.json \
    | mosquitto_pub -h localhost -t universe/milky-way/earth-one/node-42/tele/STATE -s