Skip to main content

Generate static websites for ESPHome firmware distribution using ESP Web Tools

Project description

ewt-gen

Generate static websites for ESPHome firmware distribution using ESP Web Tools. Example output.

Quick Start

# From a local file
uvx ewt-gen config.yaml

# From a URL
uvx ewt-gen https://github.com/esphome/firmware/blob/main/esphome-web/esp32.factory.yaml

# Multiple configurations
uvx ewt-gen esp32.yaml esp32c3.yaml

Installation

# Run directly without installing (recommended)
uvx ewt-gen config.yaml

# Or install globally
uv tool install ewt-gen
ewt-gen config.yaml

# Or with pip
pip install ewt-gen

Usage

# From a local file
uvx ewt-gen config.yaml

# From a GitHub file URL
uvx ewt-gen https://github.com/user/repo/blob/main/config.yaml

# From a GitHub Gist
uvx ewt-gen https://gist.github.com/user/abc123

# From any URL
uvx ewt-gen https://example.com/config.yaml

Options

ewt-gen [OPTIONS] YAML_SOURCE

Options:
  --version                       Show version
  --skip-compile                  Skip ESPHome compilation (use existing firmware)
  -f, --firmware PATH             Path to firmware binary
  -c, --chip-family [esp32|esp32-c3|esp32-s2|esp32-s3|esp8266]
                                  Chip family (auto-detected from YAML)
  -o, --output PATH               Output directory (defaults to YAML filename)
  -t, --title TEXT                Page title (defaults to name from YAML)
  --pre-release                   Use pre-release ESPHome version via uvx
  --publish-url TEXT              URL where firmware will be published (enables OTA)
  --fw-version TEXT               Firmware version (read from esphome.project.version if not specified)
  --help                          Show help

Examples

# Basic usage - compiles and generates site
ewt-gen my-device.yaml

# Custom output directory and title
ewt-gen my-device.yaml -o ./dist -t "My Smart Device"

# Use pre-release ESPHome
ewt-gen my-device.yaml --pre-release

# Skip compilation, use existing firmware
ewt-gen my-device.yaml --skip-compile -f firmware.bin

# Enable OTA updates and dashboard import
ewt-gen my-device.yaml --publish-url https://firmware.example.com/my-device

# Specify version explicitly
ewt-gen my-device.yaml --publish-url https://firmware.example.com/my-device --fw-version 1.0.0

OTA Updates and Dashboard Import

When using --publish-url, the tool generates a factory firmware that includes:

  • OTA updates via HTTP - Devices can check for and install firmware updates
  • Dashboard import - Users can adopt the device in ESPHome Dashboard (if source is a GitHub URL)

The tool creates two YAML files in the output:

  • {name}.yaml - The original configuration (for users to customize)
  • {name}.factory.yaml - Factory firmware that imports the original and adds OTA support

The version is required for OTA updates to work correctly. It can be specified via:

  • --fw-version command line option
  • esphome.project.version field in the YAML configuration

If no version is found, a warning is shown and OTA components are omitted (dashboard import still works).

Generated Site

The tool generates a static website containing:

  • ESP Web Tools install button - One-click firmware installation (requires HTTPS)
  • Alternative install section - Link to download binary and use with ESPHome Web
  • ESPHome configuration section - Download links and expandable view of the YAML configuration
  • Manual installation instructions - For non-HTTPS contexts, with link to web.esphome.io

HTTPS Requirement

Browser-based installation using ESP Web Tools requires a secure context (HTTPS or localhost). When served over HTTP, the page automatically shows manual installation instructions instead.

ESPHome Detection

The tool automatically:

  • Detects chip family from the YAML configuration
  • Finds compiled firmware in .esphome/build/ directory
  • Uses local esphome if available, falls back to uvx esphome

License

Apache 2.0

Credits

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ewt_gen-1.4.1.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ewt_gen-1.4.1-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file ewt_gen-1.4.1.tar.gz.

File metadata

  • Download URL: ewt_gen-1.4.1.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for ewt_gen-1.4.1.tar.gz
Algorithm Hash digest
SHA256 2f4a140a63803887e02abde11a4611def58a62131dd27a2a4afc144584270138
MD5 757ec0f1c91b15f840a46d1d4f1666be
BLAKE2b-256 e9b4578a441bdb7824676baea25309ecb301706cab4205385e5d9ad710926b59

See more details on using hashes here.

Provenance

The following attestation bundles were made for ewt_gen-1.4.1.tar.gz:

Publisher: publish.yml on esphome/ewt-gen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ewt_gen-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: ewt_gen-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for ewt_gen-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 decfe76e71ee9fa90e36c2a03b371b77bae10b57d62136d9368cd4fe35cd6ac7
MD5 8fb32cb8e5ca0ae9306d42dfe001f0ba
BLAKE2b-256 c1864d499460490c0fc4ac4505866d8333638e7d64a57dfd4993819afdf75d6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ewt_gen-1.4.1-py3-none-any.whl:

Publisher: publish.yml on esphome/ewt-gen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page