HA SwitchPlate - DIY LCD Touchscreen wall switch replacement


A question for HASP users!

I’ve spent the last week stuck in a hotel room hacking at the Nextion which has yielded some very interesting results.

But first, some background. The Nextion displays we are using are made by a company called TJC, who makes the hardware, the firmware, and the editor tool some of you might have used. TJC panels are only sold in :cn:, and Nextion panels are identical but sold outside of :cn:.

The Chinese-language TJC editor is now two versions ahead of Nextion, and the latest release now included anti-aliased fonts! The difference is subtle in pictures but very obvious in person:

That’s a Nextion running firmware 0.53 on the left, TJC running 0.55 on the right.

AA fonts are really nice and I want to get HASP running w/ them as soon as possible.

There’s a problem :frowning: The 0.55 firmware with all the nice new features consumes more RAM on the panel, and the existing HASP HMI we’re all using was designed to consume every scrap of RAM so we could pack in as many use cases as possible. The current HMI will not compile under 0.55.

This means, if we want anti-aliased fonts… something has to go. We can delete a page, or even just deleting a memory-hungry component would suffice. There is really only one memory hog in the project, and it’s the graph object on page 9. So one option would be to get rid of the graph on page 9, and just replace it with some buttons or whatever.

Another option would be to delete some other page entirely. If we delete some other page, say page 3 just to use an example, then every page after that page now has a new page number n-1, meaning any automation I made or you modified that deals with something after that page will need to be modified with the new page number. So your automations for page 8 now need to be page 7 etc.

Finally, we could just do nothing and stay on 0.53 forever, leaving jaggy fonts the way they are and go on about our lives.

So, what should we do here?

  • Delete the graph on page 9, replace with some buttons or whatever
  • Delete some other page entirely, and rebuild all automations
  • Skip the anti-aliased fonts and stay on 0.53 forever

0 voters

edit: I’ve received a few questions about page 9. We wouldn’t need to delete page 9 entirely, just the graph component. Removing that one object means we get to keep everything else. If we want to keep the graph, then we’d have to delete an entire page somewhere else. I’ve been toying around with an alternate use for page 9 to give everyone an example of something else we might do.

How about a thermostat?

also… look at those fonts! So smoooooth…


Announcing the Unofficial Nextion Forums

Another new project this week has been the creation of the Unofficial Nextion Forums. The official Nextion forums are run by some pretty horrible people and it’s impossible to get any real information or help. In response, myself and some others finally decided to take matters into our own hands and launch our own site to share research, projects, tools, and tricks for working with Nextion and TJC touchscreens. We already have some interesting content, so hop on over, reg an account, and come learn with us!

If you’re interested in trying out the un-released Nextion 0.55 editor, jump on our Discord as we have found some things you will probably find helpful.

If you want to know why Nextion 0.55 is unreleased, check out this thread here.


This one’s tough. I made a flow that pulls down historic data for my 3D printer when I call up the page and publishes it to the graph so the graph populates. It’s heavy and forces my HA go digging through the logs to make a stream of MQTT messages to fill up the graph on the panel. It’s proof I’ve definitely outgrown the pi I have HA running on but don’t want to the power consumption of something more capable.

Is that ever really useful in a practical sense in the standpoint of a wall switch? No way. But it’s cool as heck. It’s pretty useful on my desk but if I really want that kind of data there’s probably a better way to display it (like just picking up my phone).


It works great.
I was a bit hard to fit all the electronics inside the box.
I printed it in glow in the dark fillement :slight_smile:


Hi. My version HA 0.86.3


When you run deployhasp.sh, it will create a folder packages/plate01 (or whatever you named your plate) and another folder hasp-examples in your main Home Assistant installation, along with the file /packages/hasp_demo.yml. Delete those files and you will have uninstalled HASP.


I have encountered the same problem on 86.3 - I’m using Lovelace in storage mode (no ui-lovelace.yaml) and after installing HASP there is no tab for plate01. If I go back to the old interface, it’s there OK but I’m not sure how to get it working in Lovelace.


Well, to answer my own question, I hacked a solution to this:
First I installed the Lovelace Migration plugin and used it to create a ui-lovelace.yaml of my current setup. I then did a bit of cutting and pasting into the Lovelace UI editor to create the tab. Here is an excerpt from my .storage/lovelace file for anyone who is interested:

  - cards:
  - type: entities
    title: plate01 Page Selection
    show_header_toggle: true
      - entity: input_number.hasp_plate01_activepage
      - entity: input_number.hasp_plate01_pagebutton1page
      - entity: input_text.hasp_plate01_pagebutton1label
      - entity: input_number.hasp_plate01_pagebutton2page
      - entity: input_text.hasp_plate01_pagebutton2label
      - entity: input_number.hasp_plate01_pagebutton3page
      - entity: input_text.hasp_plate01_pagebutton3label
  - type: entities
    title: plate01 Colors
    show_header_toggle: true
      - entity: input_number.hasp_plate01_selectedforegroundcolor
      - entity: input_number.hasp_plate01_selectedbackgroundcolor
      - entity: input_number.hasp_plate01_unselectedforegroundcolor
      - entity: input_number.hasp_plate01_unselectedbackgroundcolor
  - type: entities
    title: plate01 Automations
    show_header_toggle: true
      - entity: automation.hasp_plate01_00_automationgroupupdate
      - entity: automation.hasp_plate01_00_firsttimesetup
      - entity: automation.hasp_plate01_p0_activepagesliderchanged
      - entity: automation.hasp_plate01_p0_pagebutton1_text
      - entity: automation.hasp_plate01_p0_pagebutton1action
      - entity: automation.hasp_plate01_p0_pagebutton2_text
      - entity: automation.hasp_plate01_p0_pagebutton2action
      - entity: automation.hasp_plate01_p0_pagebutton3_text
      - entity: automation.hasp_plate01_p0_pagebutton3action
      - entity: automation.hasp_plate01_p0_pagebuttoncolors
      - entity: automation.hasp_plate01_p0_panelpagechanged
      - entity: automation.hasp_plate01_p0_restoreactivepage
      - entity: automation.hasp_plate01_p1_colorconfig
      - entity: automation.hasp_plate01_p1_scenebutton4
      - entity: automation.hasp_plate01_p1_scenebutton5
      - entity: automation.hasp_plate01_p1_scenebutton6
      - entity: automation.hasp_plate01_p1_scenebutton7
      - entity: automation.hasp_plate01_p1_scenesinit
      - entity: automation.hasp_plate01_p2_calendarupdate
      - entity: automation.hasp_plate01_p2_clockinit
      - entity: automation.hasp_plate01_p2_clockupdate
      - entity: automation.hasp_plate01_p2_colorconfig
      - entity: automation.hasp_plate01_p2_weather
      - entity: automation.hasp_plate01_p3_toggleall
      - entity: automation.hasp_plate01_p3_togglecolor1
      - entity: automation.hasp_plate01_p3_togglecolor2
      - entity: automation.hasp_plate01_p3_togglecolor3
      - entity: automation.hasp_plate01_p3_togglecolorall
      - entity: automation.hasp_plate01_p3_toggleinit
      - entity: automation.hasp_plate01_p3_togglelight1
      - entity: automation.hasp_plate01_p3_togglelight2
      - entity: automation.hasp_plate01_p3_togglelight3
      - entity: automation.hasp_plate01_p4_colorconfig
      - entity: automation.hasp_plate01_p4_dimmer7updatehasp
      - entity: automation.hasp_plate01_p4_dimmer7updatehass
      - entity: automation.hasp_plate01_p4_dimmer8updatehasp
      - entity: automation.hasp_plate01_p4_dimmer8updatehass
      - entity: automation.hasp_plate01_p4_dimmer9updatehasp
      - entity: automation.hasp_plate01_p4_dimmer9updatehass
      - entity: automation.hasp_plate01_p4_dimmersinit
      - entity: automation.hasp_plate01_p5_colorconfig
      - entity: automation.hasp_plate01_p6_colorconfig
      - entity: automation.hasp_plate01_p7_alarmarm
      - entity: automation.hasp_plate01_p7_alarmarmed
      - entity: automation.hasp_plate01_p7_alarmcodeentry0
      - entity: automation.hasp_plate01_p7_alarmcodeentry1to9
      - entity: automation.hasp_plate01_p7_alarmdisarm
      - entity: automation.hasp_plate01_p7_alarmdisarmed
      - entity: automation.hasp_plate01_p7_alarminit
      - entity: automation.hasp_plate01_p7_alarmstatuspending
      - entity: automation.hasp_plate01_p7_colorconfig
      - entity: automation.hasp_plate01_p8_colorconfig
      - entity: automation.hasp_plate01_p8_mediaartist
      - entity: automation.hasp_plate01_p8_mediainit
      - entity: automation.hasp_plate01_p8_medianexttrackbutton8
      - entity: automation.hasp_plate01_p8_mediapausebutton7
      - entity: automation.hasp_plate01_p8_mediaplaypause
      - entity: automation.hasp_plate01_p8_mediaprevtrackbutton6
      - entity: automation.hasp_plate01_p8_mediatitle
      - entity: automation.hasp_plate01_p8_mediavolsliderupdatehasp
      - entity: automation.hasp_plate01_p8_mediavolsliderupdatehass
      - entity: automation.hasp_plate01_p9_colorconfig
  - type: light
    entity: light.plate01_backlight
    name: Backlight
  - binary_sensor.plate01_connected
  - sensor.plate01_sensor
title: Plate01


Thank you, this pointed me at least in the correct direction to set it up.
Hope to hear more about how to see the card in Lovelace UI as well!!


I’ve been digging into the Lovelace situation and I’m left with more questions than I have answers. It appears that there is no support for packages at all, and two completely different ways to configure Lovelace which are mutually incompatible. The current state of affairs is a bit of a mess, and I don’t see any obvious solution to my concerns in sight.

With packages and the existing UI we get one approach which worked for all users and which allowed individual HASP devices to be added and removed without impacting other configurations. With lovelace, either UI configured or YAML configured, everything gets dumped into a single configuration file, neither of which are easy to parse from a bash script and thus forcing the user to manually create all the required entries, and of course the process to do so is completely different depending on which configuration method you’re using. There are some hass.io plugins which can help, but that only helps hass.io users, and a substantial portion of HASP users are not using hass.io.

This is deeply frustrating and I’m going to continue trying to work towards a resolution here that works for most (if not all) use cases. For the moment, you’re probably going to have to switch to the states UI in order to make configuration changes to HASP.

Fortunately, this isn’t a common interaction and shouldn’t be a huge problem for day-to-day use as most people aren’t reconfiguring HASP all that often. Still, it’s crazy annoying and I will keep working towards a resolution if I can find something that looks promising.


Maybe it’s time to look into making a custom component that generates all the entities and front end stuff. Would require a lot of Python and I don’t know what it all entails. Custom component or even a component merged into HA codebase. Just a thought.


Looks Great!


I like the thermostat page. would be nice to hide/show the temperature setpoint based on current mode.


in soldering the connection on the display, i burnt off the trace (old man eyes) is there an alternate spot to solder the tx and rx connections on the board, or is it trash?

I have two others working, now just to program. Awesome instructions and setup. Thank you for that!


HASP 0.35 release

New features, new PCB, and better performance

ESP8266 code v0.35

  • LCD serial IO is now asynchronous, resulting in better reliability, performance, and shorter boot times

  • Improve LCD connection process to better handle different models, disconnected device, and wrong serial speed

  • LCD firmware update process now fully supports TJC LCD panels

  • Changes to status update JSON to reduce memory problems and report more information back to the user

  • Better handling of LCD reset process

  • Better handling of WiFi disconnection/reconnection to be less disruptive to the user

  • Update binary compiled with ESP8266 2.5.0b3 for improved performance and several bugfixes in HTTP handling

Home Assistant Automations

3D printable models

  • Several minor updates to improve LCD fit and to provide more space between LCD and PSU when assembled


  • New PCB with two additional parts (one 2N3904 NPN Transistor and one 1k Ohm Resistor) to allow HASP to control the power supplied to the LCD. If an LCD firmware update fails for whatever reason, HASP can now power cycle the LCD in order to retry the LCD update without having to pull the device out of the wall or throw a circuit breaker.

  • The new PCB now also allows place of the existing AC PSU along with 3 new DC-DC power supply options, allowing HASP to be powered from 85-305VAC or 9-75 VDC!

ESP8266 Update Procedure

If you’re using the AutoFirmwareUpdate automation your devices should pull this update at 3:00am. Otherwise, log into the admin web page and you can pull the update from the firmware page.

Home Assistant Update Procedure

Run the deployhasp.sh script to pull down the updated automations using one of the guides below:

Links for more HASP info


No worries! Just run a bodge wire from the WeMos directly to the header for the display per the wiring table here.

WeMos Pin Nextion Cable
5V Red
GND Black
D7 Blue
D4 Yellow


sadly, it is on the nextion that I burnt the pad. It think thats the right terminology. Anyway, I can do the ground and 5 volts, but not sure on the tx or rx if there is another spot I can solder. Cant find much in documentation, and I thought I read that you had done this, so didnt know if there was a wrok around, or if the display is shot.



LOL OK I smell what you’re cookin (it’s your PCB I think :smiley: )

I think you can still save this thing! See those two tiny black things directly below and slightly to the left of the two center pads? Those are diodes that connect directly to those pads. You are going to need to be careful, because those diodes will lift right off if you give them a chance, but you can solder directly to the top side of each diode and everything should work.


Well this is embarrassing…

HASP 0.36 release

No new features whatsoever.

ESP8266 code v0.36

  • Not a single new thing added to the code, apart from changing 0.35 to 0.36

  • Ran into this problem which stems from being compiled by 2.5.0b3. This is no good, so we’re going back to a stable release.

Home Assistant Automations

  • Nothing

3D printable models

  • Nada


  • Zilch

ESP8266 Update Procedure

If you’re using the AutoFirmwareUpdate automation your devices should pull this update at 3:00am. Otherwise, log into the admin web page and you can pull the update from the firmware page.

Home Assistant Update Procedure

Run the deployhasp.sh script to pull down the updated automations using one of the guides below:

Links for more HASP info


Haha, the best change log right here