Sonoff NSPanel by ITead - Smart Scene Wall Switch based on ESP32 and custom Nextion Touch Screen Panel Display (non-Pro variant)

Adding to @kabelochkaffe 's post, for anyone looking at setting up swipe detection and other gestures on NSPanels, there is a detailed guide here including a demo HMI file that you can play with in the Nextion Editor debug simulator to illustrate how everything works (and when it doesn’t). (It shows how system variables change in realtime during a gesture to help you use that data in code reliably, and anticipate cases where it will trip your HMI code up.)

The guide covers simple and more complex ways of doing swipe detection, the relative pros and cons of each, some of the traps you need to program around (particularly non-obvious interactions between your swipe detection code and sliders or other UI components), and examples of some of the key pieces of code. The full code is in the HMI file (each page demonstrates different options and features), so you can test, cut, paste and adapt that into your own projects as needed.

If you are using @kabelochkaffe 's code (which uses the touch-cap approach in the Realtime Swipe and Press Gestures part of the guide), then you might want to check out some of the traps (with solutions) you need to be aware of and program around in your HMI code with this approach.

There are some other useful tips there too for designing custom NSPanel interfaces such as some more advanced ways of using gestures to create circular/round sliders (like the original firmware has), creating some essential (but missing) geometric functions, and tips and templates for creating attractive graphics to use in your UI.

All of these features work directly in the Nextion Editor code (HMI) directly (no ESP code required for them to work).

2 Likes

Wow I missed that, a lot of good stuff there on your GitHub. Great work! :heart_eyes:

I just watched your video - nice clear explanations :+1:.

Another tip though for anyone programming in the Nextion Editor - the default (variable-width) font is terrible for reading and writing code. Do yourself a favour and change the settings to to a proper programming mono-spaced font - it makes reading and editing and spotting errors in your code much easier. (Then do the same for all your code editors.)

1 Like

I spoke to soon. Still have some issues, I think MQTT but not sure where to check and what to do

https://docs.nspanel.pky.eu/faq/#waiting-for-content-this-is-taking-longer-than-usual-on-the-screen

Johannes, you are Rock. Thank you for your help again. Everything is working like a charm.

@jobraun loving your work sir. Following your guides I got my NSPanel up and running in no time! Even setting up MQTT and AppDaemon from scratch. Thank you for all your time on this. Look forward to future enhancements.

Good day everyone
Johannes Braun thank you again , everything working like a charm. Is it possible to make a time font size smaller and weather font size bigger on US portrait version? Thank you

you cannot rescale font sizes dynamically on nextion, fonts are pre rendered in the firmware, furthermore it’s not possible to move or resize elements on runtime

for adding more fonts in different sizes into the firmware there is just not enough space

Got it
No problem , It’s looks great like this, it’s just me getting older :rofl: and can’t see as good as before
TY

This.

plus file sensor and a few other tweaks works for now. what I have is not very pretty and I could possible use some help with someone who is a bit more experienced with HA than I, but I have managed to get around a big limitation on big a yaml file could get and not being to upload it to nspanel because of the size. not having to code buttons in side the nspanel saves a ton of space.

Hey mike, how exactly did you do it? I’m facing the same problem :-/

Hi

if you mean the issue with uploading the hmi.tft file, I did the following to get it working:

  1. installed a HTTP-Server on a separate raspberry pi and created a public share with the tft-file (http only)
  2. tested the download via wget
  3. added the URL to the config and reflashed / restarted everything
  4. invoked the upload tft service via home assistant (important → don’t make a debugging connection, that will break it, just run the service without any other connection to the panel)
  5. the display should switch to the uploading / validating screen. I had to run that 2-3 times, then everything worked without issues and it’s still working so far.

if you have the NSPanel already mounted in another room, you could use a webcam or second smartphone to see if the upload starts and then run :smiley: to the display

regards mike

1 Like

I hope there will be news about the Nspanel Pro soon. I like it because of the optional case and it has a bigger screen. What I found funny on the website is the fact that there was the Home assistant logo, works with… Maybe we Start a Fundraising for kritz and jobro:)

I had no idea there was a pro version.
Doing a search for it and I even found some videos of the device.
Sadly only in Italian. Was not dedicated enough to watch them though.

Looks like a nice little device.

Widget UI has had what should be the last 0.7beta update, adding Widget card support for all 36 standard entity types after filling the remaining few with custom dashboard information and/or interactive controls (and improvements to the gesture interactions for both Widget cards and ‘popup’ pages). This includes a detailed ‘popup’ page for controlling HVAC (climate.*) devices. There is now also a new US (portrait) version that has all the latest features of the EU (landscape) version.

Thanks to @zigomatic, the new HVAC features and controls have been tested and debugged. But I’m still looking to test the other devices I don’t own ( fan.*, humidifier.*, lock.*, water_heater.*) before I update the docs and release this version. I’m happy to help any new or existing testers get this installed and set up.

The US version of the new climate/HVAC control ‘popup’ page:
WidgetUI_Climate_320x480

1 Like

Happy to contribute to your fantastic job

@jobraun I have an issue when exiting screensaver the NSPANEL seems to reboot. I am getting the message to exit screensaver in APPDaemon but the panel reboots with a blank screen then the screen saver comes back on. Any ideas please?

Cannot tell you anything without the appdaemon log

@jobraun this is the relevant log entries

2022-07-29 16:43:00.043046 INFO nspanel-2: Sending MQTT Message: time~16:43
2022-07-29 16:42:56.329097 INFO nspanel-2: Sending MQTT Message: weatherUpdate~���~22.1��C~Sat~���~20.7��C~Sun~���~20.3��C~Mon~���~20.3��C~Tue~���~20.5��C
2022-07-29 16:42:56.206220 INFO nspanel-2: Sending MQTT Message: pageType~screensaver
2022-07-29 16:42:56.165991 INFO nspanel-2: Started rendering of page None with type screensaver
2022-07-29 16:42:56.157606 INFO nspanel-2: Button Press Event; entity_id: cardGrid; button_type: sleepReached; value: None
2022-07-29 16:42:56.150404 INFO nspanel-2: Received Message from Screen: event,sleepReached,cardGrid
2022-07-29 16:42:56.142580 INFO nspanel-2: MQTT callback for: {‘topic’: ‘tele/nspanelDiningRoom/RESULT’, ‘wildcard’: None, ‘payload’: ‘{“CustomRecv”:“event,sleepReached,cardGrid”}’}
2022-07-29 16:42:36.773383 INFO nspanel-2: Sending MQTT Message: entityUpd~unknown~1|1~light~light.room_lamp~���~17299~Lamp~0~light~light.dining_lamp~���~17299~Dining Lamp~0~light~light.playroom_light~���~17299~Playroom~0~light~light.noah_bedroom_lamp~���~17299~Noah Lamp~0~delete~~~~~
2022-07-29 16:42:36.729613 INFO nspanel-2: Sending MQTT Message: pageType~cardGrid
2022-07-29 16:42:36.694244 INFO nspanel-2: Started rendering of page 0 with type cardGrid
2022-07-29 16:42:36.669041 INFO nspanel-2: Button Press Event; entity_id: screensaver; button_type: bExit; value: 1
2022-07-29 16:42:36.646456 INFO nspanel-2: Received Message from Screen: event,buttonPress2,screensaver,bExit,1
2022-07-29 16:42:36.627595 INFO nspanel-2: MQTT callback for: {‘topic’: ‘tele/nspanelDiningRoom/RESULT’, ‘wildcard’: None, ‘payload’: ‘{“CustomRecv”:“event,buttonPress2,screensaver,bExit,1”}’}