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

We have published our ‘first impressions’ including a first esphome config. Sadly the display and the NTC temperature sensor are not working yet.

Check: https://espthings.io/nspanel

4 Likes

I am not a C/C++ programmer so wonder if the ESPHome (and Tasmota) firmware for ESP32 be made to support Nextion touch-screen displays via Itead’s “iteadlib” library?

https://github.com/itead/ITEADLIB_Arduino_Nextion

As I understand Nextion displays as its own integrated MCU so that all text and graphics, animations, etc. are created using Nextion Editor software, and then then the project files/assets are uploaded directly into the Nextion screen. The screen then has serial commands mapped to UI elements and can be sent and received from ESPHome firmware to control it. So the Nextion display’s own MCU off-load most of the heavy lifting, or is that incorrect?

https://nextion.ca/portfolio-items/nextion-iteadlib-and-esp32-step-by-step/

https://nextion.ca/tutorials/

https://nextion.tech/faq-items/iteadlib-arduino-nextion-library/

https://www.youtube.com/watch?v=FSRx8h8iBnk&ab_channel=AndreasSpiess

https://www.youtube.com/watch?v=eI-4_QyVenw

https://diyi0t.com/arduino-nextion-display-tutorial/

And to also add an easy-to-use UI for file upload to Nextion displays to ESPHome could maybe base it on something like this ESPNexUpload?

https://github.com/Nredor/ESPNexUpload

Kickstarter campaign is now live and early bird price is about $54 (while the MSRP is listed as $75):

https://www.kickstarter.com/projects/sonoffnspanel/sonoff-nspanel-smart-scene-wall-switch/

https://www.kickstarter.com/projects/sonoffnspanel/sonoff-nspanel-smart-scene-wall-switch/

Many tech review bloggers seem to complain on its lack of integrated motion sensor and I like to also add request for its temperature sensor to be replaced with a temperature and humidity combo sensor.

Hope that ITead will replace the DS18B20 sensor with AM2301 or Si7021 as should add much cost.

2 Likes

esphome can already do all of that. The issue is that we can’t get the display to work.
Nextion TFT LCD Display — ESPHome Display
Nextion TFT LCD Display — ESPHome .tft file upload

api:
  services:
    - service: update_nextion
      then:
        - lambda: 'id(display1)->upload_tft();'


logger:
  baud_rate: 0

uart:
  id: uart_1
  tx_pin: GPIO17
  rx_pin: GPIO16
  baud_rate: 921600
display:
  - platform: nextion
    id: display1
    uart_id: uart_1
    tft_url: https://your_ha_url:8123/local/nextion/display.tft
    brightness: 25%
    lambda: |-
      it.set_component_value("gauge", 50);
      it.set_component_text("textview", "Hello World!");

Our config also has this configuration in it: https://espthings.io/nspanel

3 Likes

FYI, openHASP (HA SwitchPlate HASPone fork) andf HA SwitchPlate HASPone are two other existing firmware for Espressif microcontrollers which does not look to rely on iteadlib library and yet apparently support Nextion/TJC/STM32F4 HMI touchscreen / scene display controllers and ESP32 or ESP8266. openHASP at least instead rely on the lvgl graphics library.

https://github.com/HASwitchPlate/openHASP

https://haswitchplate.github.io/openHASP-docs/

https://lvgl.io

https://community.home-assistant.io/t/openhasp-an-mqtt-driven-touchscreen-scene-controller/300853

https://github.com/HASwitchPlate/HASPone

1 Like

Got this in an email from them…

Nextion HMI Project Upload Protocol

5 Likes

That enabled us to add the NTC and buzzer during the lunch break, but I’m afraid the display is doing something funky. I will contact Sonoff about that :frowning:

Check Sonoff NSpanel - first impressions! - espthings.io for more…

1 Like

Double check that baud_rate, maybe? :slight_smile:

£45 for the UK. (inc Shipping)
Backed!

@blakadder is doing a full teardown and has managed to get the Nextion screen type after issuing the upload protocol sequence:

comok 2,30614-0,NX4832F035_011C,48,61744,16643401829EF850,16777216

This means its a Nextion Discovery 3.5” NX4832F035 (Datasheet).

Over at the Unofficial Nextion/TJC User Forum discord we’ve been making some discoveries:

  • The stock firmware serial baudrate is 115200
  • The stock firmware has Protocol Reparse and Address Mode activated
  • You have to put the Nextion into passive mode to processes serial data according to the Nextion Instuction Set
3 Likes

I’d be more interested in seeing a version without the A/C side components and powered by USB. This would make a great HMI unit and provide more flexibility for mounting.

2 Likes

That should be easy enough to make actually, or for them to produce as the powerside (relays, filter etc) are on a separate board from the esp and display, there are even 5v and 3v3 headers on the board so it could be powered directly.

All it would need is something like a 3D printed rear case and a USB port extended or something to make it in to a self contained USB powered display, lot of options I’m sure.

Can’t wait for mine to turn up, managed to snag 2 in the early bird sale

1 Like

Since the design is modular it would be relatively easy to connect a USB using the headers.

During testing I was powering it straight from 5V using them and no issues.

3 Likes

Thats great news, since i do not have 110V/230VAC in my sockets. I have KNX cables with 24VDC. So i could decide to run 5VDC rail instead, or keep 24V and a DC/DC converter in each wall socket. Currently i have no wall switches, so i am planning to buy 20 pieces of this panel for all sockets in my house.

Sure, you can take out the relay unit from the metal frame and replace it with a custom solution including a DC stepdown converter and a header to plug the touch plate in

4 Likes

Double check that baud_rate , maybe? :slight_smile:

And why is that?

I tried al possible baud rates btw. :wink:

The baud_rate of uart should be 115200 to match the native speed of the stock firmware.

Also ESPhome only sends the connect command to the Nextion. That doesn’t work because the NSPanel is in Protocol Reparse mode. You need to send the full escape sequence from the Nextion Upload Protocol v1.1 instead to exit Protocol Reparse mode.

Try to change check_connect_ to:

    this->send_command_("DRAKJHSUYDGBNCJHGJKSHBDN");  // escape Protocol Reparse mode
    this->send_command_("connect");
    this->send_command_("ÿÿconnect");
2 Likes

Looks like other folks are figuring it out. I initially thought there was a typo in there.

Thanks, I tried 9600, 115200 as well, but not what you describe above.

I’ll have a look at it, not sure yet how to do this.

1 Like