Sonoff NSPanel Setup

What I’m working on;

https://drive.google.com/file/d/1sWaQmsnMdaYp8AzWiKXvt-078zwmo30Y/view

You can control it all via openhab with mqtt messages;
such as;

"{ \"summary\": {  \"temp\": 17, \"summ_text\":  \"New notification\" } }"
"{ \"warnings\":[{\"id\":3,\"type\":\"house\",\"state\":2},{\"id\":3,\"type\":\"house\",\"state\":2}] }"

No need to know any nextron stuff

3 Likes

W O W great job! Hope you will share at the end how you did it.
When I bought nspanel that kind of personalization stayed in my mind. Fingers crossed you finish project and share results.

I bought two panels, one already flashed with tasmota and nspanel.be file and second still original - Hope that both could look like yours some day :slight_smile:

That looks fantastic, well done. This is exactly what I hope we could achieve with nspanel.

Did you find a way to sleep the screen so that the touch wake up does not accidentally press a button?

Please can you write up the steps on how you achieve this. Obviously we can all do the tasmota, mqtt element which is well documented.

Btw there is some new stock firmware being released for the nspanel which apparently has an offset for the poor internal thermometer, not sure whether that will useful.

I’m aiming to get it so people can flash my new screen firmware, and it can be configured in realtime to the users requirements, turning on/screens and defining button flow and use. Users will not be able to add custom screens, but aiming to have enough in there that all the things they would need would be in, way beyound the stock version and aimed at working with backend hubs.

So any other show stopper needs with regards to controls?

1 Like

Re the screen dim, yes, I’ll have all that in (it’s pretty easy). I’ll have a config page the that, just not got to that yet, been focusing on the hard parts! lol

1 Like

I can imagine having a few nspanels dotted around the house for room level control of lights, shutters, music, etc.

Sub screens, I think 1 level deep is enough.

Ideally able to read in playlists for music (I use sonos)

Should be able to dim and wake without aforementioned issue.

Sounds in scope.

Idea is that you can define top level button screen from a choice of 8, 4, 3, 2 (pick closest and have blank for those not needed). Each button can be a toggle on it’s own (with custom item and name) or a link button which points to another button group, or defined fixed screen. These will be themostat, dimmer, color, music player, alarm, others. Notifications and status will be built into home page. Some small space left on somescreen, bot sure what to put there yet.

This should work for me and i think most others too.

3 Likes

You can try the example here;

Need the newer .be from this release too.

Here are a couple of examples you can send to the cmnd/nspanel/screen topic command from your openhab

'{ "weather": {  "temp": 5, "icon": "04d", "feels": 2 } }'
'{ "summary": {  "temp": 7, "text": "Humidity 81%" } }'

The weather icon take be taken straight form your openhab openweather binding, so nice and easy! :slight_smile:

I’d like to know any comments?

I program my own ESP8266/ESP32s so don’t use Tasmota. Here is how to get NSPanel configured if you do likewise.

There are 3 main points:

  1. You need to set GPIO4 on the ESP32 to low to enable the display.

  2. Whilst the ESP32 communicates with the display using pins 16 and 17 it is opposite to the standard way this is defined. Serial2 is normally, pin 17 is Tx and pin 16 is Rx but the ESP32 and Nextion display are wired so that pin 17 is RX and pin 16 is Tx.

  3. Baudrate is 115200.

I use the Arduino IDE and EasyNextionLibrary to communicate with the display and ESPNexUpload to upload the tft file. Both libraries have to be modifed to swap the pins.

EasyNextionLibrary: In EasyNextionLibrary.cpp change:

_serial->begin(baud);
to
_serial->begin(baud, SERIAL_8N1, 17, 16);

ESPNexUpload: in ESPNexUpload.cpp change:

  #define NEXT_RX 16 // Nextion RX pin | Default 16
  #define NEXT_TX 17 // Nextion TX pin | Default 17

to
#define NEXT_RX 17 // Nextion RX pin | Default 16
#define NEXT_TX 16 // Nextion TX pin | Default 17

Michael

1 Like

I`d love to test it but as understood from your project git have to be done 3steps before:

  1. upload nextion.be file (nice and easy)
  2. start up java file and within it upload tft file

could you please tip on how to startup that jar file at win10? (JavaRuntimeEnviroment 8.2.1 installed)

If java is installed and it’s registered to handle the jar shortcut, just double clicking the jar should run it.

If it doesn’t, you can at the command line;

java -jar ns-flash.jar

That´s great. Exactly as I need it, as I plan to operate it with MQTT

not so easy as expected to be, what version of JRE you recommend?
Below error after trying to open on Win10 CMD. I do have JRE 8.321 from 18th Jan 2022 so 1week old only :frowning:
C:\NSPanel0.1.0>java -jar ns-flash.jar
Error: A JNI error has occurred, please check your installation and try again
Exception in thread “main” java.lang.UnsupportedClassVersionError: systems/proto/nsflash/MakeChunksFrame has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

I’ve compiled the jar to a new version, as default. There’s no need. I’ll compile to 8 shortly and send you the link

try here;

btw, click near the right of home screen to get to the button panel… it’s still alpha!! have swipe code testing just now

I notice stock firmware is about 8mb, this is still under 2mb. So it would “appear”, there is a lot of scope for getting this to do a lot of things!

2 Likes

This is what I’ve made:



It’s not 100% finished just yet. But basically three screens. The first one is the default (that it returns to after a few seconds) and you can swipe left-right to get to the other screens.

I based it on this one:

I’ve also added a screen which shows up when not connected and basically enables you to toggle the relays (because of my use case I disconnected them from the front buttons) manually on the panel itself.

2 Likes

Ok I`m with you. JAR file works - .tft splitted and uploaded through tasmota.
Been stuck on online server for chunk files but found that OH folder named “html” works like a server and it worked.

Looks fantastic - graphics are great, smooth responsivnes. But how to get out of alarm screen or other screen to HOME? Ok found it - we have to hit name of the screen on center top.

Do you think it could be possible to made one screen for vacuum? When you step in then 8 places to vacuum would be available?

I’m open to adding a few screens that would be useful for others, since you can’t actauly add new custome screens at runtime

Currently I have;

Home
Buttons layout 8
Buttons layout 6
Buttons layout 4
Buttons layout 3
Buttons layout 2
Dimmer 1 - Brightness
Dimmer 2 - Color & Brightness
Thermostat
Alarm
Alert 1 - show and go
Alter 2 - show, OK to dismiss

Working on;
Config Screen for settings
Music Player

This complete will be version 1

Can you explain more on the vacuum screen? I don’t really understand. what would it show and what controls would it need?

Oh, and back to home by pressing title on most. alarm, is red button for now in testing

Also, current demo update here;
https://github.com/peepshow-21/ns-flash/releases/download/v0.1.1-alpha/nxpanel.tft

It’s got revised dimmer controls. Set for testing on the top 2 right one on the main 8 panel. The first is the color dimmer, 2nd normal dimmer. pressing as normal turn them on/off. longer press, get to the advanced dimmer settings. seems a nice user flow like that.

1 Like

Actually with regard to vaccum, it should work as is.

When finished you’ll be able to configure buttons in different way;

  1. Basic toggle, as in light.
  2. Dimmers - on/off, with long press for controls
  3. Page links. These just jump to another page of buttons
  4. Action - this does nothing other that send a message

Each button can be asigned an icon, from the build in pool I’ll have.

For you vaccum, you’d set a 8 page screen, all set as actions, with a vaccum icon. Room name under icon. you press the button, it messages OH. OP starts the vaccum and send a “popup” message back to nxpanel. This would show the “vaccum started messge” and jump back to home screen.

That’s the flow you mean? In which case, I’ll just add an icon

Yep, that is the Vacuum flow I imagine.
1.Do you think icon of curtain could be included? I do have motorized curtains controlled by dimmer.

2.How many levels of screens you expect to implement? Screen+subscreen and subsubscreen? Just asking no plans to use yet:)