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/cmrequest.
Setup
- 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.
- Run
get_statusto enumerate the Tasmota Status payload. ConfirmFriendlyNameand any visiblePOWER/POWER1..Nkeys. - Create a zone per controllable relay or channel. Set
zone.addressto the 1-based relay index (1for single-relay devices,2,3,4for multi-relay modules). Leavezone.addressblank on RGBW bulbs or dimmers.
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
| Attribute | Required | Description |
|---|---|---|
ip | yes | LAN IP or hostname. |
port | no (default 80) | HTTP port. Tasmota's web server defaults to 80. |
username | no (default admin) | Tasmota web user. Only sent when password is also set. |
password | no | Tasmota WebPassword. Sent as password= query param. Stored encrypted by GEM. |
status_interval | no (default 5000 ms) | How often the driver polls Status 11 for state updates. Set higher (15000+) for battery-backed or sleep-cycle devices. |
request_timeout | no (default 5000 ms) | Per-request HTTP timeout. |
Zone attributes
| Attribute | Description |
|---|---|
address | Relay index (1..N). Leave blank or set to 1 for single-relay or single-channel devices. |
default_dim_speed | Optional 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
| Command | Tasmota mapping |
|---|---|
on / off | Power<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.) |
toggle | Power<N> TOGGLE. |
set_level | Dimmer <0-100> on address=1; Channel<N> <0-100> on higher indices. |
set_color | Color RRGGBB or Color RRGGBBWW. |
set_ct | CT 153..500 (mireds; 153 ≈ 6500 K, 500 ≈ 2000 K). |
open / close / stop | ShutterOpen<N> / ShutterClose<N> / ShutterStop<N> — for Tasmota shutter / blind modules. |
get_status | Status 0 — full device + per-relay status. Useful for first-contact discovery. |
reboot | Restart 1. |
raw_command | Pass-through for any Tasmota command. Accepts the full Tasmota syntax including Backlog. |
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 11instead. If you want sub-second updates, point the device's MQTT block at the GEM MQTT broker and use themqttdriver. set_coloron 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 withget_statusif you need to confirm the change took effect.Backlogparsing.raw_commandacceptsBacklog, 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
passwordattribute is empty (or vice versa). Match them. - Connect works but state never updates. The device's
Status 11response shape uses keys the driver doesn't recognize (custom Tasmota fork). Watch the JSON viaget_statusand file an issue — every shipped Tasmota build follows theStatusSTS.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 loweringstatus_intervalto 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. Runraw_commandwithModule 0to read the current module, then set the right multi-relay template under Configuration → Configure Module.
Related documentation
- Zones — create one zone per Tasmota relay or channel and set its
address. - Subsystems — the subsystem a zone belongs to drives the
on/offrelay-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.