Darren GriffinandClaude f9d1c4e405 Add Plausible analytics to the website (#734)
Follows the setup we use on improv-wifi.com: the analytics snippet lives
in one include, and the referrer allow list is downloaded once per build
by script/download_allowed_referrers.

Visitors arriving from their own Home Assistant or ESPHome instance send
their private URL as the referrer, so the snippet replaces every referrer
outside the allow list with a single aggregate bucket before Plausible
records it.

We had no website build to hang that download off, so this adds
script/build_website. It renders index.html and 404.html into
website/dist with the analytics include inlined, and a Website workflow
deploys that to GitHub Pages. The downloaded allow list stays out of git,
the same way it does on improv-wifi.com.

Note this needs the repository Pages source set to GitHub Actions.

Also adds a 404 page, which reports a "404" event, and the footer note
linking to the public dashboard.


Claude-Session: https://claude.ai/code/session_01SGtazYuhEWQCHouhzveoaX

Co-authored-by: Claude <[email protected]>
2026-08-17 12:55:31 +01:00
2021-05-27 07:57:20 -07:00
2024-01-16 20:18:05 -05:00

ESP Web Tools

Allow flashing ESPHome or other ESP-based firmwares via the browser. Will automatically detect the board type and select a supported firmware. See website for full documentation.

<esp-web-install-button
  manifest="firmware_esphome/manifest.json"
></esp-web-install-button>

Example manifest:

The optional serialType field ("cdc" or "uart") lets you ship separate firmware variants for chips that support both native USB CDC (built-in USB) and external USB-to-UART bridges. The correct variant is selected automatically based on the detected connection. Builds without a serialType are used as a fallback for any connection type.

{
  "name": "ESPHome",
  "version": "2021.10.3",
  "home_assistant_domain": "esphome",
  "funding_url": "https://esphome.io/guides/supporters.html",
  "builds": [
    {
      "chipFamily": "ESP32",
      "parts": [
        { "path": "bootloader_dout_40m.bin", "offset": 4096 },
        { "path": "partitions.bin", "offset": 32768 },
        { "path": "boot_app0.bin", "offset": 57344 },
        { "path": "esp32.bin", "offset": 65536 }
      ]
    },
    {
      "chipFamily": "ESP32-C3",
      "parts": [
        { "path": "bootloader_dout_40m.bin", "offset": 0 },
        { "path": "partitions.bin", "offset": 32768 },
        { "path": "boot_app0.bin", "offset": 57344 },
        { "path": "esp32-c3.bin", "offset": 65536 }
      ]
    },
    {
      "chipFamily": "ESP32-S2",
      "parts": [
        { "path": "bootloader_dout_40m.bin", "offset": 4096 },
        { "path": "partitions.bin", "offset": 32768 },
        { "path": "boot_app0.bin", "offset": 57344 },
        { "path": "esp32-s2.bin", "offset": 65536 }
      ]
    },
    {
      "chipFamily": "ESP32-S3",
      "serialType": "uart",
      "parts": [
        { "path": "bootloader_dout_40m.bin", "offset": 4096 },
        { "path": "partitions.bin", "offset": 32768 },
        { "path": "boot_app0.bin", "offset": 57344 },
        { "path": "esp32-s3.bin", "offset": 65536 }
      ]
    },
    {
      "chipFamily": "ESP32-S3",
      "serialType": "cdc",
      "parts": [
        { "path": "bootloader_dout_40m.bin", "offset": 4096 },
        { "path": "partitions.bin", "offset": 32768 },
        { "path": "boot_app0.bin", "offset": 57344 },
        { "path": "esp32-s3-cdc.bin", "offset": 65536 }
      ]
    },
    {
      "chipFamily": "ESP8266",
      "parts": [
        { "path": "esp8266.bin", "offset": 0 }
      ]
    }
  ]
}

Development

Run script/develop. This starts a server. Open it on http://localhost:5001.

The website is index.html and 404.html with the assets in static. script/build_website renders them into website/dist, which is what GitHub Pages serves. That build is also where the analytics snippet in website/plausible-analytics.html gets inlined, so it is not part of the pages you see while developing.

ESPHome - A project from the Open Home Foundation

S
Description
Open source tools to allow working with ESP devices in the browser
Readme Apache-2.0
14 MiB
Languages
TypeScript 63.1%
HTML 20.3%
Python 15.3%
JavaScript 0.7%
Dockerfile 0.6%