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

Thank you! I’ve just added the touch screen fix as I was experiencing this. I’ve not added any buttons to this version yet (apart from visually). That’s a pain with the bezel. I’ll experiment tomorrow and see if I can work out how many pixels get chopped.

Has anyone been able to pull out some of the pages and controls that are in the sonoff default screen firmware?

I actually don’t mind some of their controls and would like to see if i can use them in my own project?

Anyone know if we can de-compile the tft to pull out some of the controls?

thanks! now (after removing 100’s line) all works as expected.
one more quastion: i use relay1 as fisical thermostat (with esphome’s thermostat component), how to change to internal control? i mean control not by HA?

136 / 5.000

Risultati della traduzione

I also tried to do as described but I get this error.

would you be kind enough to pass me your funionante esphome yaml?

I also tried to do as described but I get this error.

would you be kind enough to pass me your funionante esphome yaml?

Have been continuing to explore the default Sonoff HMI/TFT. In addition to the widgets documented by Blakadder there is a uiid 11 for curtains (drapes/cover?) - See pics below.


6 Likes

Its looks like a few days ago, the nspanel component was updated to keep step with other changes in the esphome dev branch and will no longer compile against the esphome main branch. I’m at the limit of my git understanding so will try and work out the best way forward.

Is anyone having issues with weather updates from wttr.in? My tasmota’ed NSPanel seems to only update on boot, and not after.

Am I missing something obvious? How frequently should it be updating?

I’m not a Tasmota user- but have been looking at the Tasmota wttr.in code for my ESPHome implementation. It does appear to only trigger on initialisation - or if you update the location using command “NSPLocation”. I dont know Tasmota well enough, but if you can schedule an update of the location, that will cause the weather to be updated to the panel.

1 Like

Thanks @DeanoX

You inspired me to go and have a poke in the code. In nspanel.be I found the following snippet:


def sync_weather() # set weather every 60 minutes
  nsp.set_weather()
  print("Weather forecast synced")
  tasmota.set_timer(60*60*1000, sync_weather)
end

... CODE REMOVED ...

tasmota.add_rule("time#initialized", sync_weather)

so it seems like it should be updating every hour. Hmmm.

EDIT - the message “Weather forecast synced” does appear on my console. Maybe a restart has solved the problem. I will continue to monitor

1 Like

Code need change, I can post edited code later. I’m in latest dev-branch with latest NSPanel-component. So can you wait 1-2days?

This is very interesting! Waiting for new features from you :+1:

Do not recommend the following;

  • background color change with rounded icons

Too much work to make twice as many rounded buttons. Because I already have some with three states (on/off/unavailable).

My problem/challenge is:

  • How do I prevent the entire screen “flash/blink” upon changing the nextion bco attribute?

See video. Normal button val changes do not make the screen flash. But when I want my bco to match the purple of an IRL RGB room scene, the nextion flashes/blinks when it refreshes the entire page.

Suspect this could be expected behavior but I am too new to confirm and am all ears.

I’m new to ESPHome, and I’m trying to figure out how to tie in a variable in the Nextion to a home assistant sensor. There are a bunch of examples of binary sensor implementations, but I haven’t found one with a regular sensor. I tried following ESPHome documentation, but my sensor is always saying Unavailable. Does anyone have an example they can share?

You need dev-branch of esphome, and changes you can find in my test code: binary_sensor: - platform: gpio id: ${switch_id}_button_1 name: ${f - Pastebin.com

I uploaded the old version of nspanel here and have tided my yaml a little… GitHub - DeanoXX/esphome-config: Key elements of ESPHome YAML Configs

I’ve added a service to expose the “send_json” to HA - which means you can send JSON direct from HA. Much easier for testing widgets! You have to look at the logs for responses though. (n.b takes the type parameter as decimal not hex so 0x80 = 128 etc)

3 Likes

@DeanoX Thank you kind sir! The older version remedied the compiling issues I was having. Working great on my panel! Not entirely sure if the weather is updating correctly, as it is currently sunny out and 0 degrees C on the nose. :slight_smile: I’ll know later this evening as the temperature dips. :thermometer:

As it turns out, my weather is not updating. The logs for nspanel_weather were showing “Init Complete”, “http.begin OK”, and “http.GET OK”. Then nothing. So I could tell it was not entering the " if httpCode > 0" loop.

So I modified the code to add an additional debug line to report the httpCode prior to the if statement:

image

recompiled and uploaded… and this is what was logged:

image

Not sure why i’m getting a code of -1.

3 things I tried to resolve the issue:

  • added back google dns 8.8.8.8
  • temporarily disabled my adguard dns server
  • increased the esphome http_request timeout from 5 to 10 seconds.

Obviously, none of these resolved the issue - still getting -1 httpCode which skips the entire weather section.

Any ideas? Googling httpCode of negative 1 yielded nada. TIA

I think that indicates the HTTP request failed.

Does it work in a browser for you with the same DNS and default gateway settings (I dont normally set default gateway for my ESPHome…so took me a while to remember to set it) ? Ipswich is my location - maybe try without a location or with somewhere closer to you. I “borrowed” the wttr.in code from the Tasmota version so dont know too much

I think you should be able to log the error with…
ESP_LOGD(“nspanel_weather”, “HTTP Error : %s”, http.errorToString(httpCode).c_str());

1 Like

It does work fine in my browser (same dns and gateway). Also, I had previously updated to include my location as well (I missed this the first go around).

Thanks for providing the additional debug line. I added it, and I am getting a connection refused error.

image

Bizarre… I’ll have to do some more digging as to why this could be. Once I get to the bottom of it, and I’m sure I eventually will… I’ll report back. :slight_smile:

Thanks again @DeanoX

1 Like