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. In the admin interface go to System → Devices → Add Device (Open Devices), pick the Tasmota driver, and enter the device IP Address. 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.
Subsystem placement

Put each Tasmota zone in the subsystem that matches what the relay actually drives — Lights, Power, or Fans for switched loads, Shades for blind / shutter modules, or Gates / Garages / Doors / Lifts for relay-driven access hardware. The subsystem is not cosmetic: it decides how on / off translate to the physical relay (see Supported commands).

When you add a zone for a Tasmota device, the New Zone editor pre-fills the subsystem with a matching default (Lights or Power) if you haven't chosen one yet. For a Fans, Shades, or access-hardware zone it won't pre-fill — pick the subsystem from the dropdown yourself.

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. Commands always address the relay by number — address=1 sends Power1, address=N sends Power<N> (Tasmota treats Power1 and Power as the same relay on single-relay devices). When reading state back, the driver accepts either the POWER or the POWER1 key for relay 1. For shutter modules, the same index drives ShutterOpen<N> / ShutterClose<N> / ShutterStop<N>.

Supported commands

CommandTasmota mapping
on / offPower<N> ON / Power<N> OFF. The verb is mapped through the zone's subsystem: relays wired to a gate, garage, door / lock, or lift invert (a relay turned on means the gate open / lock unlocked), while Lights, Fans, and Power zones map straight through. A per-zone normally_closed setting flips the mapping once more for reverse-wired contacts. (Shade / blind modules don't use on / off — they use open / close / stop below.)
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.
Dimmer level feedback

On / off relay state is tracked per zone on every poll. The live dimmer position is mirrored back onto the zone only when a single zone is bound to the Tasmota node (the common case for a bulb or single-channel dimmer). On multi-relay modules the Dimmer value is not read back to a zone — issue a fresh set_level to set it, or read it with get_status.

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.
  • Zones — create one zone per Tasmota relay or channel and set its address.
  • Subsystems — the subsystem a zone belongs to drives the on / off relay-state mapping.
  • Devices — add and configure the Tasmota node.
  • Commands — the command grid and Test runner for set_level, set_color, and the relay verbs.