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

Check all your connections vs the pin map. If you’re using the Nextion cable, you should have the Yellow cable connected to D4 and the Blue cable connected to D7. If that checks out, try setting up another UART at 115200 on pins D7 and D4 on the ESP8266 to confirm that serial data is being sent.

thank you very for your reply; i’ll give that a try

you are the best

2 Likes

Is there a simple way to reinitialize the panel from the hass frontend? It would be awesome if I could set up a script or automation that would reload the whole panel as if I had just power cycled it.

there are a couple ways you can accomplish this:

  • Have a script/automation that calls automation.trigger with entity_id: on all automations that start with automation.HASwitchPlate and are triggered by the HASwitchPlate MQTT state topic. Then manually trigger that script from the frontend. Could also be scripted with JSON
  • Add an input boolean to all HASwitchPlate automations that are triggered by the HASwitchPlate MQTT state topic and put the input boolean switch on the HA frontend somewhere
  • Add all automations for the HASwitchPlate to a group and display it (or not) on the frontend then manually trigger each automation that is triggered by the HASwitchPlate MQTT state topic or manually trigger the whole group (as long as the group only contains automations)
  • Have an input boolean that is a sensor template pointing to the HASwitchPlate on sensor and acts like a manual override of the state topic

The last one I’m not sure it is done exactly that way, or can be done. Have a read through the HA examples and components pages for automations for more info.

Would someone here w/ some skills be able to create a 2 gang wall plate?

I have a paid development gig that is going to be taking up most of my time for the next 2-3 weeks, but after that I suspect I’ll be working out a double-gang plate as my bathroom could really use a dedicated Sonos controller.

1 Like

After waiting for the slow boat from China (and much prodding from @quadmasta on Discord) I finally received a handful of these ultra-cheap RCWL-0516 microwave RADAR motion sensors. I still need to mount this into my installed HASP, but on the bench it’s super simple to work with. You feed it +5VDC and ground and it runs a 3.3v pin high when it detects motion. Given that we’re already working with a 5VDC supply and 3.3V logic this is a no-brainer to implement and there’s plenty of room in the existing enclosure to mount it to something like a WeMos protoboard shield.

I’ve modified the Arduino code to auto-create a motion sensor in Hass to support it and have been monkeying with some automations to do things like flip to the status page and dim the screen a little when there’s no motion, so when I’m not standing in front of the panel it’s showing the clock and weather and alarm status. When I move in front of the panel it brightens a little and switches to the scene control page. This should make your HASP feel a lot like the ecobee where it changes the interface when you’re standing near the device.

I still have some cleanup on all of this before I publish, but expect that to be available on GitHub by the time you spend all of $0.96 and the Chinese boat arrives with the parts if you decide to add this feature to your HASP build.

3 Likes

I’ve posted the new Arduino code with an added option to define a motion sensor pin. The default value of 0 will disable motion sensing (overloading GPIO 0 which is OK as there are at least two problems with using this as an input pin). Set that to D1 if you have a motion sensor connected to D1 which is HIGH when detecting motion. The sketch implements a default latch time of 60 seconds which can be configured at compile time and then changed at runtime via MQTT like this:

mosquitto_pub -t 'homeassistant/haswitchplate/HASwitchPlate/command/motionLatch' -m '300'

If enabled, the new code will also publish an MQTT Discovery message to create a new motion sensor device in Hass named <devicename>-motion. This will be a normal motion sensor that you can use in your automations to trigger actions on the panel or anything else you might want to use it for.

1 Like

The motion sensor would be an awesome addition! Does it need direct line-of-sight to detect motion, or can it be hidden inside the box, behind the screen?

In the box behind the screen, because RADAR can see through walls (and screens)! There’s plenty of room in there to mount it and I’m confident this’ll be an easy add-on. I’m hoping the signal will be at least a little attenuated as these are rated for 7m detection distance which is a fair bit further than I’d like. You can solder on a 1M resistor to provided pads on the PCB to dial that back to 5m but I don’t have 0805 1Ms on hand. I’ll probably just shoehorn in a 1/4w 1M this weekend when I have some time so I can put it in the wall to see how it does.

1 Like

This is about to be next level! I don’t have a lot of electronics or coding experience, but this project has me diving right into the deep end. My local library has two 3D printers which I am taking a course to learn, and then we will be up and running.

Have you looked into the acetone vapor method for smoothing out the faceplate? I’ve read that it can give it the smooth, shiny look that you might expect from a normal wallplate.

I’m printing in PLA as it tends to print a little more dimensionally stable than ABS which typically shrinks a bit after (or during) the print. PLA doesn’t react with acetone, but ABS does and it can for sure make a smoother-looking surface, but does so at the cost even further changing the dimensions of the part. It’s fine for purely decorative prints, but if you’re trying to make several things fit together vapor smoothing can be a real pain to get just right.

RADAR motion sensor works!

5 Likes

So I have everything set up with the new code, OUT from the sensor goes to D8, and the motion sensor shows up in HASS, but it’s not detecting motion. Anything else that I might be missing?

Hey I love the project but I’ve run into the “initializing” issue. I’m not sure if this is related but when I tried uploading the “enhanced” Nextion firmware I was getting a message that the screen is not compatible. Although HASwitchPlate.tft worked fine. I checked my wiring and that matches your instructions as well. I do notice if I touch the screen I am getting responses from the Hassio page. Any guidance would be greatly appreciated. I am pretty new around all this stuff.

Just wanted to add, it starts at black background and white initializing, then inverts the colors and stays there.

@watahboy Make sure that the “HASP Active Page” input slider in your Home Assistant frontend is set to anything other than 0. Page 0 is just the initializing text.

1 Like

That was it! Thanks man!

No problem! I was stuck there for a while too when I was setting it up. Glad it’s working for ya’!

I just picked a pin at random when I wrote that and… it shouldn’t be D8 as that is being used by serial after the swap. Try D1 and it should work. I’ll note that in my testing w/ the microwave RADAR chip I’m seeing a lot of false positives that I haven’t sorted out yet.