openHASP: An MQTT driven Touchscreen / Scene controller

I’ll try it for you.

1 Like

Right, I have used documentation available, even chatGPT helped. For the moment I have added libraries into openHASP and included those in main ini file for the ESP32 board.
Unfortunately either that is not sufficient or working principle of current CST820 is completely different to the one given in the code (GT911).
I couldn’t get touch working despite platformio compiling without any error.
I found another source for different library for CST826 chip. I have little more progress with it. I have made it working through Arduino IDE (example attached to the library). Now fun part is - library structure is completely different than the one came with device. Also it covers wide range of different touch drivers, way more than openHASP does.
So I would appreciate if openHASP developers use these libraries to support the project.
Im attaching link to it: GitHub - Makerfabs/Makerfabs-ESP32-S3-SPI-TFT-with-Touch

Meanwhile Im still trying to integrate support by myself. Its quite fun.

Hi everybody,

I have a quick question. How can i print current date and time on the screen from homeassistant?

Best regards…

The first sample here prints the time.

https://openhasp.haswitchplate.com/0.6.3/integrations/home-assistant/sampl_conf/

Edit: Problem solved by adding time sensor in Configuration.yaml file. Thanks again… :pray:

Hi @nickrout,
Thank you for your answer but i think this sample requires sensor type time component. I want to get the time and date from internal HA service.

Best regards…

I have a very simple device that displays time and some other data. I used the following in the HA openhasp integration

      - obj: "p1b3"
        properties:
          "text": "{% from 'easy_time.jinja' import clock %}{{ clock() }}"

easy_time.jinja is available through HACS and gives all sorts of nice time/date functions for templates.

1 Like

time is now native in openHASP in the latest 0.7.0 RC builds. So there’s actually no need to create a time sensor in HA any longer.

Below an example on how the datetime object can be formatted and displayed:

{"id":06,"obj":"label","enabled":false,"x":50,"y":5,"w":250,"h":30,"bg_opa":0,"text":"00:00:00","template":"%H:%M:%S %b %e, %Y","bg_color":"#2C3E50","text_color":"white","align":"left"

1 Like

Hi’ @helgemor

With that quantity of plates that share identical pages/objects, I would definitely do most/everything as automations instead of individual Custom Component config for each plate. With automations you can utilize the mqtt group topic command and update all plates at once. Code only at one place and much easier to revise and deploy changes.

I have most of my config done as automations. Especially ‘elaborate’ pages (Energy, Sonos player, Weather, Home page etc.) with multiple objects and many hundred of config lines :wink:

There’s been a lot of talks/discussions on the openHASP Discord channel. I can see that you’re already present there. Have you read this Discord thread ?
There are multiple other group topic threads - both on Git - Discussions and the Discord channel

SenseCAP D1 support has just recently been added.

You’re correct that you’ll have to create and build your dashboard from scratch. The good thing is that the openHASP documentation contain a lot of design examples. There’s also a lot addition info/examples to be found on openHASP’s git page (discussions) and additional info and a bunch of helpfull users/tinkerers on the openHASP Discord channel. You basically build your plate page by page and object by object. Most LVGL objects are supported by openHASP. You can control the plates from HA either by using the Custom Component or via automations.

Without owing a SenseCAP myself, I guess it should be ok to use as image slideshow. The MCU is latest ESP32-S3 version with 8MB flash and plenty of PSram (8 MB) to handle images. Images can either be dynamically uploaded or stored locally in the device. I have other ESP32-S3, 480x480 resolution devices and a pageshift between two full image background pages is rather quick (not instantly, but almost).

openHASP doesn’t utilize the RP2040 mcu at all. Nor does it support sensors or LoRa in some of the more expensive versions.

I can’t think of any sw product that utilizes an ESP32 touch display device to such an extend than openHASP. It’s not plug and play and requires some work and hours on your side. But imo it’s definitely worth the effort :wink:

1 Like

There is a button at the top of the sensecap. Anyone know what gpio it is on?

Found this on the openHASP Discord channel :wink:

image

1 Like

Thanks @htvekov

You’re welcome

Working:

#[20:06:12.735][98292/108816  9][57508/58100  2] MQTT PUB: input38 => {"eve
nt":"down"}
#[20:06:13.135][98292/108820  9][57508/58100  2] MQTT PUB: input38 => {"eve
nt":"long"}
#[20:06:15.536][98292/110404 10][57508/58100  2] MQTT PUB: input38 => {"eve
nt":"release"}

My sensecap seems to work as a slideshow. My trial setup

  1. Photos on my home server (different machine to ha), shared via samba
  2. Samba share mounted on ha as media share
  3. on sensecap one page with a 480x480 image object
  4. Using the openhasp.push_image service to push images to the sensecap, like
service: openhasp.push_image
data:
  obj: p2b2
  width: 480
  height: 480
  image: /media/Pictures/Nelson/P1040950.JPG
  fitscreen: false
target:
  entity_id: openhasp.seed1

It works really quickly to cast the pic. You could write a script to cycle through pics. However the screen is obviously square, so not the greatest for displaying your typical oblong home pics. As setup you get a landscape pic on the top of the image. eg

image

You could get around this with some calculations.

1 Like

Yep. 480x480 res. images are both transferred and handled quite snappy in openHASP :ok_hand:
It struggles somewhat though doing full size image for e.g. the large Sunton devices at 480 x 800 res.
I have full size image background on some of my Sunton pages, and I can almost hear the ESP scream in agony at times :laughing:

1 Like

Finally got it working with supercheap super slim esp32-2432s024c module:

Now I can start designing case and peripherals to this beauty ))

1 Like

Have you posted your code somewhere?

Not yet, I will make article when I’ll be in a mood

Any idea how to read data from GPIOs? Im trying to read battery level

1 Like