openHASP: An MQTT driven Touchscreen / Scene controller

Tags: #<Tag:0x00007fc41529b6d0> #<Tag:0x00007fc41529b5b8>

openHASP: An MQTT driven Touchscreen / Scene controller

Most users already know the original HA SwitchPlate: HASPone thread by @luma. If not, check out his project because it is the foundation on which we built openHASP!

Note: The firmware is currently still a pre-release version. Feel free to try it out.

openHASP started out as an HA SwitchPlate fork replacing the propriatary Nextion panel with a commodity display. This is achieved by using the excellent lvgl graphics library. Much like HASPone, in openHASP you can display a series of pages with fully customizable objects. However, the layout of those screens is entirely up to you!

You can find several example layouts in the documentation to get started:


The lvgl library allows for complete control of almost any object property. openHASP lets you send these commands over MQTT. Over the past 16 months we’ve slowly integrated features while adding support for other microcontrollers like ESP32.

There are binaries available for several devices, like the ESP32-Touchdown, FreeTouchDeck, M5Stack core2 and WT32-SC01. With the help of @blakadder we’ve added support for the popular Lanbon L8 and it runs quite smoothly:

We are also working on HA integration using the openHASP Custom Component developed by @dgomes.

Users have shared several projects using openHASP and you might have seen it in the HA Community Highlights when it was still dubbed hasp-lvgl:

To learn more about the project check out the documentation.


This project (and Haspone) are highly recommended and I hope they continue to prosper.

More stuff to buy from Aliexpress. The family despair, but it gives me something to do.


I’ve just received´my M5Stack Core2, which I intend to use as a controller for HA. But I can’t figure out how to get the device into flash mode to put the pre-compiled binary on it. Any pointers? I have the USB drivers installed and I’ve tried ESPHome Flasher, ESP-Flasher as well as M5Stack’s own M5Burner.

I have used Tasmota PyFlasher and to upload the firmware without any issue. Both tools will automatically put the M5Stack core2 into flashmode. Just specify the appropriate COM port and firmware file.

With --port com1 erase_flash --port com1 write_flash 0x0 m5stack-core2_full_16MB_v0.5.1.bin

After a little while there is see a message Hard resetting via RTS pin… and the device should reset by itself.

In Tasmota PyFlasher there is a message Unplug/replug or reset device to switch back to normal boot mode. Because the M5Stack has in internal battery unplugging it will not reset the device. So, press and hold to power button for 6 seconds to power it down. Then press again to power up…

After a few seconds you should see the screen to configure WiFi:

After successful upload of the full firmware, subsequent updates can be done by uploading the ota firmware in the web UI.

1 Like

Thank you, I got it to work via Tasmota PyFlasher.

But now I can’t get the Core2 to connect to Home Assistant via MQTT.

The device keeps trying to connect and seems to be restarting after each failure. Openhasp tells me it’s disconnected with an empty return code:

Where’s my screw-up in the settings?

Make sure to press the Reboot button after changing the MQTT settings.

Also, you can connect to the serial console using Putty or another serial monitor at 115200bps. This will allow you to see the startup log and connection attempts. That should give a good indication of what’s wrong.

1 Like

While waiting for my WT32-SC01 to be delivered I thought I’d read through the setup notes.
Thank you for creating some great reference documentation.


Hello, just started my first OpenHASP implementation on a WT32-SC01 (320x480). It works great… But can I also set the radius of the buttons? When I draw a button I get a rather big radius. I see no radius set parameter.

Keep up the good work…

Gr. Remco

Sure, you can use the radius property, which is part of the Object Common Properties.



There’s even separate radius, radius1 and radius2 for released, pressed and disabled states.

Thanks for the quick respons. Works like a charm, this looks much better:

1 Like

The documentation is a community effort with multiple contributors, so if you encounter inaccuracies or missing information feel free to contribute.

1 Like

How can i contribute to the documentation?

If you scroll all the way to the bottom of a page you will find a link called “Edit on GitHub”. That will take you to the Github document where you can edit the markdown of that page.

1 Like

You mean first fork your repo, change the markdown file and do a PR ?

Indeed, it’s basically just like any other Github repo.

very impressive project . run it on my lanbon L8 HS . now i cant control various entities in my hass setup. i got few question:

  1. how do i control the 3 built in relays
  2. kinda confuse how do i setup the moodlight until i get the entity in hass

im using the custom component for openhasp. tqvm

Which version did you install on the device? Version 0.5.x doesn’t suport the gpios very well…

We’re preparing the 0.6.0 firmware and custom component. You can try this development version to control the internal replays and moodlight using HA.

moodlight and backlight light entities appear on my hass, but relay is no where to be found. im using L8-HS and these are my gpio setting pointing to the relay based on the documentation. anything i did wrong? btw touch control with gpio relay is ok. mqtt still doesnt work? im using latest integration in hass

Yes because this is work in progress.

You need to install the main version of the Custom Component, not 0.5.0.

Go to HACS > Integrations > on the openHASP pane click on the 3-dots icon > select Reinstall > choose main from the dropdown > Install and restart HA.

From the docs:

You have to use component version consistently with the firmware version on your plates. For example, if your plates are at firmware version 0.5.x, you also need to use component version 0.5.x to ensure interoperability. Home Assistant will show a warning if it finds a version mismatch. Note that you can only have one version of the component installed at a time so a mix of plate versions cannot be deployed.

1 Like