(Version 0.7)
'Nextion Handler' allows you to use a Nextion touch screen device (NSPanels in particular) to interact with Home Assistant (HA). It uses a supporting Python script in Home Assitant to interpret and respond to instructions programmed into the Nextion device. You can either use the full framework to create your own fully customised UIs in the Nextion Editor, or you can use specially pre-compiled files that don't require any programing and just some very basic configuration (or you can mix the two).
There is now an ultra easy way to connect your NSPanel device to Home Assistant that doesn't require any programming or complex configuring. The new 🟠 Widget UI blends elements of the original NSPanel widgets, the Home Assistant 'glance' cards, and some of the graphical and functional aspects of Mushroom cards and Minimalist UI (popular UI mods for HA). After installation, customising your Widgets is as simple as setting up an HA glance card - you simply provide a list of entities (and optionally a name and icon to go with them). The Widget UI uses a group of pages tiled with a set of adaptable generic cards that are populated sequentially with information from your list of HA entities. The information displayed and tap interactions adapt to the type of entity being displayed so that it shows useful information from a range of attributes specific to that type of entity, not just its 'state', as in the example below.
The Widget UI uses:
- 🔹 an ESPHome template (flashed to Nextion's ESP32 chip);
- 🔹 an HA Python script (placed in your
/python_scripts
folder and configured with a YAML automation template); - 🔹 a precompiled 'TFT' Nextion UI file (that you upload to the Nextion UI chip).
Further details for the Widget UI, including installation instructions and list of current features, see the widget_ui
folder.
Demo page for Widget UI showing some of the different types of entity cards.
If you want full control of how your Nextion UI looks and interacts with HA, then you can use the full Nextion Handler framework (that the Widget UI is based on) and include its instructions in your own Nextion HMI files. Full details of the this framework, and the instruction set it makes available to program HA interactions into your HMI files, are documented in HA_NEXTION_HANDLER_INSTRUCTIONS.md. There are also resources below to assist with building attractive and effective user interfaces for your project - some of these will be useful to those designing graphics and touch interactions in their own HMI projects (not just on NSPanels or using Nextion Handler).
Screnshot examples of some pages in a customised Nextion Handler UI:
The UI_Design folder has information to help design beautiful graphics for your HMI projects (and working around some of the flaws/limitations of Nextion displays). A set of very detailed design rules for the Minimalist-style design (as shown above) allow anyone, with a bit of patience, to create stunning graphics for their displays by methodically applying and adapting the rules. Template vector graphics files include a set of prebuilt modular UI components, that can be snapped together to design a UI page, together with example pages built with these components.
The Tips_and_Tricks folder has guides and example files for enhancing the built-in capabilities of Nextion displays with more advanced processing of touch gestures and interactions. This includes HMI code and examples for robust gestures, circular sliders, and geometric functions.
- ESPHome Nextion device.
- ESPHome Nextion class.
- Masto Github config and video.
- Fix for Sonoff NSPanel display to escape Protocol Reparse Mode so standard communication protocol will work.
- ⚪ Minimalist Smart Home concept by Yuhang Lu.
- 🌻 Lovelace UI • Minimalist for Home Assistant by tben.
- 🍄 Mushroom Cards for Home Assistant by piitaya.
- Nextion HMI editor, Editor Guide, Nextion Instruction Set, Blog examples.
- Unofficial Nextion user forum.
If you want to leave suggestions, comments, or feature requests there are online forum pages for this project at:
- 🟠 Home Assistant Community Forum project page.
- 🟠 Unofficial Nextion User Forum projgect page.
- 🟠 Discord project page