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

Yes, there are several ways to make something like that happen, all of which are going to take some work on your side. You can modify the Nextion HMI and upload your modifications to the panel if you want to try working with the Nextion HMI editor. Alternately, you can use Home Assistant automations to change the color of the button in response to the changing state of the light (so, send a command to make the background of the button dark when the device is off, or light when it’s on). See the hasp_plate01_p0_PageButtonColors for an example of what that might look like.

OK these colors are seriously cool. I did some with changing text for different states too. I wonder what this thing can’t do.

Images at this point of time for what it can do Im more than happy with it

I am using the touch panel and code from this post but I am substituting a NodeMCU and microusb power supply. I want to test that everything works as I want with what I have on hand, then I will invest into the actual setup. Anyway, I had everything setup perfectly last night (touch buttons toggle lights, motion sensor to trigger backlight, etc.) However, I woke up this morning and there seems to be a disconnect between the panel, NodeMCU, or HA. Looking in HA it says the panel is connected and status is good, but toggling the backlight switch doesn’t turn on the backlight. In addition, I can press buttons on the panel but they don’t toggle the lights as they did last night. During these events I can see the LED lighting up on the NodeMCU indicating wifi transmission. I’ll need to check if the events are being received by HA after work, but I think since the backlight switch isn’t working the answer will be no. Has anyone had this issue before?

Yes. Go into the light component in HA and drag the brightness all the way down then all the way up. If that doesn’t fix it, it sounds like your MQTT server is not responding or working properly.

Darn that didn’t work :frowning:I tested the MQTT messages that are supposed to be coming from the ESP8266 using MQTT spying apps and it doesn’t detect anything so for some reason the chip just stopped sending or receiving MQTT messages even though the led still blinks.

Do you see any serial output from the device over USB?

I’ll have to test the serial output tonight after work. I just plug it into my PC and check the serial monitor on the Arduino IDE right? 115200 or whatever? I’m hoping it isn’t the chip because the webUI still shows everything just fine.

Yup! The latest code has some shenanigans to make serial output work like one would expect. After the system boots you may some glitches in the serial output, which is just due to SoftwareSerial being crap @ 115200.

Had the same problem I think

Have you the got
hasp_plate01_00_backlightbysun.yaml in your Packages folder

that dims the back light base on the sun

what happen to me was I turn it off in HA the next day I turn it on in HA
but the screen did not turn on then I change the Diming Slider to 100% and it came back on

think it code me a little bug (most likely a user problem) go to try to recreate it tho

Okay so replugged the plate in and restarted HA. All the automations from the plate01 package came back up defaulted to off so I turned them all back on, then I triggered FirstTimeSetup again and it seems to be working fine now. But I didn’t change anything. I’ll let it go again tonight and see how its doing in the morning.

@luma Great Work! Thanks a lot. This project is awesome. I got the panel up and running in no time.

I have one question though Can it somehow display non-ascii characters? for example °C ?

1 Like

The panel can receive °, but Home Assistant has serious problems sending single-byte ascii characters. I raised an issue on this a while back that remains open. At some point I’m going to have to dig back into this and maybe implement some godawful hack because I want ° to work.

The 'ascii' codec can't encode character '\xb0' in position 0: ordinal not in range(128) message appears to be the root cause here. High-ASCII (128-255) values seem to cause problems w/ Hass’s MQTT stack.

Thanks. I see…

I have one other question. The current TFT file contains several pages but only three are selectable via the theree pages on the bottom. I was thinking it would be nice if every page button could cycle through a few pages.

so for example I have the scenes page on the first page button.If i now have two or three scene pages it would be nice if that first page button could cycle through the scene pages.

It is possible to do via automations. Just wanted to know if anybody has thought on hoot best do that or already has something like this implemented…

Also I would like some switches. Currently all the pages only have dimmers or buttons. Has someone implemented a switch (I guess another automation)?

Yes someone implemented this previously. The left button automation deferments the current active page number by 1 and the right button increments the current active page number by 1 instead of just setting the page number. The middle button could be a “home” button. Then use the button labels as you like to put arrows ( < and > ) or a plus and minus ( + and - ).

HASP v0.28

Some major updates here in all 3 software components. We now have full update capabilities for both ESP and LCD via browser upload or HTTP download from GitHub (or elsewhere).

Arduino code updates

  • LCD firmware updates fixed (finally!). Added web upload through browser and fixed downloads from GitHub.
  • Updated version.json to include LCD versioning
  • Better device startup handling to avoid flood of activity at boot
  • Change mqttSensorTopic to be on it’s own topic to address Hass JSON parsing errors
  • Fix prompt for password on ESP firmware updates when no password assigned
  • Added handling of dangling LWT messages if the device has rebooted quickly

Nextion LCD updates

  • Added global variable p[0].b[2].val to track LCD version
  • Minor change to background color for better contrast
  • Added QR code on page0 for use with WiFi autoconfig (or anything else you can think of)

Home Assistant automation updates

  • Update clock for 12 hour time
  • Modify plate01 status sensor to address Hass JSON parsing errors
  • Update calendar to omit day (so just Month Date), set for auto-font size, and only fire at midnight
  • Add light toggle page 3, demonstrating two-state buttons to switch on/off single lights or groups.

Thanks. For the suggestion.

However I was looking for something different.
3 buttons on the bottom. eg. Lights, Status, Media

When I press lights each click cycles through different lights related pages
When I press status each click cycles through different status pages
When I press Media each click cycles through different media player pages

What do you think?

@squirtbrnr has outlined the approach above. This is something that I think is valuable but is also hard to generalize for all users. As such, I’ll leave that as an exercise for the user. The automations provided are meant to be customized, and learning to do so is how you can make the HASP work in your own environment for your own use case.

Ask and you shall receive! Version 0.28 now includes a page of toggles on page 3.

Then you might want to check out post 140. Post 215 is what I was describing earlier. You might need a lot of input numbers and a lot more page automations…

Not impossible but it would take some doing. You can modify the HMI to add more 4-button pages (currently there are 3 pages like that), but to do so you would need to select some other page to delete as we’re near the limit of RAM on that device. Alternately, you could use the same page for each of the “lights” pages but cycle the text displayed on each button or something like that.

Again, this project is meant to be customized for your own use. Expect to dig into the automations to meet your own needs.