Skip to main content

pyinfra-tasmota

A Pyinfra connector for Tasmota devices.

The connector talks to a Tasmota device over its HTTP API. It reads the device settings once at connect time, compares operation intent against that cache, and sends only the commands that are needed as batched Backlog0 requests.

Install

uv add pyinfra-tasmota

Usage

Inventory:

hosts = ["@tasmota/tasmota.example.org"]

Deploy:

from pyinfra_tasmota.operations import apply, cmnd

cmnd(SetOption114=1, SetOption120=0, Power="toggle")
apply()

cmnd takes any number of commands as keyword arguments. It compares each desired value with the cache. It reads the current value from the device if the setting is not cached, and records a pending change only if the value differs. Every command is sent by apply, or on disconnect as a safety net.

Command names are matched case-insensitively and resolve the SO alias of SetOption, so SetOption114, setoption114, and so114 are the same command. Boolean values are folded, so a desired 0 matches a device value of OFF, and 1 matches ON.

Non-rebooting commands are flushed as Backlog0 batches, split to stay within Tasmota's limit of 30 commands and decode-config's limit of 320 characters per command line. Reboot-triggering commands are sent on their own.

Reboots

Some commands reboot the device, for example Restart, Module, and Template. The connector sends these commands on their own, after all other commands, and waits for the device to answer again before continuing. A device is considered back once it was seen to drop and is answering, or once its BootCount has advanced.

If the device does not return within the timeout, apply reports an error.

Verbosity

The connector follows pyinfra's -v flags:

  • -v reports every command sent to the device.
  • -vv also reports the observed state of each command, and any command skipped because the device already matches the desired value.
  • -vvv also reports internal detail, such as the size of the status cache and how commands are grouped into Backlog0 batches.

Versioning

The package version comes from Git via uv-dynamic-versioning. Tag a release as vX.Y.Z; commits after a tag get a .postN.dev0+<hash> suffix. A checkout with no tags reports 0.0.0.

Connector data

Set these on a host in the inventory:

  • tasmota_friendly_name: an optional human-readable name, used in logs.
  • tasmota_reboot_timeout: seconds to wait for a rebooted device to answer again (default 60).

The connector registers itself with Pyinfra under the name tasmota, so use @tasmota/<host> anywhere a connector is expected.

Metadata

Release files for pyinfra-tasmota 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyinfra-tasmota 0.1.0
File Size Uploaded Provenance Actions
pyinfra_tasmota-0.1.0.tar.gz 179.0 kB With provenance Details for pyinfra_tasmota-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyinfra-tasmota 0.1.0
File Interpreter ABI Platform Actions
pyinfra_tasmota-0.1.0-py3-none-any.whl Python 3 none any Details for pyinfra_tasmota-0.1.0-py3-none-any.whl

Total release size: 189.2 kB

Release files / pyinfra_tasmota-0.1.0.tar.gz

Download URL pyinfra_tasmota-0.1.0.tar.gz
Size 179.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3a1303eec7e0ba3d3452a07baba7f832e5102a9fb47eb74f068212af86d09828
BLAKE2b-256 checksum
How to use checksums
5d05aa519458b1c10264cbb8e753599546e3be2146c0e69253e1ccd994bdcb79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / pyinfra_tasmota-0.1.0-py3-none-any.whl

Download URL pyinfra_tasmota-0.1.0-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d173e8cd423fc2a55221e093e67b9ebc3a0943166dd26d30aefb00a7241d252a
BLAKE2b-256 checksum
How to use checksums
886ede88a554f6022a689b650e969935ff2bd30cc6a7c194137ff520fad61dc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Security for pyinfra-tasmota 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyinfra_tasmota-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page