NxPanel - Replacement Firmware for Sonoff NSPanel

Hi Kohrt,
i hope not.
I’m still struggling with a few things. Since I’m still at the beginning and only achieve success through copy & paste, I can’t be of any help.
I’m glad that I managed to solve my problem with flashing the NSPanel, it was probably due to the insertion depth of the ribbon cable and that forced me to change everything to 9600. Now it works.
Now I’ve worked through everything from the manual, but I’m already too stupid to find an error on the openhab page. The transfer of nxpanel_temperatur_command doesn’t work for me. Somehow openhab send nothing.
Actually I just wanted a display with buttons where I use the Tasmota Rules to show some temperatures. Now Openhab must be in between. What the hell, I’ll figure it out sometime… in 100 years…
Best regards

What I have seen is that:

  • Tasmota sits on berry
  • Rules are tasmota
  • Events are tasmota
  • The nxpanel has commands, executable from berry and some of them in tasmota. They must be prepared for tasmota (which the panel driver written in berry does). So using the berry nxpanel driver directly in berry, or using the available tasmota commands in the command line is the best option for me for testing stuff.
  • Openhab just uses the interface and should be the last point to test as there are multiple error possibilities: the panel implementation (without source code), berry panel driver, berry to tasmota communication.

I would suggest you first try the console, you should be able to setup your buttons and temperature (see documentation from @alf - I am not allowed to upload the version 2.9 PDF from him - I am a new user).

  1. Set the start page with your button configuration, which is the first page after the standard page
  2. Set favorite page
  3. Setup rules for temp display for thermostat - I just figured out how to do it with berry.
    Something like this in berry:
...
def set_fav()
    nextion.send("{\"favorite\":{\"pid\":15,\"format\":9}}")
    # for thechanged start page
    nextion.send("{\"start\":{\"pid\":15,\"format\":9}}")
    tasmota.resp_cmnd_done()
end

def set_sensor_temp(current_sensor_temp,b,c)
    log("Update current_sensor_temp "+str(current_sensor_temp))
    # Update your display - for me the thermostat
    nextion.send('{"refresh":{"pid":15,"name":"Thermostat","therm":{"temp":'+str(current_sensor_temp)+',"state":6,"heat":7}}}')
    tasmota.resp_cmnd_done()
end



# System boot/init
tasmota.add_rule("System#Boot", /-> set_fav())

# Internal temp reading
tasmota.add_rule("ANALOG#Temperature1", /a,b,c-> set_sensor_temp(a,b,c))
...

I am still not 100% sure about all this stuff but at least I can and do share something.

Have a look here: Berry - Tasmota
And here: Tasmota Documentation - Tasmota Look for Scripting-Language and Rules

BTW - I am still looking for a solution to set the target temp with one digit like 23.5°C just in case some of the people with experience or @m-home or @Alf is watching.

All the best,
Christian

Sorry, can’t help U here, haven’t played with this particular panel type myself (yet).

I would suggest that you first try to run the below command on the comand line on your openhabian system, just to check if Nxpanel is updated.

mosquitto_pub -u openhabian -P -t cmnd/nspanel_7DD7FC/nxpanel -m '{“summary”: {“title”:“Out 32°C”, “text”:“In 29°C”}} ’

(Replace and ”7DD7FC” with whatever values you got)

This should display the temperatures 32 and 29 on the nxpanel.

Next step is to do the same using OpenHAB. The channel ”nxpanel_temperature_command” does not send anything by itself, its just defining the ”address” to where commands (json strings) will be sent.

You need to setup the rule ”NXPanel Temperature Rule” to automaticallt send values from your temperature items when these change.

Hope this helps you along.

Thanks Alf, so I guess @m-home is the only one who knows if for the target temperature (set) on the thermostat page also numbers with decimal places can be set.
For me it is a surprise that this is not possible and I cannot imagine that others are using it as a thermostat…
So I give a try to Lovelace UI… It needs an external device but at least I know that temperature settings can be done in a precise way.

What have I reached so far:

  • Standalone mode with
    • Weather display
    • Thermostat page (which temperature settings are too imprecise)
    • Thermostat hysteresis control loop

A friend of mine wanted to have a thermostat but at the beginning without openhab or any other external system. So I nearly finished but I cannot install it with this impreciseness.

I am sure as long as one don’t need the thermostat page this nxpanel will do the job.

Christian

Thank you Alf
I can display the temperatures with the command from the console, that worked first.
Even the menu with the predefined icons works as described in manual 2.9.
Just not the rest.
I’ve worked through the manual a number of times, point by point… I’ve paid close attention to whether the letters are uppercase or lowercase. The nxpanel_BBAE48 entered as described… but nothing…

What I actually only want to use the NS_Panel for is to display the outside temperature and hot water temperature from my storage tank. I use the two buttons to switch the lighting directly in the garden using the Tasmota Rule.
I had hoped that you could send temperatures directly to the display without OpenHAB. Stop without Openhab, directly from the Easy ESP or Tasmota ESP with temperature sensor… I don’t need the menu function in the NS panel at all. Should only be a display of temperatures that are important to me and that I have recorded myself. The clock works at least…

Well, nxpanel does not really care about what is sending the commands. Anything that ”talks MQTT” would be able to send the temperature just in the same way as the command line command does, it is one-way information transfer, so no need to bother about responses either.

But this thread is about Nxpanel in conjunction with OpenHAB, so if you want to do something outside of this, I cannot help. But be free to steal ideas and principles from the doc :slight_smile:

Well, it is already clear to me that I would have to go a different way for my plan to display it on the display without OpenHAB. It’s not that I don’t want to use OpenHAB at all, it’s just that it takes so much effort to use it.
I use Openhab to visualize my own measurements and it works quite well. Little typing was required for this.
With the NSPanel, the effort is too high for me to output a few data.
I just found it chic to be able to read the outside temperature and hot water temperature in the living room and switch on the light in the garden without having to lay cables. What I find so critical is having everything running through Openhab and when the Raspberry dies nothing works.
Well, maybe Openhab and I will find a way after all…

@Anixi : You probably picked the wrong channel, there are two of them:

openweathermap:onecall:xxxxxx:local:forecastTomorrow#icon (type: Image)

and:

openweathermap:onecall:xxxxxx:local:forecastTomorrow%23icon-id (type: String)

Your probably picked the first one. The second one is the one you should use. It contaons string values for different weather conditions e.g. ”01d” (=clear sky).
The full mapping of the weather condition codes is available here.

Thanks Alf, The string version was not visible until I checked the box “Show advanced” it is now working fine :wink:
Just another quick question if I may, how can I change or overwrite the text “Feels” on the panel screen? I want to use that part of the panel to show the rain precipitation probability.
I already have that number but “feels” does not fit of course…
Thanks,

Henk Mollee

That’ an easy one. If you check the JSON alternatives for the home page (page 39) there are two options for the format on the bottom left and bottom right screen areas.

Bottom left – Weather information

{"weather “: {“temp”: x, “icon”:x, “feels”: x, [or] “summary”: x}
Examples:
{“weather”: {“temp”: 27, “icon”: “04d”, “feels”: 4}}
{“weather”: {“temp”: 27, “icon”: “04d”, “summary”: “Humidity 65%”}}

Bottom right – 2xTemperature or 1xTemperature + 1x Text

{“summary”: {“title”: “17°C”, “temp”:x, [or] “text”: x}

If it’s the bottom left area you referred to, use the syntax for the second option (the one containing ”summary”:”your text”)

Thanks Alf, going slowly through your instructions! So I am now managing the next panel. Everything works fine and see al the different panels ( based upon Mikes Groofy script (original). I see all messages coming by in the MQTT explorer, so that is all fine. However, after making my own panel (PID 10) it does not show on the NSpanel. I think this is caused by the missing of a “refresh” request from NXpanel but no clue how to trigger that during use.

Hi, the panel does not send anything by ”itself”, it only sends something when you push a button. A button can either lead to another button page (the panel then sends the pid of this page) or is tied to an item, e.g. a lamp you want to turn on (the panel then sends a refresh to ask you to send an update of the entire panel that holds this lamp-button with it’s now changed state - Before you pressed it was grey=off, after you pressed it should turn blue=on).

The panel is really pretty ”stupid” it holds one panel at a time, has no ”memory” of any previous panels it has shown, it just acts on button pushes. The entire logic is in the script, and the script needs to keep track of where you are in the menue-structure (see example pic on top of page 39 in the doc)

Hi, apologies but was not clear. The script is running upon NSpanel post {“page”: {“format”: 6, “pid”: 10, “type”: “sync”}} but only with a status update so no full refresh of the panel. Meanwhile I find out with the adapted script: had to add “refresh = 1 > 0” to refresh panel, another learning step!

Greetings, I just updated a US NSPanel to NxPanel, and while I am making my way through the above long chain of comments, I knew what I was getting into regarding the screen orientation. Even the stock Sonoff code/ui settings didn’t allow the screen to be used in a vertical orientation. This didn’t really concern me since I have been using Nextion screens for quite some time, and have become quite comfortable with them. If there is an HMI project that is available, I’d be happy to look a taking on the conversion to the portrait orientation instead of creating yet another (perhaps confusing) option for the community. I admit I am still reading through the timeline on this topic, so please excuse if it was published somewhere; I’m not seeing it currently in the git repo, so not sure the protocol on asking this.
Regards,
Ted.

That would be great. I would be available to do some testing if you need some of that assistance. I started to try to fumble through the setup following the EU device but stopped when I realized the screen was never going to look good.

Ben, this is good for the knowledge that there are users out there, however I would need to get the HMI project file from the original development, as I’ve been unable to locate that in any public repo so far. (That, and I have to wait for my forum privileges to grow before I can DM anyone that may have that info).
TH.

@m-home Mike do you have the Nextion file you could share with Ted?

Hi, I am obviously too stupid for the implementation. I can’t get back to the NSPanel firmware (http server on my laptop with the nspanel.tft) or the result shown.

As long as I execute the rule, I get the following error:

2023-08-15 19:22:17.338 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID ‘ad96058653’ failed: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: event for class: Script10

The Item in the “Command Thing” was created, also I have copied the rule script 1:1 in the rule but always the same error.

Any Ideas?

Thanks for your help

@BigFish10k Do you get any more info in the logs? Possible a pointer to the row in the script where the error occurs?