Skip to content

Tasmota devices

https://www.tasmota.info/

Prometheus

https://www.markhansen.co.nz/monitoring-electricity-with-tasmota/

By default, Tasmota is build without prometheus integration. Since there is no official prometheus build, you need to re-build it:

Building

https://github.com/tasmota/docker-tasmota

cd ~/projects/smart-home/tasmota/Tasmota.git
git fetch

Checkout latest tag:

git tag -l | tail
git co -b 9.5.0 v9.5.0

Add #define USE_PROMETHEUS to tasmota/user_config_override.h, then:

docker pull blakadder/docker-tasmota
docker run -ti --rm -v $(pwd):/tasmota -u $UID:$GID blakadder/docker-tasmota -e tasmota

Build binary is at build_output/firmware/

Usage

Get prometheus metrics:

curl --netrc -Li tasmota_222d0d-3341.lan/metrics

MQTT

Docs: Configure MQTT using Backlog:

Backlog mqtthost <mqtt_broker_address>; mqttport <mqtt_broker_port>; mqttuser <username>;
  mqttpassword <password>; topic <device_topic>

Upgrading tasmota to newer version or add features

https://tasmota.github.io/docs/Upgrading

Example hardware: Gosund P1 3-fach AC+USB WiFi Smart Steckdosenleiste, bought with tasmota 9.5 (2021-07)

First usage:

Recovery

https://tasmota.github.io/docs/Device-Recovery/#fast-power-cycle-device-recovery

When using tasmota: Press down power button for 40s does a factory reset and restart.

You can recover with:

curl -F "u2=@/tmp/tasmota.bin" http://192.168.4.1/u2

Devices

Gosund P1

Temperature/humidity sensor DHT22

  • Ebay-Kauf https://tasmota.github.io/docs/AM2301/
  • see ~/projects/smart-home/tasmota/temperature_humidity_sensor_dht22
  • Firmware: ~/projects/smart-home/tasmota/Tasmota.git/build_output/firmware/tasmota-10.0.0-generic.bin.gz
  • WLAN: ESP-01S
  • Sensor: DHT22

Before:

Module: Sonoff Basic (1) GPIO: All none

After configuration:

Module: Generic GPIO2: AM2301 für das DHT22 Modul

  • Avahi hostname: http://tasmota-2379c9-6601.local/

Calibration

Use Tasmota Console:

i.e. Sensor reports 24.5⁰, external kalibrated thermometer reports 22.7⁰, offset is -1.8⁰:

TempOffset -1.8..24.5, press Enter.

ESP8266 based Wi-fi boards

https://en.wikipedia.org/wiki/ESP8266

Wemos D1 mini Pro

  • ESP Chip ID: 2889749 (ESP8266EX)
  • Flash Size 16mb
  • Program Flash Size 1mb

ESP8266MOD (by AI-Thinker)

Erasing flash and backing up firmware is not possible:

A fatal error occurred: ESP8266 ROM does not support function erase_flash.
A fatal error occurred: ESP8266 ROM does not support function erase_flash.

Flashing:

https://tasmota.github.io/docs/Getting-Started/#flashing

esptool --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 ~/projects/smart-home/tasmota/Tasmota.git/build_output/firmware/tasmota-10.0.0-generic.bin

Mini D1 mini Pro sensors

DHT22, including useful tips about Mini D1 Pro GPIO usage

HTU21D

Enable build flag:

#USE_HTU

Config:

  • Generic (18)
  • D1 GPIO5: I2C SDA
  • D2 GPIO4: I2C SCL

Wiring:

Console

i2cscan