Repository navigation
v0.2.0: migrate to ESPHome, delete custom C++ architecture - #8
Merged
Merged
Conversation
Replaces the entire v0.1.x custom PlatformIO + Arduino-ESP32 firmware (~2,000 LOC across 12 source files + Unity tests) with a single ESPHome YAML. Same hardware, same fan curve, same captive portal, same safety failsafe. Rationale in PROJECT_PLAN.md "History". Added - fancontrol.yaml: DHT22 + LEDC PWM with runtime-tunable frequency, 5-point piecewise-linear fan-curve lambda (ported from the v0.1.x Unity-tested fan_curve::computeFromTemperature), sensor-stall failsafe (→ 100 %), alarm binary sensors, restart counter, captive portal, ESPHome native API + optional MQTT block, web_server, OTA. - secrets.yaml.example: WiFi / API key / OTA password template. - docs/home_assistant.md: integration walkthrough + automation ideas. Changed - HA transport: MQTT auto-discovery → ESPHome native API (encrypted, faster, zero-config on HA side). MQTT left commented out for users who prefer the v0.1.x topic shape. - Web UI: custom 4-section PROGMEM dashboard → ESPHome web_server. - CI (.github/workflows/ci.yml): esphome/build-action@v10 (full compile, not just lint) + 1.5 MB size gate + artifact upload. - Release (.github/workflows/release.yml): publishes firmware.bin + firmware.ota.bin + firmware.factory.bin + SHA-256 checksums. No more RSA signing (ESPHome OTA uses password + checksum; see SECURITY.md for the why and for v0.1.x verification recipe). - README, CLAUDE.md, CONTRIBUTING.md, PROJECT_PLAN.md, SECURITY.md: all rewritten for the ESPHome workflow. - docs/wiring_diagram.md: pin map unchanged, refs updated. - .github/PULL_REQUEST_TEMPLATE.md: checklist pivots from pio to esphome. Removed - Entire src/ tree: config, storage, sensor, fan, fan_curve, watchdog, wifi_manager, mqtt, webserver, websocket, index_html, version, main. - test/ directory (Unity host tests). - platformio.ini. - docs/api.md (no custom HTTP / WS API under ESPHome). - docs/mqtt_topics.md (MQTT is now optional + self-documenting via HA discovery). - RSA-signed release pipeline. SECRET_RSA_KEY repo secret retained (unused from v0.2.0) so pre-v0.2.0 tags could theoretically be re-signed. docs/signing_public_key.pem preserved for verifying existing v0.1.0 / v0.1.1 signed binaries. Verification - esphome config fancontrol.yaml → Configuration is valid. - esphome compile fancontrol.yaml → SUCCESS, firmware.bin 945 KB (vs 1.07 MB custom C++), firmware.factory.bin 1.01 MB. Migration - Reflash required; v0.1.x NVS namespace is not portable. - Reconfigure via FanControl-Setup captive portal on first boot. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the entire v0.1.x custom PlatformIO + Arduino-ESP32 firmware (~2,000 LOC, 12 source files, Unity tests) with a single ESPHome YAML. Same hardware, same fan curve, same captive portal, same safety failsafe — ~200 lines of config driving the same outcome. See
PROJECT_PLAN.md→ "History" for the rationale.Highlights
fancontrol.yaml: full firmware definition — DHT22 on GPIO 4, LEDC PWM on GPIO 25 with runtime-tunable 1000–5000 Hz, fan-curve lambda ported verbatim from the v0.1.x Unity-testedfan_curve::computeFromTemperature, sensor-stall failsafe, alarm binary sensors, restart counter, captive portalFanControl-Setup, ESPHome native API + optional MQTT, built-inweb_server, password-gated OTA.esphome/build-action@v10for full compile gating.firmware.bin+firmware.ota.bin+firmware.factory.bin+ SHA-256. No more RSA signing — ESPHome's OTA is password+checksum based.SECURITY.mddocuments the new model and keeps the v0.1.x verification recipe for legacy binaries.Removed
src/tree,test/,platformio.ini.docs/api.md(no custom WS API),docs/mqtt_topics.md(MQTT now self-documents).Preserved for backward compatibility
docs/signing_public_key.pem— verify v0.1.x signed releases.Verification
esphome config fancontrol.yaml→ Configuration is validesphome compile fancontrol.yaml→ SUCCESS,firmware.bin945 KB (vs 1.07 MB custom C++),firmware.factory.bin1.01 MBTest plan
esphome/build-actioncompiles cleanly)v0.2.0, verify release workflow publishes the three binaries + checksumssecrets.yaml,esphome run fancontrol.yamlover USB, walk through the first-boot captive-portal flow, confirm HA auto-discovers the device, cycle power to exerciserestart_counter, unplug DHT22 to exercise the 60 s sensor-stall failsafeMigration notes
FanControl-Setupreappears on first boot for WiFi reconfiguration.secrets.yaml) — no more "changeme" + first-boot rotation banner.🤖 Generated with Claude Code