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

Thanks, did that. Are there automations within the YAML files that are kept that are no longer required once the device is set up?

Basically, from what I read here somewhere, all automations triggers are checked every seconds to see if they should be triggered and if so, their conditions are then evaluated. With all the automations that HASP is adding per device, this can add up pretty fast. I want to keep the system as lean as possible :slight_smile:

If you have pages you arenā€™t using, you can delete those pages. There two hasp_plate01_00_*.yaml packages are automations which apply to more than one page, so you might want to keep those. If you can live without theme support etc youā€™re welcome to go slicing and dicing individual features from the project in those files.

Thanks for your patience. Are there automations in the hasp_plate_01, 03 and 04 that are no longer required once a device is set up?

EDIT: Ignore this, Iā€™ve looked through them and the automations in them are all relevant.

One more question and that will probably be it :slight_smile:
How do I get the icons to align left and text to align right?

image

This is the code I have:


      - service: mqtt.publish
        data:
          topic: "hasp/prisesalon/command/p[1].b[4].txt"
          payload: '"ļƒ«   SoirĆ©e"'
      - service: mqtt.publish
        data:
          topic: "hasp/prisesalon/command/p[1].b[5].txt"
          payload: '"ļ†…   Jour"'
      - service: mqtt.publish
        data:
          topic: "hasp/prisesalon/command/p[1].b[6].txt"
          payload: '"ļ††   Nuit"'
      - service: mqtt.publish
        data:
          topic: "hasp/prisesalon/command/p[1].b[7].txt"
          payload: '"ļ€‘   Ɖteindre"'

Thanks

That one is easy - add spaces in the middle until everything lines up :smiley:

Looks like it tries to center the lines, is that the case?

The horizontal alignment is a property of the button field called xcen. From the Nextion docs:

xcen is the Horizontal Alignment (0 ā€“ left, 1 ā€“ centered, 2 ā€“ right)

So, to set a button text to be right aligned I could send something like:

-t hasp/plate01/command/p[1].b[4].xcen -m "2"

Looks like itā€™s centered aligned by default (although not mentioned and no xcen line in the p1 file). I added ,"p[1].b[4].xcen=0","p[1].b[5].xcen=0","p[1].b[6].xcen=0","p[1].b[7].xcen=0" to payload_template

Perfect, thanks :slight_smile:

This project is now complete :slight_smile:

2 Likes

Thanks :slight_smile:

I bought a 3.5" display but was struggling to get my own HMI file working. Just as you mention, HASP would stop responding when I used a file with six pages.

I figured out that somehow HASP needs a certain amount of pages. When I added some empty pages so the total would be 11, it started working perfectly.

Hope that can help someone who tries to make their own HMI file.

Thanks for the info. I had a feeling it might have something to do with the number of pages. Just havenā€™t had the time lately to play around with it.

.
Easy problem that Iā€™m just completely missing out on:

Iā€™m having issues setting the button state on the HASP via MQTT

Iā€™d think it would be
topic: hasp/plate01/state/p[1].b[6]
payload: OFF

but that does not seem to change anything. Otherwise Iā€™ve got this thing working exactly how I hoped to control a few pages of things leveraging only Node-RED. I would recommend this device to anyone!

The state of the button object can only be controlled by the user on the screen. The buttons in use are momentary contact, meaning they are always off unless a finger is smooshed onto the screen. Nextion does offer ā€œtoggleā€ buttons, but that creates other problems for most situations.

Soā€¦ you want toggle behavior that indicates if a device is on/off, but you want to do that with normal momentary button objects. The way we can do that is to toggle the foreground/background color used on that button, so that when you want to change on/off state on the button you simply swap foreground and background color sets.

Check out hasp_plate01_p3_toggles.yaml for examples on how this can be done.

Itā€™s simpler than that, well I was i hoping It was anyways. I just want the buttons to always display as ā€œoffā€. Everything I have so far doesnā€™t need indication that itā€™s ā€œonā€. Functionality wise i have the switch plate doing exactly what I was hoping for: just a way to physically kick off various MQTT commands. I was using a Zooz double switch before (piped through Hubitat and an add on for the MQTT output) and it was complicated to explain ā€œsingle tap for thisā€ ā€œhold for thatā€ etc etc.

Iā€™ll check out that yaml file to see if i can make what I need happen, thanks again for the help!

Love this project! Finally got my first one installed and configured.

Is there anyway to flip the display in the software? The screen looks great when looking straight at it, but looking down on it from above becomes washed out and dark. It doesnā€™t seem to have this issue looking up at it from below. Unfortunately it is already in the wall so other than flipping the unit there is no way for me to mount it higher. Is there a software solution?

Images: https://imgur.com/a/Il8mQ5J

Ugh, off-axis viewing on these isnā€™t always great and I 100% understand the use case here. Iā€™ve tried a couple approaches to flip the UI without much success but am asking around to see if thereā€™s some trick to making that happen.

Got it, no problem. It is really not a big deal just figured I would ask in case there was an easy solution. Cant wait to get my other 2 installed!

Hey @kyleteal I think I might have a workable solution for you.

From the HASP web page, select ā€œupdate firmwareā€. Under Update Nextion LCD from URL enter the following URL: http://haswitchplate.com/update/HASwitchPlate-Inverted.tft (you can just add the -Inverted bit to whatā€™s already there).

The process will take a few minutes, after which the HASP should reboot with an inverted display configuration. It works here on my bench but thatā€™s the extent to which Iā€™ve tested, so Iā€™d be interested to hear how it goes :smiley:

2 Likes

@luma BOOM! The first time I got a data error, rebooted and tried again and it worked great! Thank you so much!

1 Like

I have one question, can the HA switch plate replace a traditional light switch in the sense it can control that specific light? (both control light it is in place for, and control other devices in HASSIO). Lastly can you use POE to power the switch plate?