Skip to main content

Tasmota

Local HTTP control of devices running Tasmota firmware on ESP8266 / ESP32 hardware. Covers the most common Tasmota use cases an integrator runs into in the field: smart plugs (Sonoff S31, Athom, Shelly-flashed), multi-relay modules (Sonoff 4CH Pro), wall switches (Sonoff Mini, Athom dimmers), RGBW bulbs (BN-LINK, Athom, Shelly-flashed Tuya), and shutter / blind modules.

Prerequisites

  • Tasmota firmware v8.0 or newer flashed on the device.
  • Device joined to the LAN and reachable from the GEM server.
  • (Optional) A WebPassword set under Configuration → Configure Other → Web Admin Password. Tasmota web auth is disabled by default; if a password is configured, GEM uses HTTP basic-style &user=&password= on every /cm request.

Setup

  1. Create a device with driver tasmota and enter the device IP. Leave Web Username and Web Password blank unless web auth is enabled on the device.
  2. Run get_status to enumerate the Tasmota Status payload. Confirm FriendlyName and any visible POWER / POWER1..N keys.
  3. Create a zone per controllable relay or channel. Set zone.address to the 1-based relay index (1 for single-relay devices, 2, 3, 4 for multi-relay modules). Leave zone.address blank on RGBW bulbs or dimmers.

Device attributes

AttributeRequiredDescription
ipyesLAN IP or hostname.
portno (default 80)HTTP port. Tasmota's web server defaults to 80.
usernameno (default admin)Tasmota web user. Only sent when password is also set.
passwordnoTasmota WebPassword. Sent as password= query param. Stored encrypted by GEM.
status_intervalno (default 5000 ms)How often the driver polls Status 11 for state updates. Set higher (15000+) for battery-backed or sleep-cycle devices.
request_timeoutno (default 5000 ms)Per-request HTTP timeout.

Zone attributes

AttributeDescription
addressRelay index (1..N). Leave blank or set to 1 for single-relay or single-channel devices.
default_dim_speedOptional Tasmota Speed value (0–40) issued before each set_level. 0 = instant; higher values = slower fade.

Zone address format

A plain integer in 1..32 matching the Tasmota relay index. The driver maps address=1 to Power (or Power1 if Power isn't present) and address=N to Power<N>. For shutter modules, the same index drives ShutterOpen<N> / ShutterClose<N> / ShutterStop<N>.

Supported commands

CommandTasmota mapping
on / offPower<N> ON / Power<N> OFF. Routes through the zone subsystem's relay-state translation when applicable (gates / locks / shades that wire NC contacts get the inverted verb).
togglePower<N> TOGGLE.
set_levelDimmer <0-100> on address=1; Channel<N> <0-100> on higher indices.
set_colorColor RRGGBB or Color RRGGBBWW.
set_ctCT 153..500 (mireds; 153 ≈ 6500 K, 500 ≈ 2000 K).
open / close / stopShutterOpen<N> / ShutterClose<N> / ShutterStop<N> — for Tasmota shutter / blind modules.
get_statusStatus 0 — full device + per-relay status. Useful for first-contact discovery.
rebootRestart 1.
raw_commandPass-through for any Tasmota command. Accepts the full Tasmota syntax including Backlog.

What we don't yet support

  • MQTT subscription. Tasmota can publish state changes over MQTT; this driver polls Status 11 instead. If you want sub-second updates, point the device's MQTT block at the GEM MQTT broker and use the mqtt driver.
  • set_color on white-only / CCT-only firmware variants is silently accepted by Tasmota at the firmware level (the lamp stays warm-white). The driver returns ok — verify with get_status if you need to confirm the change took effect.
  • Backlog parsing. raw_command accepts Backlog, but the driver does not split the response per sub-command — Tasmota returns one merged JSON blob.

Troubleshooting

  • HTTP 401 on every request. A WebPassword is set on the device but the GEM password attribute is empty (or vice versa). Match them.
  • Connect works but state never updates. The device's Status 11 response shape uses keys the driver doesn't recognize (custom Tasmota fork). Watch the JSON via get_status and file an issue — every shipped Tasmota build follows the StatusSTS.POWER<N> convention.
  • Slow first connect (10s+). ESP8266 devices on weak Wi-Fi pin under the default 5 s request_timeout. Raise it to 10000 and consider lowering status_interval to 10000+ so the device gets time between polls.
  • Multi-relay device only responds on address=1. The Tasmota module template is probably set to a single-relay profile. Run raw_command with Module 0 to read the current module, then set the right multi-relay template under Configuration → Configure Module.