NxPanel - Replacement Firmware for Sonoff NSPanel

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”

@jonny211, your quotes look odd to me. You are also missing some part of the regex, if you compare. It’s looks wrong in a lot if ways. This is yours;

 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”

Mine looks like this;

  - id: nxpanel_cabin_heater
    channelTypeUID: mqtt:switch
    label: Cabin Heater 12
    description: ""
    configuration:
      commandTopic: cmnd/nspanel/nxpanel
      formatBeforePublish: '{"sync":{"pid":12,"state":%s}}'
      stateTopic: tele/nspanel/RESULT
      transformationPattern: 'REGEX:(^\{\"therm\".*\"pid\": 12,.*)∩JSONPATH:$.therm.state'
      off: "0"
      on: "1"

Copy mine, and just change the 12 to 15 (for you) and your topic.

The warning is not an error, it’s just a message. It’s when the nextion sends a message back to the esp and it’s not complete in one buffer read. It shouldn’t have any impact of functionality.

for the thermostat, these are the channels I use for the set temp, power on button, and heat indicator;

  - id: nxpanel_cabin_heater
    channelTypeUID: mqtt:switch
    label: Cabin Heater 12
    description: ""
    configuration:
      commandTopic: cmnd/nspanel/nxpanel
      formatBeforePublish: '{"sync":{"pid":12,"state":%s}}'
      stateTopic: tele/nspanel/RESULT
      transformationPattern: 'REGEX:(^\{\"therm\".*\"pid\": 12,.*)∩JSONPATH:$.therm.state'
      off: "0"
      on: "1"
  - id: nxpanel_cabin_heat
    channelTypeUID: mqtt:switch
    label: Cabin Heat - 12
    description: ""
    configuration:
      commandTopic: cmnd/nspanel/nxpanel
      formatBeforePublish: '{"sync":{"pid":12,"heat":%s}}'
      off: "0"
      on: "1"
  - id: nx_cabin_set_temp
    channelTypeUID: mqtt:number
    label: NxPanel Cabin Set Temp - 12
    description: ""
    configuration:
      commandTopic: cmnd/nspanel/nxpanel
      unit: °C
      formatBeforePublish: '{"sync":{"pid":12,"set":%s}}'
      stateTopic: tele/nspanel/RESULT
      transformationPattern: 'REGEX:(^\{\"therm\".*\"pid\": 12,.*)∩JSONPATH:$.therm.set'

for the current temp. I have rule on the temp change that does this;

def cabinTemp = ir.getItem("CabinDevices_CabinRoomTemperature").state.intValue()

json = String.format(
  "{ \"sync\": { \"pid\":12, \"temp\"=%d }}", cabinTemp)
mqtt.publishMQTT("cmnd/nspanel/nxpanel", json)

Thanks

Thanks a lot, it works fine.
Still some more questions. Is it possible to go back only one page.

  • E.g. from the 8-button main screen (pid=10) I will open a new 6-button page (e.g. pid 101). Now I will move back to pid=10.

  • There exists a push button (const BUTTON_PUSH = 2) Is the only difference to a toggle button that the icon does not change? When I push the button I get {“button”: {“pid”: 10, “bid”: 3, “state”: 0, “next”: 0}} How can I react?

Got some time to work on my dashboard today and I have a few questions:

1 - How can I update de notifications? [edited](founded in a old message you sent)

2 - I can’t edit the favorites icon… what am I missing? ‘{“favorite”: {“pid”: 30, “format”: 10}}’ [edit] (it was the quotes… my mac will change the quotes to the ones in the example, “” instead of “”)

3 - I’m having problems handling the buttons in the dimmer pages… When I click in the button to turn on or off, the message I receive is:

{“dimmer”:{“pid”:20,“power”:0}}

but when the button clicked has no “next” page (just a simple toggle button), the message is:

"{“button”: {“pid”: 10, “bid”: 3, “state”: 1, “next”: 0}} "

This is causing me problems because I want to control my blinds using the dimmer page. When I press the button without holding it (just turning it on or off), I want the blinds to open or close, but when I hold the button, I could set how much I want it to open or close.

The problem is. I want to update the dimmer page based on the state of the blind. So when I tell it to open or close, the slider and the button in the page should reflect that state. I can differentiate when the button is pressed in the dashboard screen or in the dimmer page, because of the presence or absence of the “dimmer” parameter in the json. But there is no way I can’t tell if what sent the message was the button or the slider, because both messages lock the same. And I need to be able to tell where the message came from, so I can decide if I should update the slider, because the button closed the blinds or if the blinds were adjusted by the slider and I shouldn’t update the screen.

4 - how can I tell what page I’m currently in? Since the blinds are slow when opening and closing, I would like to update the page every second or so, based on it’s current state, but I would have to be sure that I’m still in the dimmer page, otherwise, the dashboard behaves weirdly when I call the refresh of another page in it.