Skip to content

Power control

Turn a smart plug on or off. The plug runs Tasmota firmware, so you can drive it directly over HTTP or from Python — no broker required.

Tasmota exposes a command endpoint at /cm. Address the plug by its IP or mDNS hostname (<plug-host>) — no broker needed.

Turn on / off / toggle

curl "http://<plug-host>/cm?cmnd=Power%20On"
curl "http://<plug-host>/cm?cmnd=Power%20Off"
curl "http://<plug-host>/cm?cmnd=Power%20Toggle"

Query current state

curl "http://<plug-host>/cm?cmnd=Power"

Each call returns JSON, e.g. {"POWER":"ON"}.

Password-protected plugs

If the plug's web admin has a password, add credentials as query parameters — over a trusted network only:

http://<plug-host>/cm?user=admin&password=<password>&cmnd=Power%20On

The openculture client drives the plug over the same HTTP endpoint — no broker. Address plugs by name: a bare name resolves to its mDNS host (maxone-amaxone-a.local), or supply an explicit host.

from openculture import SmartPlugClient

with SmartPlugClient() as plug:
    plug.on("maxone-a")        # turn on  -> "ON"
    plug.off("maxone-a")       # turn off -> "OFF"
    plug.toggle("maxone-a")
    plug.is_on("maxone-a")     # -> True / False

# Pin an IP (skip mDNS); pass web-admin credentials if the plug is protected:
plug = SmartPlugClient({"maxone-a": "192.168.1.42"},
                       user="admin", password="...")

Multi-relay plugs: pass relay=2 to target POWER2. Install with pip install openculture.

Without the SDK — the same request with plain httpx:

import httpx

httpx.get("http://maxone-a.local/cm",
          params={"cmnd": "Power On"}).raise_for_status()

Coming soon

MCP tools for smart plug control are on the roadmap.