Integrating Your Device into Open-HPA: Describe Your Electronics with a Manifest
A device joins the Open-HPA ecosystem when it can say what it is and what it accepts. You do not write an app and nobody has to add you to a list: you declare the device in a manifest, serve it over the channel you already have, and compatible clients build the menu themselves. This guide follows the path from sketch to validation.
Status. The specification is a v0.1 draft: keys and limits may move before v1, and the trust mechanism between client and device is still open. The authoritative detail lives in OpenProtocol-HPA on GitHub, not in this tutorial.
1. Decide what your device exposes
Before touching JSON, write three lists on paper:
- What can be read: mode, profile, battery, shot count, lockout reasons, diagnostic codes.
- What can be adjusted: with range or possible values, and which unit it carries.
- What can be triggered: discrete actions, and under which conditions they are safe.
If a setting should not be touched from a phone, do not declare it. A short, honest manifest works better than one that promises everything.
2. Declare the device
The manifest starts with identity: id, rev (bumped on every change), name, vendor, category —fcu, accessory or remote—, fw, the languages you support and the transports you offer. Then come groups to order the menu, shared enums and, above all, settings and actions. Each setting carries its type, its range and the group it belongs to; that is what the client turns into a control.
3. Describe commands as templates
This is the part that surprises anyone expecting protocol logic: there is none. A command is declared as a template, for instance {"cmd":"setBurstCount","args":{"value":"$value"}}, which becomes {"cmd":"setBurstCount","value":3} when applied. No expressions, no conditions, no code. All the logic stays in your firmware; the manifest only describes how to talk to it.
4. Serve it over the channel you already have
- WiFi: three routes on the device’s embedded server —
/oph/infofor the short card,/oph/manifest.jsonfor the manifest and/oph/icon.pngfor the icon. SupportingETagand gzip is worth it: clients re-read, and a 304 saves the bandwidth of a BLE link. - Bluetooth LE: two read commands, one for the short card and one to fetch the manifest or icon in chunks, by offset and length. The client reassembles, decompresses if needed and verifies the full sha256 before trusting it.
A device can offer both transports, or no new one at all: if you already have a command channel, the manifest travels over it.
5. Respect the limits
| Limit | Value |
|---|---|
| Compact manifest | 32,768 bytes |
| Icon | square PNG, 64 to 128 px, 8,192 bytes |
| Settings | 64 |
| Actions | 32 |
| Enum values | 32 |
| Text | 120 characters |
They exist so a small ESP32 can serve everything without running out of memory. If you go over, it usually means you are declaring too much.
6. Validate before flashing
The repository ships tools/validate_manifest.py and a linter, plus the test suite under tests/. Fix what they flag first: an invalid manifest is not rejected kindly from a phone. For comparison, reference manifests are in devices/ (hatBlat and Cyclope ThermalShield) and examples/ (Universal LCD).
7. Test it with a real client
Connect from HPA Commander or the Universal LCD and see what it builds. Check two things in particular: that ranges are honoured, and that a manifest you would not trust is treated as read-only. A manifest is not trustworthy by itself — which is why identity and trust stay open before v1, and why firmware updates live outside the manifest.
8. Publish
Once it is clean, push the manifest to the repository with a rev and version bump, and ask for it to enter the catalog. A device in the catalog can be downloaded, shared and documented from any compatible client, without waiting for an app release.


