HA SwitchPlate HASPone: DIY In-Wall Touchscreen Home Assistant Controller

I bought a handful of the RCWL-0516 microwave proximity switch modules (how can you not? They’re so cheap!) I’ve not yet integrated them with Home Assistant yet, but I have been doing some experimentation with them on the bench.

They are quite sensitive! This is good and bad, depending on your goals. Also, their detection pattern is almost omnidirectional, and will penetrate to some extent through drywall and other non-metallic materials. So if you put one of these in a box in an interior wall, they might also detect motion out the other side of the wall as well. I’ve not tried any real experiments with trying to implement some shielding to modify the detection pattern.

I’m curious how these things work when snuggled up close to the Wi-Fi radio in an ESP-8266? I’ve not had a chance to do any real testing in that regard.

Loving this project, currently running a 3.2" screen running a simple one page setup for switching room lights. But my question is how hard would it be to modify the sketch to run on a UNO with a ethernet shield to use UTP vs wifi??? thinking of using a larger screen possibly the 7" and running POE.
Thanks for the hard work done to get this project this far… bloody ripper.

1 Like

How’d you go working out how to change B/G color based on state??? loving the simplicity…

woho! Received my screen today.

I copied the “HASwitchPlate.tft” file (I assume it was only this file, not the other ones in the Nextion_HMI folder?) to a fat32 formatted SDcard and plugged it into the screen. It boots up and says:

“Baud: 9600
SD Card Update…”

How long time should the update take? It seems like it takes forever…

Should be a minute or less. Can you post the model number of the LCD you bought?

I’ve never worked with the ethernet shield but I should note that I’ve made zero effort to make any of this portable outside of ESP8266. If it does somehow work, I can assure you that it was by accident.

Not as well as they work when sitting on my bench. The radar unit doesn’t seem to impact WiFi reception any (that I’ve noticed), but I’ve seen a lot of false positives even taking into account the omnidirectional nature of these things. For my specific use case (changing to scene control as I approach) this doesn’t seem to matter, but I’m holding off on adding the radar module to the project docs until I figure out some way for this to stop kicking out so many false positives.

edit: this is what my last 24 hours looks like on this sensor:

yeah thought this might be the case… stick with ESP, working a treat just ordered a 4.3" to see how that looks… thinking this could be a more reliable device to spread around the house rather than a tablet. Thanks again for all your hard work

had some luck with a simple automation

  • alias: Kitchen on
    trigger:
    • entity_id: light.kitchen
      platform: state
      to: ‘on’
      action:
    • service: mqtt.publish
      data:
      topic: ‘homeassistant/haswitchplate/HASwitchPlate/command/p[10].b[1].bco’
      payload: ‘25388’
    • service: mqtt.publish
      data:
      topic: ‘homeassistant/haswitchplate/HASwitchPlate/command/p[10].b[1].pco’
      payload: ‘65535’
  • alias: Kitchen off
    trigger:
    • entity_id: light.kitchen
      platform: state
      to: ‘off’
      action:
    • service: mqtt.publish
      data:
      topic: ‘homeassistant/haswitchplate/HASwitchPlate/command/p[10].b[1].bco’
      payload: ‘65535’
    • service: mqtt.publish
      data:
      topic: ‘homeassistant/haswitchplate/HASwitchPlate/command/p[10].b[1].pco’
      payload: ‘0’

the nice thing is when device is turned on via other means the result is replicated through to the switchplate

1 Like

I bought this one: “Nextion NX3224T024 - Generic 2.4” TFT Intelligent LCD Touch Display" (Model: IM150416002) from ITEAD.cc.

I let the update run over night, but no luck… Any ideas how to solve it? When I start the screen without the SD-card the Nextion default program runs, so everything else seems to work fine.

That should work. Two approaches I can think of: maybe try a different microSD card, or if you have the ability to hook up a UART, try flashing the device directly with the Nextion editor.

Hmm, I tried with a different SD-card now, and no luck…

How does the UART-thingy work?

Edit:

I tried with 3 different Samsung Cards (One 16 gb evo, one 32 gb pro and one 8gb unspecified) with no luck. then I found an old Sandisk 2gb card, and it worked! so apparently not all SD card works…

1 Like

Great news! I suspect it’s likely due to a disk format issue. FAT32 should work on disks up to 32GB per the documentation but the fact that it works with a smaller card suggests that the larger cards had been created with some incompatible filesystem.

Nonetheless I’m glad to hear you have it sorted. A UART is still handy to have around for development and it can make working with the Nextion editor easier if you elect to go down that path (totally optional!)

I will order a UART, but until the slow boat from China arrives I guess I can use a regular Arduino Uno as the USB-TTL.

I got things up and running so that I can see the Wifi and MQTT connected on the screen, and I can turn on/off the screen via HA. So I guess now I need to upload the HMI to the screen to get some graphics.

The HMI is the “source code” for the Nextion display, while the TFT (that you’ve already deployed) is the compiled version of that code. The graphics you see in the screenshot from myself and others are already in that TFT, so I’d think your next steps is figuring out how to use Hass automations to send the appropriate Nextion commands to send text and commands to and from the panel.

If you do want to add your own graphics for a more sophisticated interface, you can use the Nextion editor to create the interface, compile to TFT, then use your 2GB SD card to deploy.

I thought I saw somewhere in this thread a recommendation as to materials to use to get a nice 3d printed faceplate, but I can’t find that now.

So in short what is the best material, and what other printing recommendations?

Thanks.

EDIT never mind, what I was looking for is on the github 3d model page. Sorry for the noise.

I don’t suppose you could post a pic of the completed protoboard pretty please? Never built on it before.

Sure!

edit: I should note the Red/Green/Black wires on there are for the microwave RADAR thing I was testing out. The solder traces are all I needed for the protoboard itself, which is just running AC from the wire-to-board connector to the PSU, and DC from the PSU to the MCU.

Many thanks. My screens arrived today. Excitement builds…

Would just like to thank @luma for all of the hard work that has gone into this, i came across this project by accident, and instantly ordered a screen to play with, which arrived 2 days ago, and now works brilliantly.

From my measurements, i should just be able to fit this in a UK style square faceplate :slight_smile:

I’ve modified it all a little so that i can use multiple pages depending on what page im currently on, so i start off on page 1 for the home screen and go to page 2 for lighting, where i can switch to page 3 for lighting page 2, or to page 4 for dimmer control, i can also then switch to page 6 for socket control, and possibly who knows what else in the future.


(Only one light being controlled at the moment, as this will eventually be going into my new house, so all under test at the moment)

3 Likes