Sonoff NSPanel by ITead - Smart Scene Wall Switch based on ESP32 and custom Nextion Touch Screen Panel Display (non-Pro variant)

Here it is:

2022-10-21 13:52:01.018674 INFO bauwag-nspanel: Sending MQTT Message: time~13:52~
2022-10-21 13:52:26.383709 INFO bauwag-nspanel: MQTT callback for: {'topic': 'tele/nspanel/RESULT', 'wildcard': None, 'payload': '{"CustomRecv":"event,pageOpenDetail,popupLight,switch.nspanel_bauwagen_relay_1_2"}'}
2022-10-21 13:52:26.386487 INFO bauwag-nspanel: Received Message from Screen: event,pageOpenDetail,popupLight,switch.nspanel_bauwagen_relay_1_2
2022-10-21 13:52:26.389964 WARNING bauwag-nspanel: ------------------------------------------------------------
2022-10-21 13:52:26.390138 WARNING bauwag-nspanel: Unexpected error in worker for App bauwag-nspanel:
2022-10-21 13:52:26.390279 WARNING bauwag-nspanel: Worker Ags: {'id': '9322eac8c88143d29d0cef2bbd4e26bd', 'name': 'bauwag-nspanel', 'objectid': '18a55d0fe8824971a1963e04435776c8', 'type': 'event', 'event': 'MQTT_MESSAGE', 'function': <bound method LuiMqttListener.mqtt_event_callback of <luibackend.mqtt.LuiMqttListener object at 0x7fd89d8c6320>>, 'data': {'topic': 'tele/nspanel/RESULT', 'wildcard': None, 'payload': '{"CustomRecv":"event,pageOpenDetail,popupLight,switch.nspanel_bauwagen_relay_1_2"}'}, 'pin_app': True, 'pin_thread': 0, 'kwargs': {'topic': 'tele/nspanel/RESULT', '__thread_id': 'thread-0'}}
2022-10-21 13:52:26.390401 WARNING bauwag-nspanel: ------------------------------------------------------------
2022-10-21 13:52:26.390676 WARNING bauwag-nspanel: Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/appdaemon/threading.py", line 950, in worker
    funcref(args["event"], data, self.AD.events.sanitize_event_kwargs(app, args["kwargs"]))
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/mqtt.py", line 60, in mqtt_event_callback
    self._controller.detail_open(msg[2], msg[3])
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/controller.py", line 178, in detail_open
    self._pages_gen.generate_light_detail_page(entity_id)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/pages.py", line 612, in generate_light_detail_page
    if "onoff" not in entity.attributes.supported_color_modes:
AttributeError: 'AttrDict' object has no attribute 'supported_color_modes'
2022-10-21 13:52:26.390817 WARNING bauwag-nspanel: ------------------------------------------------------------
2022-10-21 13:52:27.117678 INFO bauwag-nspanel: MQTT callback for: {'topic': 'tele/nspanel/RESULT', 'wildcard': None, 'payload': '{"CustomRecv":"event,sleepReached,cardGrid"}'}
2022-10-21 13:52:27.124513 INFO bauwag-nspanel: Received Message from Screen: event,sleepReached,cardGrid
2022-10-21 13:52:27.129253 INFO bauwag-nspanel: Button Press Event; entity_id: cardGrid; button_type: sleepReached; value: None 
2022-10-21 13:52:27.132065 INFO bauwag-nspanel: Started rendering of page None with type screensaver
2022-10-21 13:52:27.134884 INFO bauwag-nspanel: Sending MQTT Message: pageType~screensaver
2022-10-21 13:52:27.145989 INFO bauwag-nspanel: Sending MQTT Message: weatherUpdate~���~16.2��C~Fr.~���~17.2��C~Sa.~���~18.0��C~So.~���~19.6��C~Mo.~���~19.2��C~~
2022-10-21 13:52:27.151140 INFO bauwag-nspanel: Sending MQTT Message: X
2022-10-21 13:52:54.940638 INFO bauwag-nspanel: Started rendering of page None with type screensaver
2022-10-21 13:52:54.950982 INFO bauwag-nspanel: Sending MQTT Message: weatherUpdate~���~17.2��C~Fr.~���~17.2��C~Sa.~���~18.0��C~So.~���~19.6��C~Mo.~���~19.2��C~~
2022-10-21 13:53:01.018817 INFO bauwag-nspanel: Sending MQTT Message: time~13:53~

You cannot open the popupLight page for a switch, this doesn’t make sense and is completely unrelated to the status icons. For the statusIcons you just need the configuration in apps.yaml nothing on esphome. The appdaemon log during opening the screensaver is relevant for that.

Hi, i dont have nspanel-livingroom Nextion inited" enabled in HA . In the esp logs i get NSPanel Buero Nextion inited’: Sending state ON. how can i enabled it in HA? Or can anyone share his config ? I have to use the switch to use the blueprint in HA.

@Blackymas I’m struggling to get this working correct.

What I did: Followed instructions on your github (german ones at the bottom).

ESP is flashed. NSPanel visible in HASS. Blueprint filled out and generated automation running. Tft successfully uploaded to NSPanel.

What I get: Basically only a working thermostat. For instance setting the soft buttons (or the hard ones for that matter) have not been succesfull.

Any tips on how to troubleshoot this?

Hello,

already to read that you try my version.

First, please take esphome, blueprint and tft from the beta folder.

I have added a massive improvement and very very many new features.

  • New button design (fully dynamic createable via blueprint. With auotmatically generated icons and brightness and positions display.

  • completely reworked weather now with default weather and only one field for accuwetaher.

  • almost all needed variables are created automatically in the blueprint - so the setup of the blueprint is totally easy.

If you still have questions write me a private PN

The new documentation will follow.

One more hint why it won’t work. you have to use the entity name in the name field.

e.g. an entity from nspanel is called

Sensor.nspanel_buero_last_click

then you have to enter in the field name - nspanel_buero.

I use the same principle for the field weather

1 Like

Hello

i got a little Problem i use The Ns Panel with Tasmota and Lovelace UI that workes Great so far.

Now i wanted to add some of my own Pages and tryed some things.

I try to send a value to a Button in the Nextion screen that it changes from off to on.

service: mqtt.publish
data:
  topic: cmnd/nstopic/CustomSend
  payload:  cardQR.button1.val=1

I try it like that but it doesnt work at all.

I saw an example on esp Home but ofc it dont work on Tasmota. May someone knows what i do Wrong here.

Thx in advance

Thanks, i will try! Otherwise i send you a PM.

this won’t work, please share some details what you are trying to implement with your page

I use your Ns Panel Lovelace Ui. And i want to implement a new Page, That works with Pictures “crop image” (I have an 3d Picture of my room with lights on and off and i want to implement this as a Page)

Atm i use the QR Card since i dont need it for me and i found an example how this could work.

In this video u see what i try to do, send the value 1 that the Picture gets “Active”

I got it Work like in the Video till that point where i need to send the value to the Nextion Screen i tryed a lot and i dont know what i need to send to get the value to 1.

The Card is cardQR , name Ambiente2, and the Button is called button1 with the id 31.

The panel is controlled though custom serial messages, that are parsed in tmSerial on each Page.

If you want to have buttons on top of your picture, the easiest path is to clone cardGrid and adjust the size/background of the icons to your needs.

To be able to navigate to the cloned page you need to alter the pageType command on each page add your new page.

To let the backend generate the required string for the 6 entities, you need to add the name of your page to this list.

OK I tryed that named theCard cardGrid2 but when I hit the Card on the Ns Panel it stays full black

Changed things to the beta version now. Suddenly have an issue that the tft file (by calling the service) is loading extremely slow to the panel (13% in an hour) and I’m guessing it will fail. Did anything change here?

p.s. on the customizations (for instance the small called “button”), double check; Beside the blueprint (button 1 entity & button 1 name) am I supposed to change anything in the esphome.yaml or via de nextion editor? How does the panel get the information that (for instance) the button name has to be “living room light” and it controls an RGB light?

Buttons their content etc is fully automated built into the blueprint.

There is nothing to change on the part of esphome.

Problems with TFT upload I know only if Lovelace ui was previously installed. The version Lovelace ui has a special feature in the code somewhere. If you flash e.g. the NSPanel with my ESPHOME code it is impossible to upload any tft.

To solve the problem you have to reinstall Lovelacee Ui completely. Then upload a blank TFT or my TFT. And only after that flash the NSpanel with my ESPhome code.

But should not be the case with you.

The TFT already runs with some should therefore not be the problem of the TFT.

Just to clarify & context

I never used anything else; I took it brand new out of the box and flashed it with your Esphome version (the normal one, not Beta). Last step in your instructions was to upload the tft (I do this by calling the service). This all went well for the non-beta version. I had a running panel (with limited functionality as mentioned above)

Now I have changed esphome.yaml & blueprint to beta. Uploaded beta tft to the correct folder. Installed the esphome.yaml to panel (all went fine), last step calling service to upload the (beta) tft and getting this super slow upload.

Can’t tell now why your tft upload is so slow.

The TFT files are almost the same. The beta version is a bit bigger.

The upload takes me between 3-5 min.

Is it currently running on or has it stopped?

If it has stopped upload the stable tft again and then again the beta tft.

If you still have problems it would be better to write me on Discord → Blackymas

I’d like to request this as a feature to the lovelace-ui

"I struggle to drive input_select entities values.

They currently only show the values on entitiesCard (on GridCards I only get an icon) and they only evolve in one direction when tapped (say I have got a,b,c,d to select from, every time I tap ‘a’ goes to ‘b’, then ‘c’, then ‘d’, then ‘a’ again).

It would be nice if input_select featured up and down arrows to move selection in both directions and also on GridCards.

Thanks for considering this"

I tried the github feature request but it keeps telling me I need to fill up a template that is nowhere to be found.

Can anyone help?

Hi I think with this Picture I can better describe what I try to do.

Is it even possible to change the Val in the circle of the picture over an simple Mqtt command when I use tasmota and your Lovelace?

Hi,

Looking at your Git it appears you do not support a US-P NSPanel or have I missed the setting some where.

at the moment i only have the eu version.

But I can give you the hmi file and you don’t have to do anything else but move the positions of the fields and adjust them to your display.

The code remains the same

Ok, Progress.

  • re-uploaded the non beta tft version > went fine
  • then tried again with beta tft again > success
  • Noticed i made a typo in the blueprint “nspabel buero” instead of “nspanel_buero”
  • installed the ESP again > and yes! My stuff showed up

Now few questions (posting here as might be usefull for others):

  • Weather: You commented out weather in esphome beta. Can I just uncomment that (and change to my own weather service as I did with the non-beta version? I use weather.buienradar and as far as I can see this has the same attributes. Now using accuweather ; home screen has changed but the other days still show ‘old’ data.
  • There are many unused pages (I only want to have 1, max 2 pages of ‘buttons’) can I remove them somehow?
  • Last page now shows what I think is a standing light. Can I remove that somehow?
  • Do I assume correct that everytime I make a change to the blueprint (eg adding a button). I should reload the automation and re-install ESPhome? [UPDATE: NOT NEEDED]
  • Some stuff is in German: can I change that on my own? [UPDATE: Changed to EN in blueprint and most changed, weather day names are still in German]
  • Is there a possibility to completely dim the screen (black) after a certain time?

Thanks for the great work so far!