Over the past few months I’ve been working on a Nextion project integrating a Sonoff NSPanel into Home Assistant. The discussions on this forum have provided a lot of really useful information as I’ve learned my way around the Nextion Instruction set (for a ‘Discovery’ class device).
There are some parts of this project that might be of wider interest to other Nextion users. So I’ve made a folder in my GitHub project to share some of these tips, tricks, and traps with a demo HMI file and some documents explaining them. This includes:
- Gestures: simple and more advanced ways of getting swipe and press gestures to work reliably (especially dealing with some of the unexpected touch behaviours and interactions);
- Dynamic Round/circular sliders: a demonstration of some of the more advanced things that can be done with realtime processing of touch events (while duplicating the circular slider that comes on the original NSPanel firmware);
- Geometric functions: arctan and square root approximation subroutines needed for interpreting touch events for some custom UI components.