@marcfager - wanted to highlight two really smart features you have.
# Service to control the visible page from Home Assistant
- service: set_page
variables:
page: int
then:
- lambda: id(disp1).send_command_printf("page %i", page);
Very neat idea!
# Service to send a command directly to the display. Useful for testing
- service: send_command
variables:
cmd: string
then:
- lambda: 'id(disp1).send_command_printf("%s", cmd.c_str());'
This will be very handy, no more compiling and uploading to test!
[edit] do you have an example of what the cmd string might look like. Only had time to test the contents of a send method but those didn’t work. Need more experimenting.
Love the various new HMI GUIs . Some great looking ones. As I have zero design skills I’ve gone another path. I’m using the stock HMI with ESPHome. But as the nspanel component doesn’t yet implement all the widgets/thermostat I’ve very mildly modded a local copy that allows it to essentially pass through the JSON received from the panel. I can then catch that in the ESPhome log, decode and handle the GUI instruction with lambda sections in ESPhome. I can then return the necessary JSON commands through the component to update the panel in return.
The documentation from blakadder for Tasmota is absolutely invaluable - and the ability to see how both tasmota and the ESPHome nspanel component drive the screen already.
So far I have :-
nspanel component setting Temperature, Date, Time, WiFi, Relay indicators as standard
Weather updating via wttr.in (as per Tasmota) with https json request direct from the NSPanel
2-Way sync of thermostat with HA (Set temperature + On/Off)
Today the amazing folks on the Unofficial Nextion Discord discovered how to fix the problem of EU panels having their touch position offset if you’re using a custom TFT. Put this incantation into Program.s (at the top of the Nextion Editor):
lcd_dev fffb 0002 0000 0020
and everything should be good.
@gijsje@krulbel … I tried to tag folks who mentioned they were having this problem, but I feel like there were others I missed.
Could you make a backup of your panel with esphome and share it so you can recover the original HMI? In euphoria I forgot to backup the original tft I would be grateful
have errors when compiling on dev-esphome: Compiling .pioenvs\nspanel1\src\esphome\components\web_server\web_server.cpp.o</s> <s>src\esphome\components\json\json_util.cpp: In function 'std::__cxx11::string esphome::json::build_json(const json_build_t&)':</s> <s>src\esphome\components\json\json_util.cpp:28:3: error: 'DynamicJsonDocument' was not declared in this scope</s> <s> DynamicJsonDocument json_document(free_heap);</s> <s> ^</s> <s>src\esphome\components\json\json_util.cpp:29:21: error: 'json_document' was not declared in this scope</s> <s> JsonObject root = json_document.to<JsonObject>();</s> <s> ^</s> <s>src\esphome\components\json\json_util.cpp:29:48: error: expected primary-expression before '>' token</s> <s> JsonObject root = json_document.to<JsonObject>();</s> <s> ^</s> <s>src\esphome\components\json\json_util.cpp:29:50: error: expected primary-expression before ')' token</s> <s> JsonObject root = json_document.to<JsonObject>();</s> <s> ^</s> <s>src\esphome\components\json\json_util.cpp:30:9: error: use of deleted function 'ArduinoJson::JsonObject::JsonObject(const ArduinoJson::JsonObject&)'</s> <s> f(root);</s> <s> ^
as i understand: i need to downgrage to ArduinoJson v5, but i don’t know how?
P.s. changed code to ArduinoJson v6, but now have another problem: panel restarts after few seconds from main screen opened… P.s.2 maybe it’s because it deleted weather section and wifi-indicator from my code? problem is when state changed from UI Panel - it’s reboot…
This disables the nspanel component from trying to handle the responses from the panel, and simply allows it to log them.
You will also need to delete the line
lambda: 'id(nspanel1).send_wifi_state_();'
from the screen power switch section of my NSP yaml - it will cause another error, but didn’t accomplish what I needed so easier to delete.
Obviously once you’re using the local version you wont benefit from any additional functionality or bugfixes applied to the component moving forward. Ideally a “on_json_message” trigger could be added to the component in the future to achieve the same thing.
This is all very much work in progress currently and mostly I wanted to see the potential of the original panel GUI,
My panel is coming on quite nicely. But one problem I can’t get my head round is that the display disappears on the right hand side. I have the correct profile in the Nextion editor and it looks fine in the debugger but it’s almost like the image is too big.
Long time lurker, first time poster! I’ve purchased three of these units for my new house in AUS - and these truly are game changers.
I’m no UI designer, and only just started playing with both Tasmota and ESPHome, love both, and both will def have their uses.
Decided to run ESPHome on these rather than Tasmota, personal opinion is these might be better suited to ESPHome where tasmota is better for the standalone sensors without the UI.
Anyways, here’s my latest iteration of the front page of my NSPanel.
Got a bit more work to do! Love the fact that I can QR code my guest-wifi details (if you hit the wifi button it switches to a new page with the code)! this has been something i’ve wanted at my front door for a long time!
Still got some work to do but am loving this thing!
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.