Skip to content

feat(webui): explain fault codes with installable fault code packs - #3493

Open
beabel wants to merge 6 commits into
emsesp:devfrom
beabel:pr/fault-codes-v2
Open

beabel wants to merge 6 commits into
emsesp:devfrom
beabel:pr/fault-codes-v2

Conversation

@beabel

@beabel beabel commented Nov 28, 2026 •

Copy link
Copy Markdown

What this adds

The Dashboard shows the fault codes of the devices as they are reported (for example H08(1018) or A11(3071)). This PR adds the explanation: what the code means, the possible cause and what to do.

The explanations are not part of the firmware or the Web UI. They are fault code packs: one JSON file per manufacturer and language. A pack is installed from a file on the gateway, which stores it, so every browser can use it afterwards, also without internet. Without a pack nothing changes: the raw code is shown as before.

In the Web UI (Dashboard)

  • The cards on Maintenance & faults (last fault, last controller fault, service code) and the Notes tile on Home show title, severity, possible cause and remedy, and the fault class.
  • A lookup on that page for a code and additional code from a display (H08, 6A 227, H08(1018), 1018).
  • Fault code packs: list of the installed packs (version, number of entries), install from a file, remove (administrators). The link List of packs leads to the folder with packs I maintain (see "Open points").
  • A pack is only used for devices of its brand, because the same code can mean something else for another manufacturer. Devices without a brand (a controller) use the pack of the boiler's brand when the pack says so (applies.unbranded_with_boiler).
  • Entries can be limited to a product series (scopes: product ids or words in the device name), because one code can mean different things within a brand. An entry with a scope is only used for a matching device.
  • Texts that are machine translated, or still in the original language, get a hint.

In the firmware (WebFaultPackService)

  • GET /rest/faultPacks (installed packs and free space) and GET /rest/faultPack?brand=..&lang=.. for signed-in users.
  • POST /rest/uploadFaultPack and POST /rest/deleteFaultPack for administrators.
  • The pack is stored gzip compressed in /faults/<brand>.<lang>.json with a small .meta file (version, number of entries). The browser compresses the file before the upload, so a pack of 350 KB needs about 45 KB.
  • Checks on the gateway: brand and lang only a-z0-9- (the file name is built from them, never taken from the upload), at most 256 KB compressed, at most 16 packs, at least 32 KB of free space must stay, written to a temporary file and renamed, so a failed upload leaves the old pack intact.
  • Nothing is parsed or kept in RAM on the gateway; the file is stored and streamed as it is.
  • Not part of the settings backup (a pack can be installed again). On boards with a small file system (4 MB flash) the Web UI says that packs can't be stored.

The format is specified in faults/README.md.

Why

A fault code on its own is hard to understand for most users, and the explanations exist in the service documents of the manufacturers. Putting them into the firmware would need space and updates for every brand and language, and it would make EMS-ESP responsible for texts that belong to the manufacturers. As separate files they can be corrected and extended by anybody without a firmware release, and a user installs only what he needs.

How it works

  • The Web UI reads the fault codes from the values it already has (lastcode of the boiler and the thermostat, servicecode). The brand comes from the device.
  • A pack file is validated by the Web UI before the upload: format, brand, lang, version, source and license (the origin of the texts is always visible), the structure of classes, scopes and codes, and the size.
  • Texts are plain text only (never HTML) and are shown as text; nothing from a pack is executed.
  • The same pack can be read by other tools; the format has room to grow (unknown fields are ignored).

Size

WebUI size from pnpm build-webUI (compressed, as flashed):

compressed
dev (3cd39b8) 301.4 KB
this PR 309.8 KB (+8.4 KB)

The firmware part is one service (src/web/WebFaultPackService.*, about 440 lines, plus 3 lines in emsesp.cpp/.h). I haven't measured its size in the binary; pio run -e s_16M_P builds.

Tests

  • pnpm exec tsc --noEmit, pnpm exec eslint . (0 errors; the 4 existing warnings are in generated files) and pnpm build-webUI pass on top of current dev (3.10.0-dev.11).
  • pnpm check-layout: the English casing check runs and only reports FW_RESTART_RESET, which is not from this PR. I haven't run the layout part of the script, it needs the Playwright browsers.
  • Firmware: pio run -e s_16M_P builds. The native/standalone build was not compiled by me.
  • Mock server (pnpm standalone): the mock has the same four endpoints. Tried: installing a pack from a file, the cards and the Notes tile, the lookup, the scope of an entry (checked with a device name that matches and one that doesn't), the hints for machine translated texts, a file that is not a valid pack (refused). Removing a pack was not tried in the mock.
  • Real system (Buderus GB212 + RC300 + 3 mixers) running a build of this branch (3.10.0-dev.11): installed the Buderus pack (1160 entries) from a file, again with a newer file (replaces the old one); the last fault H08(1018), the last controller fault A11(3071) and the service code -H(200) show their explanation on the cards and on the Notes tile; the lookup finds 6A 227. Not tried on a device: removing a pack, a restart of the device with an installed pack, a board with a small file system, a pack of another brand, a pack with scopes.

Translations

New keys (SYS_FAULT_*) are in all 13 languages. English and German are by me; the other languages are drafts for review by a native speaker, marked // draft, please review. The new English strings follow the sentence case rule.

Documentation

CHANGELOG_LATEST.md has two entries. faults/README.md is the specification of the format and the API.

Open points for review

  • Where the packs are kept. The Web UI links to https://github.com/beabel/EMS-ESP-faultcodes/tree/main/packs (FAULT_PACK_LIST_URL in faultPacks.ts), a repository I maintain: Buderus (about 1200 entries, German; English and Dutch drafts), Junkers, Nefit and Worcester (small lists, made from the manufacturer documents). It also has a browser editor for people who don't program. The link is one line and can point anywhere else; the firmware doesn't depend on it.
  • Copyright. The packs only contain code, meaning, cause and remedy with the source of each list, nothing else from the documents. The texts still belong to the manufacturers (see NOTICE.md of that repository), and the Web UI says that the explanations come without a guarantee. I would like to know whether you are fine with linking to such packs, and whether you want them kept somewhere else.
  • A pack for another brand that is used for devices with a different brand name (applies.brands) is accepted by the format, but the Web UI only looks up the installed pack of the device's own brand, so it has no effect yet.
  • A pack of the brand of the device is matched by the brand name the device reports; devices that report no brand only get a pack when the boiler's brand pack allows it.
  • No explanation is shown for codes that are not in the pack: the card says so.

Checklist

  • Pull request against dev
  • One feature (builds on the Dashboard of feat(webui): add Home and System menu pages #3469, which is merged)
  • Lint, type check and build pass; size reported above
  • New code is commented; only relevant files touched
  • Documentation: CHANGELOG_LATEST.md, faults/README.md
  • I accept the Contributor License Agreement in CONTRIBUTING.md

@proddy

proddy commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Copying your questions over from Discord, with my responses.

  1. Where do the lists live (the data every user gets)?
    a) My own repo, as a separate pack the WebUI loads. EMS-ESP then carries no manufacturer texts, and lists can be corrected without a firmware release.
    b) The EMS-ESP repo.

I would prefer that this all stays within the https://github.com/emsesp project. It could be a new repo with downloadable assets. The reason is that I want to limit external dependencies, if possible, and keep everything together. I have an obligation to support those people who purchased a BBQKees gateway board. I can make admin and co-owner on ems-esp so you still have full control.

  1. Where does the editor live? (https://beabel.github.io/EMS-ESP-faultcodes/editor/). A normal user never needs it, only people who want to contribute. It is one HTML file, unrelated to firmware and WebUI.

Also, I prefer adding the live web editor to https://github.com/emsesp/docs, like the other two editors: https://docs.emsesp.org/entity-translation-editor and https://docs.emsesp.org/webui-translation-editor. It keeps everything under one roof. And the scripts are there to ensure the styling is the same and the pages are automatically translated using DEEPL.

  1. The WebUI part (lookup, and showing the explanation only for the right brand and family): its own PR here, after the Dashboard.

A few recommendations here

  • add headers to the JSON files to keep consistent with the other files we generate and upload. Add a type and optional version and data. For example the System Backup looks like: { "type": "systembackup", "version": "3.10.0-dev.12", "date": "2026-11-29T15:01:31", "systembackup": [ { etc...
    And the heating backup like { "type": "heatingbackup", "version": "3.10.0-dev.12", "created": "2026-11-29 15:01", etc...

This way you can use the existing Download/Upload feature. Language files can be drag & dropped like any other supported JSON file and uploaded. That means removing the "Install from a file" in the Dashboard and only making a reference and link to the Download/Upload page. This keeps the Dashboard tidy, and we're not mixing system changes into a 'Dashboard' which is primarily used for looking at data. I believe this is a core principle we need to keep too.

@beabel

beabel commented Nov 29, 2026

Copy link
Copy Markdown
Author

Thanks, that all makes sense to me. Here's where things stand and what I'd suggest:

Already done in this PR

Pack files now start with a header ("type": "faultpack", plus format and version). The Download/Upload page recognizes them and installs them without a restart. All other JSON files go the old way.
The Dashboard no longer has an upload. It only shows the data and links to the Download/Upload page (with the usual link icon top right).
A pack is only accepted if a device of its brand is on the gateway, so nobody fills the flash with packs that can never match.

Lists and packs

Happy to move the lists and packs into the emsesp org and to take you up on the co-owner offer.
Could you create the repo (name is up to you, I'd suggest emsesp/faultcodes) and give me admin rights? Then I transfer the current repo so issues and history stay, and I switch the list link in the WebUI to the final URL before this PR is merged.
For the packs I'd add a release workflow: a tag publishes the pack files and index.json as release assets. Is that what you had in mind with "downloadable assets"?

Editor

I ported it to React in the style of the two existing editors (same toolbar, table, flag selects, translate-faultcodes.js next to the DeepL scripts) and will open a PR against emsesp/docs once the repo has moved, so it points to the right place by default.
It opens the lists from GitHub or a local folder, shows all languages side by side, marks machine translations, and "Send my changes" opens a prefilled issue in the lists repo.

Questions

Repo name OK as emsesp/faultcodes?
Are issues in that repo the right place for change suggestions?
Do you want the DeepL script to run on your side (key in the docs repo), or just stay a manual tool?

@proddy

proddy commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Thanks, that all makes sense to me. Here's where things stand and what I'd suggest:

Already done in this PR

Pack files now start with a header ("type": "faultpack", plus format and version). The Download/Upload page recognizes them and installs them without a restart. All other JSON files go the old way. The Dashboard no longer has an upload. It only shows the data and links to the Download/Upload page (with the usual link icon top right). A pack is only accepted if a device of its brand is on the gateway, so nobody fills the flash with packs that can never match.

Lists and packs

Happy to move the lists and packs into the emsesp org and to take you up on the co-owner offer. Could you create the repo (name is up to you, I'd suggest emsesp/faultcodes) and give me admin rights? Then I transfer the current repo so issues and history stay, and I switch the list link in the WebUI to the final URL before this PR is merged. For the packs I'd add a release workflow: a tag publishes the pack files and index.json as release assets. Is that what you had in mind with "downloadable assets"?

Editor

I ported it to React in the style of the two existing editors (same toolbar, table, flag selects, translate-faultcodes.js next to the DeepL scripts) and will open a PR against emsesp/docs once the repo has moved, so it points to the right place by default. It opens the lists from GitHub or a local folder, shows all languages side by side, marks machine translations, and "Send my changes" opens a prefilled issue in the lists repo.

Questions

Repo name OK as emsesp/faultcodes? Are issues in that repo the right place for change suggestions? Do you want the DeepL script to run on your side (key in the docs repo), or just stay a manual tool?

asnwering your questions:

  • https://github.com/emsesp/faultcodes is live, with you as admin
  • yes to using Issues for incoming changes, following the PR process
  • the translations I'll do in the doc repo as I have the DEEPL key, but for now keeping the app in EN is fine

it makes sense to merge this PR when everything is in place correct?

Fault code packs are files with the explanations of a manufacturer's fault codes in one language. The gateway stores them (gzip compressed) on the file system, so every browser can read them without internet: GET /rest/faultPacks, GET /rest/faultPack, POST /rest/uploadFaultPack and POST /rest/deleteFaultPack (admin). Size and names are checked by the gateway. The mock server has the same endpoints. faults/README.md specifies the format.
The last fault, the controller fault and the service code show their meaning, possible cause and remedy on the Dashboard tiles and on Maintenance & faults, from the pack of the brand of the device. A pack is installed from a file; it can have scopes (product series), flags for texts that are machine translated or not translated yet, and a lookup for a code. A pack is only used for devices of its brand. Without a pack the raw code is shown.
A fault code pack starts with "type": "faultpack", like the other files EMS-ESP creates. The Download/Upload page has a section for it with a drop zone, a description, the disclaimer and the link to the list of packs. A pack is stored on the gateway without a restart, and only when the system has a device of its brand. The Dashboard only lists the installed packs and links to that page, so it stays a place for looking at data. Texts in all 13 languages, English labels in title case.
@beabel

beabel commented Dec 1, 2026

Copy link
Copy Markdown
Author

Yes, merging this PR once everything is in place sounds right. Here is where things stand:

Everything is in place now

https://github.com/emsesp/faultcodes has the lists and the packs, and the first release (v2026-11-28) is published with every pack and index.json as a downloadable file. A new tag publishes a new release. Change suggestions arrive as issues with the label suggestion.
This PR is rebased on the current dev and mergeable. The "list of packs" link in the WebUI now points to https://github.com/emsesp/faultcodes/releases/latest.
The editor is in the docs repo: emsesp/docs#209 · Add the Fault Code Editor (same styling as the other two editors, with scripts/translate-faultcodes.js for DeepL, which you can run on your side since you have the key).

For you

Where should the editor be linked in the docs (navigation or sidebar)? For now it is at /faultcode-editor and mentioned in docs/Adding-Languages.md.
This PR adds the new Bulgarian language with the fault code texts marked "draft, please review". Could someone who reads Bulgarian check them?

Dashboard issues: a new GitHub issue assigned to me is fine, one issue per problem (or one issue with a checklist if they are tiny), with a screenshot and the page where you saw it. I will fix them in a separate PR against dev so this one stays focused on the fault code packs. If you prefer a list in this thread, that works too.

This branch has not been deployed

No deployments
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.

2 participants