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

Aha! Found it.

Is there a list of locations? I tried London but it’s now just coming up 0 for the weather.

I just tried the nearest city to me and it worked. London might be 0 atm ?

Paste this into your browser (the weather site used in the .be file) and it seems to set to your city:

http://wttr.in/

And then use that for your location

For more accuracy you can also use a comma separated lat/lon as a location.

Hi Chris

Thanks for posting all this. I’ve copied and pasted the stuff from config.yaml into mine and the stuff for nspanel send data back. I’ve changed the topic. As far as the unique_id and name are concerned, do I need to change these to match anything at my end?

At the moment, if I toggle a switch on the screen, it sits there for a second and then goes back to Off. And if I look at the automations, it says that the send data back one has never been run.

I’m just looking to crack one device and then I’m sure I’ll be off and running.

You need to create the raw data item that listens to the topic I linked.
Any time that item received anything it will run the automation but yes you will need to check what mqtt message is being sent and update any topic that is relevant

Unique ID and name don’t matter, but definitely create the automations yourself that way you know they’ll work
Go into the automation for send data back and read the trace log to see if it had any errors

Give the automations a minute or so after updating for them to actually run. They take a while to update in the background before becoming active. You can usually tell if you look at the list of automatuons they will all turn off then back on again for a second. That’s how you know they have been updated

1 Like

Boom! You’re a genius. My switches are now staying on.

Now to control some devices.

Just to confirm I have this straight. The NSPanel just passes an ID back to HA. If I have 50 lights then I need 50 “if” statements to tie the id to an entity. Likewise, if I’m turning a light on with Alexa then I need to send 50 messages back to the panel to put the switch on the display in the right position.

Sorry, one more question. My goal would be to have a screen per room. At the moment, I have one screen with space for 8 widgets. I swipe and get a thermostat (which I don’t want). How do I make it so I can swipe and get another group of 8 widgets?

I’m assuming it’s the .be file but I can’t work out what I need to add

I would also like to revert to the stock ui

Can’t you flash the backup you took before flashing tasmota/esphome? Or does that not contain the original tft file?

I’ve searched and searched but can’t find whether this is even possible. I want one screen’s worth of widgets for each room and to be able to swipe between the screens.

Has anyone done this?

Hi guys, or girls, and so on,

from what i understood so far, sum this up a bit:

the nspanel.be driver file is needed to talk with the nextion firmware which is installed on the nextion lcd
the firmware was decoded by blakkadar, thanks for that.
the widgets can be modiefied in the nspanel.be
atm it is only possbile to interakt with the screens available on the Display itself, with the given nspanel file and translate this back to MQTT comands which can be hence interpreted/repsonded to… by HA for example.

for having diffrent display pages it would be needed to flash the nextion panel with customer tft/hmi file which can be created with the nextion editor… The Nextion Editor Guide - Nextion

while searching and browsing the web i found this intresting project, also whit a nextion display in it.

so my question now is, would it be possible to reuse the allready achived from the HA Switchplate and port it to this NSpanel?

many thanks

1 Like

for anyone searching i found them on discord: https://cdn.discordapp.com/attachments/538814618106331139/925351768852951050/ns-panel.tft

1 Like

Nice, thanks a lot! What discord channel is this?

Unofficial Nextion User forum Unofficial Nextion User Forum

Hi,

After reading this and the github thread throughoutly I started playing a bit with my NSPanel. I managed to get both Tasmota and ESPHome running on the device, but felt slightly limited by the default GUI. I have never worked with GUIs before but gave it a try after viewing the very helpful video on the topic by Masto.

I have so far managed to create a front screen with clock, date and temperatures (actual and feels like). My plan is to add a beautiful weather widget similar to the one in the default GUI to the screen. I have done a simple media player page that is working. All the buttons (previous, play-pause etc. and playlist buttons on the top) are exposed to Home Assistant as buttons. The artist and song info is pulled from a Ikea Sonos-speaker through HA (media_player). My thought with exposing buttons (instead of directly controlling something) is to allow a flexibility to chose what speakers to use (groups) by touching the cast logo (which is a button as well).

My idea is to create additional pages to have one for lights, one for equipment (AC, vacuum robot, lawn mower robot etc.), one for bootup (before the ESP has contact with HA), but also a screen to block the panel when the alarm is turned on. I included drafts of some of them.

Some of the screens are slightly poorly centered. As mentioned earlier in the thread, the screen is slightly larger than the visible area. I tried to estimate the “dead” space but my guess was slightly off. :slight_smile:

If there is an interest for any of the code I am happy to share once I have taken it slightly further and polished it somewhat. :slight_smile: I am curious if anybody has done something similar or have ideas on how to take it further. :slight_smile:

15 Likes

That is fantastic, now I’m starting to think it’s time to get a couple of these for my house. Great work.

That’s great, I think that’s the most customization anyone’s posted so far. It feels like the information is getting more spread out – forum topics are great but get harder to search over time – so I added a public Wiki to my demo files repository in case anyone wants to dump knowledge or sample code there. (Also feel free to open PRs with more files)

If there’s a better central place for this, I can replace the above with a pointer to it.

5 Likes

That looks awesome! Yes, please share the HMI file. It’s a very nice starting point :slight_smile:

My custom design for the EU NSPanel is starting to come together nicely :slight_smile: :slight_smile:

I use the buttons to control my lights and blinds and the info bar at the bottom shows me relevant information, e.g. whether it will rain soon or when music is playing, it shows the artist and song title.

I have been banging my head on an issue with the auto-sleep functionality of the screen. I tried setting it via ESPHome YAML as well as via Nextion Editor (by setting thsp and thup in Program.s), but the screen stays on no matter what. Has someone managed to get auto-sleep working?

ESPHome related YAML:

display:
  - platform: nextion
    id: disp1
    uart_id: tf_uart
    tft_url: http://x.x.x.x:8123/local/nspanel/NSPanel.tft
    touch_sleep_timeout: 20
    auto_wake_on_touch: true

also tried:

display:
  - platform: nextion
    id: disp1
    uart_id: tf_uart
    tft_url: http://x.x.x.x:8123/local/nspanel/NSPanel.tft
    on_setup:
      then:
        - lambda: |-
            id(disp1).set_auto_wake_on_touch(true);
            id(disp1).set_touch_sleep_timeout(20);

And via Program.s in the Nextion Editor:

//The following code is only run once when power on, and is generally used for global variable definition and power on initialization data
int sys0=0,sys1=0,sys2=0     //At present, the definition of global variable only supports 4-byte signed integer (int), and other types of global quantity declaration are not supported. If you want to use string type, you can use variable control in the page to implement
thsp=20
thup=1
page 0                       //Power on start page 0

When I run the debugger in Nextion Editor with the lines above, the emulator goes to sleep after 20sec as expected. However, when I upload the tft to the screen, it just stays on.

4 Likes