NxPanel - Replacement Firmware for Sonoff NSPanel

@m-home , @Pentium4 really great job

Hanz in iobroker you have to adapt the javascript provided by @Pentium4. You can use a event trigger, something like this:

mqttCmndId = ‘mqtt.0.nspanel-wz.cmnd.NxPanel’;
on({id: mqttResultId, change: “any”, ack: true}, async function (obj) {
resultObj = (function () { try {return JSON.parse((obj.state ? obj.state.val : “”));} catch(e) {return {};}})();
var str = resultObj.toString();
// and for example
if (getAttr(resultObj, ‘page’)){ // do something}
else if (getAttr(resultObj, ‘button’)){ // do something else}
})

Great work Mike!!!
If would I edit the graphics with my custom light icons?
Bye
Sandro

There is not any way to add custom icons at runtime, unfortunately everything needs to be compiled in when it’s built, graphics even the fonts you want to use. I’m open to adding a few more useful icons people might need/want, that’s not too bad to do. But they still need built in where the tft is compiled.

Any ETA on a possible American portrait build?

Do you have any plans to release the HMI file as well, so that we can make small changes like this ourselves if someone wants to play around with the Nextion Editor?

No plans for that at the moment. A change to portrait is not a small change, it would be significant. It would need to be a whole new version which would need maintained as a totally different stream. There is a still a lot of dev going into this and I would need to all be done twice. Nextion, is not geared for code reuse! lol I think what I said last time, was when the EU want complete and had become stable, when I had time, I might do a landscape version. But would only be after it was stable, because I really don’t want to be doing to branches. As for the HMI, no current plans for that at all. If it was missing anything major, I’d rather it was logged and added to the core, for the foreseeable anyway. I’ve added most features people have asked for todate.

I don’t see how that would prevent you from simply posting the hmi and updating it every once in a while.

Hello and thanks a lot for sharing your great work.

I tryed to follow all the how to but I still struggeling to get it up and running. I have some basic know-how but I’m not a coder. What I have achived:

MQTT Broker is running
NS Panel is flashed and NXPanel is installed
NS Panel send request to Openhab
Script is triggerd by MQTT request

But the script never sends any answer. Openhablog logs following error:
Script execution of rule with UID ‘NxPanel_DG_Refresh’ failed: javax.script.ScriptException: java.lang.NullPointerException: Cannot invoke method publishMQTT() on null object

I don’t know what I have to configure. How can I link Items to button or display any informations. I allready spend some days to try find out myself. Witch step do I have to follow?

Thanks for any hint.

@aco, Are you using the demo script from the 2nd post in this thread?

There is a line near the top;


def logger = LoggerFactory.getLogger("org.openhab.core.automation.nspanel")

def mqtt = actions.get("mqtt","mqtt:broker:mqtt_broker")

def str = event.getEvent()

Where it sets the id of your mqtt broker. The 2nd param is the name on my system for this, you may have called yours something different;

There error sound like that is null, when it tries to use it. I’d check that and make sure the mqtt variable is set because it finds your broker.

1 Like

Sorry but it’s might be a silly question.

I added this chanel and linked to a item. If I now turn on the light the icon on NSPanel is update automaticly. But I can’t turn off (or on) the light from NSPanel.
How can I control the light from NSPanel?

Thanks for your project. I try to display Vietnamese, but it can’t.

the screen doesn’t have multi-language fonts. so any text, will be English.

Hi Mike I’ve been testing this for a week now and functionally it works well but I am a bit frustrated by the page load times. I have 2 pages with 8 buttons and there is probably 2 seconds delay as it draws the screen. The home page is instant. Is this normal or is there something I could do to improve things.

If I swipe from the main screen the page load is instant, its just when I load pages from a button push.

One of my pages is just static push buttons so does not need any backend processing to update their status.

The issue is because if you have 2 pages both using 8 buttons, it needs to configure them each time it moves. It’s really the worst of all possible options, to have 2 pages of 8 :confused: is it possible to have 8 as the main, then maybe a page of 6 and some sub pages of 4 and 3. this would be much faster as smother, as the 8 would only be for a single page then, so when you moved back, it would keep it’s state.

1 Like

Yes I tested a 4 button page and it made a big difference almost instant refresh.

Hi Mike, Would it be possible to make weather and status active on the main page so that for weather the backend (openhab) could pass back weather forecast for the next few days. So default to current days weather, first press forecast tomorrow, next press forecast day after tomorrow. If screen could pass back an integer to indicate number of times area was pressed the backend could act (or ignore) accordingly. Might need some changes to the layout for the weather area as high/low temperature rather than feels like would make more sense. Same for status and pressing on the status area could be managed by openhab as per users requirements.

On a different note, if it possible to send an alert to the screen from openhab without having nxpanel send a refresh? If so, is there some example json?

Is the main page fixed at 8 buttons?

No it’s not, it can be any, but I’ve maybe not added a call to set it, I’ll check and make sure for next release

Hi, Mike, I am using NxPanel with OH3 and everything based on DSL rules. Was not easy, but now it’s working. Some questions:

  • From time to time I get messages {“warning”:“buffer-wait”}, don’t know why?
  • How can I set the Current temperature on a PAGE_THERMOSTA?
  • I saw on your video, that should be possible to go back one page by clicking on the name of the page. It’s not working, I am using version 1.0.7
    Thanks

I do not know why but I do not understand the REGEX
That’s how I set the button what’s wrong with it ? :wink:

  • id: therm_Power
    channelTypeUID: mqtt:switch
    label: therm Power
    description: null
    configuration:
    commandTopic: cmnd/tasmota_7DDCCC/nxpanel
    formatBeforePublish: ‘{“sync”:{“pid”:15,“state”:%s}}’
    transformationPattern: ‘REGEX:(."therm"."pid":
    15,.*)nJSONPATH:$.therm.[?(@.pid==15)].state’
    stateTopic: tele/tasmota_7DDCCC/RESULT
    off: “0”
    on: “1”