Skip to content

Expose firmware version via Zigbee SWBuildID#13

Open
georgemclaughlin wants to merge 1 commit intoStuckAtPrototype:masterfrom
georgemclaughlin:pr/add-swbuildid
Open

Expose firmware version via Zigbee SWBuildID#13
georgemclaughlin wants to merge 1 commit intoStuckAtPrototype:masterfrom
georgemclaughlin:pr/add-swbuildid

Conversation

@georgemclaughlin
Copy link
Copy Markdown

Summary

This adds Zigbee firmware version exposure via the Basic cluster SWBuildID attribute (0x0000 / 0x4000).

AirCube already exposes manufacturer and model through the Basic cluster, so this extends that to also expose the running firmware/app version from ESP-IDF.

Changes

  • add SWBuildID to the Basic cluster in firmware/main/zigbee.c
  • source the value from esp_app_get_description()->version
  • define the firmware app version through firmware/version.txt
  • add the esp_app_format dependency needed to read the app description
  • allow tracked/source CSVs in .gitignore
  • include a working firmware/partitions_zigbee.csv, since sdkconfig.defaults already references it

Notes on the partition table

The repo currently references firmware/partitions_zigbee.csv from sdkconfig.defaults, but the file is missing and *.csv in .gitignore prevents it from being added.

The partition table in this PR is a working reconstruction based on the current firmware requirements:

  • zb_storage
  • zb_fct
  • history sized to match history.c / history.h

If you still have the original intended partition layout, feel free to replace it.

Verification

Tested locally with ESP-IDF 5.5.3:

  • idf.py set-target esp32h2 build
  • flashed to hardware successfully
  • verified on serial that the app boots with the expected version
  • verified in ZHA that Basic cluster sw_build_id is readable

Example ZHA readback:

  • endpoint 10
  • cluster 0x0000 (Basic)
  • attribute 0x4000 (sw_build_id)
  • value 1.3.1 during initial validation, then 1.3.2 after switching to version.txt

The PR currently leaves firmware/version.txt at 1.3.0 so you can choose the final release/version value upstream.

@georgemclaughlin
Copy link
Copy Markdown
Author

Screenshot from ZHA after flashing this branch and reading the Basic cluster directly:

  • endpoint 10
  • cluster 0x0000 (Basic)
  • attribute 0x4000 (sw_build_id)
  • value: 1.3.0

This confirms the firmware version is exposed through SWBuildID as expected.

Screenshot From 2026-03-13 22-09-28

@StuckAtPrototype
Copy link
Copy Markdown
Owner

very nice! I will run this once I am back local at my HA and pull it in. Thanks!

@nicholas1513
Copy link
Copy Markdown

Perfect! I was hoping to find the firmware version displayed somewhere so that I could tell what my device came in on stock. Branch has conflicts, but anything else holding this up? @StuckAtPrototype

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants