If you customise your NSPanel screens, you’ve probably hit the part where every change
means opening the Nextion Editor, clicking through it, and then having no way to tell
what actually changed between two versions of a file. .HMI is an opaque binary, so
it doesn’t diff, doesn’t review, and doesn’t fit into any normal workflow.
I got tired of that on my own project and took the format apart. The result is a small
tool, no dependencies, Node 18+:
What it does today, without the Editor:
- Decode a page into readable text — every component with all its attributes. This
is the one that changes your workflow: it makes.HMIfiles diffable in git for the
first time, so you can actually see what a change did. - Show what’s in the file — images, fonts, pages, their sizes and slots.
- Extract images out as PNG, including the awkward part where landscape projects
store them rotated. - Replace image payloads in place — swap icons or graphics from a script, no Editor
involved. This works because images carry no checksum. - Verify the internal checksums, which tells you whether a file is genuinely corrupt
or you’re just opening it with the wrong Editor version. Those two look identical from
the error message and need completely different fixes.
What it does NOT do, so nobody wastes an evening on it:
It cannot build an .HMI from scratch, and it cannot make structural changes — adding
components, resizing images, changing the page layout. The container has a directory
with a checksum I was not able to crack, and I documented that dead end rather than
pretending otherwise. Structural edits still need the Editor.
So: think of it as a way to inspect, diff and script the boring parts, not as a
replacement for the Editor.
There’s also a full write-up of the format in the repo if anyone’s curious about the
internals — including the block checksum, which is what produces “Version mismatch” and
“Loading Page Failed” when a file gets edited by hand.
I built this for a battery-monitor screen of my own, so I’ve only scratched the parts I
needed. If there’s something specific the NSPanel workflow keeps tripping over, tell me
what it is — I genuinely don’t know what hurts most on your side, and it’s probably
easier to add than you’d think.