HA SwitchPlate - DIY LCD Touchscreen wall switch replacement



little idea need suggestion or advice or point in right direct from every one specially @luma,

I am planning to make few of installation to one of my building which is under construction so, this is the idea how can we make wifi dependency go away and use a LAN connection for this may be a Arduino uno using a ethernet shield and siting at back on some DIN rail

Any ideas on it how it can be accomplished ?

Thanks in advance


You just described how it can be accomplished.


@luma, your sign up link for AllPCB does not seem to work. Could you give me one that works, so I can accredit it to you?


Unfortunately it seems their invite/referral system is broke at the moment, so feel free to just go ahead and place an order from the main page. Thanks for trying!


I am in no rush, would you mind notifying me/the thread once it’s up and running again?

I have a few questions:

  • I am intending to use the 7 inch LCD, anything I need to keep in mind that’d change?
  • What would be the advantage of using an ESP32 vs. the Wemos Mini?
  • Has anyone actually designed a PCB for the ESP32?



For the 7 inch you’re going to need a new power supply. Depending on the model, you are going to require somewhere north of 500ma just for the display. The ESP32 brings with it a lot of new features, many more IO pins, bunch of ADC capabilities, bluetooth, etc… none of which are used by the HASP project but could be added in if you feel the need. The main codebase may work directly on ESP32 but I’m less sure of the libraries. PCB design for the ESP32 is basically the same process, one would need different footprint depending on the module in use but there isn’t anything else too different to consider.


So, I’ve ordered the 5V AC DC converter, can I basically not use it here?


If it’s the Mean Well IRM-03-5 used in the HASP project, it isn’t going to work w/ a 7" Nextion. That’s a 3W PSU which @ 5V means 600ma. The ESP8266 can spike up to ~ 500ma, and the Nextion 2.4" display has a max draw of 90ma. So this is all fine for the project as designed, but if you’re going to swap out a 90ma part for a 510ma part, you’re going to need to beef up your PSU to match.


Thanks a lot, Luma. I will have a look. Should have asked before ordering 6× IRM-03-5s. You don’t know off the top of your head if there is a similar one available?

Presumably, this one would fit the bill?


That should handle everything you’re looking at! Note that it’s physically larger than the 3W model, so you’ll need a new footprint to make that work on a new PCB.

If you’re in the US, and you don’t have the ability to return those 6 PSUs, shoot me a PM - I’d be happy to buy them from you if you’re looking to get rid of them.


Ok, I’ll have to get all of this based on a new PCB.

I am Switzerland-based, so unfortunately not.


I wonder how hard would it be to add presence detection?
I have not studied the code, but there is already a mqtt channel.
Just for grins, I order an ESP32 with my ESP8266.

These are the links that got me thinking this way …



I hate to ask a question that seems like it may be asked & answered, but I have really looked through a lot of posts. I just need some nudging, then I can take the next step(s)

I must have some wrong assumptions somewhere.

I am using a NodeMCU Amica, white bottom. I have used it testing other projects, in fact when I plugged it into the serial cable and started the monitor, it was sending status for the last thing I was testing. (Trying to see if I could read two HC-SR04)
First I tried to compile v .37 and got errors. Then I loaded the bin file. When I start the monitor with 115200, I get junk, like a wrong baud rate. I am new to Nextion so I started studying it some. So let me break up my issues into different sections.

First, start with Nextion. I have the editor running and the ‘HASwitchPlate.HMI’ loaded. When entering debug mode, I see HASP Initializing … screen. If I select ‘Use MCU input’ and baud rate set to 115200, then start. Then click on the screen I see ‘65 00 01 01 FF FF FF’ in the simulator return. The 01 changes to 00, so I am guessing 01 is touch and 00 is released. If I press restart this is what I get https://hastebin.com/ijusotoler

Now for the compile errors.

Thanks in advance

Update 3/9/2019 4:26pm
I downloaded 1.8.8 I was running 1.8.5 of the ide. I also changed from generic 8266 to NodeMCU 1.0. I was able to compile and upload. Starting the monitor I am getting some intelligent serial debug. So for sake of completeness, I went back to 1.8.5 and switch to board to NoneMCU 1.0 and it did compile with a warning.

Archiving built core (caching) in: C:\Users\PAULEN~1\AppData\Local\Temp\arduino_cache_158204\core\core_esp8266_esp8266_nodemcuv2_xtal_80,vt_flash,exception_disabled,eesz_4M,ip_lm2f,dbg_Disabled,lvl_None____,wipe_none,baud_115200_be11c49f5546a1f0f775641c360d90c7.a
Sketch uses 450360 bytes (43%) of program storage space. Maximum is 1044464 bytes.
Global variables use 40000 bytes (48%) of dynamic memory, leaving 41920 bytes for local variables. Maximum is 81920 bytes.

Now focusing back on the Nextion emulator.

Update 3/9/2019 4:42pm
As I was playing with the emulator, I remembered reading there has to be a proxy for the emulator to work. My assumption was that it would work through the USB. So I going to see if I can get the display fired up and connected. I hope I don’t see any magic smoke.

Update 3/9/2019 6:00pm
Progress !!!
Got it up enough to get it on wifi. I think I down to basic setup now. I hope this helps someone else.


x2 for the aus faceplates



I have an exsisting MQTT alarm panel up and running on HA, Now the HASwitchPlate also has an alarmpanel. How to I Bring the two together?

alarm_control_panel.ha_alarm (HAswitchplate alarmpanel)
alarm_control_panel.alarm_system (MQTT alarm panel)

I already tried to Replace alarm_control_panel.ha_alarm in the HAswitchplate file with alarm_control_panel.alarm_system, but that tdid not work.

Gr. Remco



lol, Really it would be much helpful can you please also point out what changes i might need to do in the sketch in order to getting it work with arduino uno.



I’ve not worked with any of the wired Arduino networking options, so I can’t really point you in any direction there. Have you tried it? My best suggestion would be to just wade in and see what comes of it.


I’m not really sure what you’re trying to accomplish. Can you post up the config you’re working with on hastebin or similar?



When the alarm is armed via the HASwitchplate, I want the real alarm to arm also, I can control the real one via a MQTT messing to the home/alarm topic sending armed-away, pending, armed or disarmed. Not sure how to acclompish this, via automations ?

Gr. Remco


The alarm component used in the HASP packages is purely for demo purposes and isn’t an actual alarm system. If you have an alarm setup already implemented, you’ll want to edit the service calls in the stock page 7 automations to interact with your actual alarm instead of the demo component.

Which file exactly were you editing?