NxPanel - Replacement Firmware for Sonoff NSPanel

I´m back at trying to solve the charset issue I have.
Last time I have up and uses english instead, but now I have another NSPanel that the chilrden will use, so need to get it to work in swedish this time :slight_smile:

I got this help from Mike, so looks like it should be possible.

This is the json received på NSPanel (from Tasmota console on the Panel)

11:04:51.498 CMD: Grp 0, Cmd ‘NXPANEL’, Idx 1, Len 278, Pld -99, Data ‘{“refresh”:{“pid”:22,“name”:“Status”,“format”:15,buttons:[“status”:[{“id”:1,“text”:“Ytterdörr”:,“value”:,“ON”,“color”:2},{“id”:2,“text”:“Garage”:,“value”:,“true”,“color”:3},{“id”:3,“text”:“Förråd”:,“value”:,“CLOSED”,“color”:3},{“id”:5,“text”:“Room Temp”:,“value”:,“20°C”}]}}’

So far the text is looking fine. But below is an image of the result on sceen.
nspanel_charset_20231008_110321

I have spent a few hours on googling and trying out things. I wounder if it has something to do with Nextion driver not getting the characters as double bytes? Similar to this issue here:
https://github.com/joBr99/nspanel-lovelace-ui/issues/695

I have looked in the Barry driver, and been styding this part. But its above my skill level.

def encode(payload)
var b = bytes()
b += self.header
var nsp_type = 0 # not used
b.add(nsp_type) # add a single byte
var b1 = bytes().fromstring(payload)
var b2 = bytes()
for i: 0..size(b1)-1
if (b1[i]!=0xC2)
b2.add(b1[i])
end
end
b.add(size(b2), 2) # add size as 2 bytes, little endian
b += b2
log(msg_crc)
var msg_crc = self.crc16(b)
b.add(msg_crc, 2) # crc 2 bytes, little endian
return b
end

@InTim Can you link your map file again?
And if you have changed the script share the latest version?

Hi there,
impressive work @m-home. especially on the install part which is flawless. Also thanks @Alf for the comprehensive guide!

Are there any plans to make the HMI public? I would love to customize the heater panel for my fridge which has a fill percentage and Temperature values to display. No need for this to go into mainline for all.

Also regarding aforementioned Memory Problems. How much is left? I wonder if the frequently used pages like 8 Button and 6 Button could be duplicated to circumvent “if you use e.g., a four-button panel twice, but it then the panel needs to be re-rendered each time it’s called – an in comparison slow process”?

1 Like

Hi Mike, I’m Patrick and I thought your work was great. I’m using your build (hmi) with a script (dzvent) on Domoticz, and so far everything works. I just noticed a bug on the thermostat display! A color deviation of the thermos current and required. An 8° deviation, so that the levels and colors are identical. But I don’t know if you’re still developing the HMI…
If you give up on the evolution project, you would be nice to make your HMI available. Thank you for your reply.
thermo1

Hi, is there any manual or a specification with all features and how to use it. After install I have 2 screens, start and buttons. In this topic I found how to fill data in it via MQTT and its works, but how can I create new screens, thermostat and others ? this payload not works for me? nothing happens {“refresh”:{“pid”:15,“name”:“Thermostat”,“therm”:{“temp”:“16.1”,“set”:“17.2”,“state”:1,“heat”:1}}}

I also had the NxPanel variant in operation, but I switched to the Blockly version (NSPanel Lovelace UI Helpers (part 1/5, v1.0) - #108 by HolBaum5) because it is better documented and maintained. Personally, I also like the lovelace design better.

HI @nonojoeli, this is an old post of you but I was wondering if you ever solved these issues (sync of play state of NX panel and playlist usage)?

Hi Alf, I am still using NXpanel and picked it up again, Sonos player is now also working. However, I am making no progress with the Playlist funciontality and can also not ffinde anything on line. Can you help me out here? I get an empty playlist screen when pressing the play list button on the screen

Hi,
I haven’t used the playlist function myself, but looking in my docs OpenHAB3 and NSpanel v2.9 in chapter 8, subsection ”Panel Types”, you see that table entry for Panel Type=14 is empty as I haven’t found any examples of how to implement this.

What you need to do is to:

  1. Analyze the JSON messages passing between NSpanel and OpenHAB and try to figure out (guess) how the JSON ”refresh” response should be crafted to populate the entries in the playlist panel. You can probably deduce a bit from looking how the entries of other panel types look.

  2. Then you need to update the Groovy Script to fetch your playlist data and send this to the NSpanel using the JSON form you identified in step 1.

Hope this helps you along the road a bit

Hi Alf, thank you for your feedback and suggestions, will work on this and come back here once succesfull!

Hi Alf, getting some more info by analyzing the data but not there yet. Just a quick question:
In your doc OPenhab3 and NSpanel v2.9 there is a playlist Demo Panel on page 44. It shows 4 playlists and the Music Room in the header. However, I cannot find the code for that in the groofy script. Do I overlook and if so do you have that script somewhere?

Hi @Anixi, the short answer is ”no, I haven’t this Groovy code”. The long version of that answer below expains a bit why…
The design of the playlist panel is part of the replacement firmware that Mike built. Mike also provided a very basic sample script (second entry at the beginning of this thread with heading ”NxPanel Installation”). When I started out I used this script as base and extended it with additional scripting to get a more comprehensive example that I put in my documentation. Mikes very small example only contains the code to render two panels (PANEL_MAIN, 8 buttons and PANEL_BEDROOM_1, six buttons), for remaining panels there was no rendering code.

What I did in my extended example (Adopted Groovy Script, page 44) was to add rendering code for some other panel types, these were:

  • PANEL_BEDROOM_2 (panel type 2 - Two buttons)
  • PANEL_LOUNGE (panel type 5 - Six buttons)
  • PANEL_CABIN (panel type 3, Three buttons)
  • PANEL_CABIN_THERMO (panel type 9, Two thermometers)
  • PANEL_CABIN_LIGHTS (panel type 8, To control a RGB/multicolor light)
  • PANEL_BEDSIDE_LIGHT (panel type 7, To control one dimmable light)
  • PANEL_STATUS (panel type 15, To show the status of different items, e.g, on/off or temperature)
  • PANEL_MUSIC (panel type 13, to show media status)

For the remaining panel types (10,11,12,14) there is no sample code in my extended example, which includes panel type 14 (PANEL_PLAYLIST) which you are asking for.
Reason is that I couldn’t find or figure out how the JSON strings should be formatted for these panel types and I’m also not using these panel types myself.

image
Hi @Alf , understood my question is more how the screen was rendered with “Playlist 1”, Playlist 2" etc as in the screen shot in the Demopanel column as attached

Exactly, this is something I haven’t seen anybody implement for this panel type which is why the headings in column ”JSON examples” are left empty.
But please let me know if you figure out how these JSON strings should look and I can update both the table and also add the corresponding Groovy code.
PS. The picture is just a copy of Mikes examples in the very begining of this thread.