openHASP: An MQTT driven Touchscreen / Scene controller

There’s an \n missing before heat_cool but I don’t think that’s the issue:

{"id":4,"obj":"dropdown","x":130,"y":60,"w":100,"h":35,"bg_color":"#2C3E50","options":"Off\ncool\nheat\nheat_cool\nfan_only\ndry"}

Not sure, but have you tried to compare the state_attr with the lowercase values like so:

          "val": >
             {% if state_attr('climate.izone_controller_000042221', 'hvac_modes') == "Off" -%}
             0
             {% elif state_attr('climate.izone_controller_000042221', 'hvac_modes') == 'cool' -%}
             1
             {% elif state_attr('climate.izone_controller_000042221', 'hvac_modes') == 'heat' -%}
             2
             {% elif state_attr('climate.izone_controller_000042221', 'hvac_modes') == 'heat_cool' -%}
             3
             {% elif state_attr('climate.izone_controller_000042221', 'hvac_modes') == 'fan_only' -%}
             4
             {% elif state_attr('climate.izone_controller_000042221', 'hvac_modes') == 'dry' -%}
             5
             {% else -%}
             0
             {% endif -%}

What do you see when you monitor the mqtt topic? Does the .val get send?

I suppose none of the values match and it defaults to p6b4.val=0. Maybe change the {% else -%} value to -1 or some other marker so you know nothing was matched… for troubleshooting.

yeah i fixed up the \n after the page didnt display correctly on the panel.

ok i’ll check that tonight. its a very dark deep hole once you start creating pages for different applications hahaha

Hi, I am very new to the hardware side of things, but always eager to try new things. Is it appropriate to ask questions here regarding the hardware side if the setup? I am struggling a bit with getting the screen working with the esp32. I am quite sure I do not know what I am doing. I have the app up and running on a LOLIN D32 Pro V2.0.0. I was able to configure the wifi and I can get to the web admin panel of it via a browser. I am attempting to use the Lolin tft 2.4 for the touch screen. I soldered header pins onto the D32 and thats about as far as I can get. I played around with aligning the inner rows and I can get the backlight to come on, but thats it. I see in the instructions it says To use PWM dimming on the Lolin TFT 2.4" you must connect the TFT-LED pin to either D1, D2 or D4. D1 is recommended for backlight control and configured by default. I see that picture and it highlights an area in red, how are you supposed to “connect” that? All new to me. Would love pics on how to line up the D32 to the screen and how to connect the led to the D1. Thanks for any help.

Hi, for the Lolin D32 Pro you can actually use the special TFT connector in the center of the board and attach it to the same TFT connector on the side of the LCD. It will connect all the necessary pins using a single cable. The solder pads are only needed for boards that plug directly onto the pin-header on the backside of the LCD…

Now, you could also connect everything using jumper cables to these GPIOs:

    TFT_MISO=19
    TFT_MOSI=23
    TFT_SCLK=18
    TFT_DC=27
    TFT_CS=14
    TFT_RST=33
    TFT_BCKL=32
    TOUCH_CS=12

Provided you are using the lolin-d32-pro_ili9341_full_16MB firmware that you compiled from source or downloaded from here.

If you have a Github account, feel free to join the Lolin D32 Pro discussion there.

1 Like

Thanks for the reply! I am using the incorrect firmware for starters :). I will give that a shot. I have a kit on the way to make a cable for the TFT connector. Thank you for the help. I will check out the GitHub discussion.

All I get is a white screen. When I look at the logs and compare to what you have above, I am missing one, TFT_BCKL=32? Any thoughts?

e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       5.971]e[91m[65524/189052 65]e[91m[    0/    0  0]e[37m TFT : Starting...e[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       6.110]e[91m[65524/189052 65]e[91m[    0/    0  0]e[96m GUI : Backlight  : Pin not sete[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       6.559]e[91m[65524/188832 65]e[91m[    0/    0  0]e[96m TFT : Rotation   : 0e[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       6.701]e[91m[65524/188832 65]e[91m[    0/    0  0]e[96m TFT : Invert Disp: Noe[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       6.878]e[91m[65524/188832 65]e[91m[    0/    0  0]e[96m TFT : TFT_eSPI   : v2.3.81e[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       7.026]e[91m[65524/188832 65]e[91m[    0/    0  0]e[96m TFT : Transactns : Yese[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       7.169]e[91m[65524/188832 65]e[91m[    0/    0  0]e[96m TFT : Interface  : SPIe[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       7.313]e[91m[65524/188832 65]e[91m[    0/    0  0]e[96m TFT : Driver     : ILI9341e[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       7.461]e[91m[65524/188832 65]e[91m[    0/    0  0]e[96m TFT : Resolution : 240x320e[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       7.609]e[91m[65524/188832 65]e[91m[    0/    0  0]e[96m TFT : MOSI       : 23 (GPIO 23)e[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       7.763]e[91m[65524/188832 65]e[91m[    0/    0  0]e[96m TFT : MISO       : 19 (GPIO 19)e[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       7.916]e[91m[65524/188832 65]e[91m[    0/    0  0]e[96m TFT : SCLK       : 18 (GPIO 18)e[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       8.069]e[91m[65524/188832 65]e[91m[    0/    0  0]e[96m TFT : TFT_CS     : 14 (GPIO 14)e[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       8.222]e[91m[65524/188832 65]e[91m[    0/    0  0]e[96m TFT : TFT_DC     : 27 (GPIO 27)e[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       8.376]e[91m[65524/188832 65]e[91m[    0/    0  0]e[96m TFT : TFT_RST    : 33 (GPIO 33)e[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       8.529]e[91m[65524/188832 65]e[91m[    0/    0  0]e[96m TFT : TOUCH_CS   : 12 (GPIO 12)e[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       8.682]e[91m[65524/188832 65]e[91m[    0/    0  0]e[96m TFT : Display SPI freq. : 40.0 MHze[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       8.838]e[91m[65524/188832 65]e[91m[    0/    0  0]e[96m TFT : Touch SPI freq.   : 2.5 MHze[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       8.994]e[91m[65524/188832 65]e[91m[    0/    0  0]e[96m TFT : DMA        : Disablede[0m
e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       9.143]e[91m[65524/188832 65]e[91m[    0/    0  0]e[97m TFT : Startede[0m

I added pin 32 in the display config as the backlight and i now see this in the log, however the panel just locks up. Is there anything physically I need to do to the board to enable the backlight on 32?

e[1000De[0KPrompt > e[1000De[9Ce[1000De[0Ke[96m[       5.995]e[91m[65524/189052 65]e[91m[    0/    0  0]e[96m GUI : Backlight  : Pin 32e[0m

I have added the firmware lolin-d32-pro_ili9341_full_16MB_v0.6.2.bin to the pre-compiled binaries of the v0.6.2 release. If you upload this firmware to your device the screen should work out of the box.

Thanks, I will give that a shot.

1 Like

I am trying to use the messagebox object.
Can someone share their integration of messagebox with home assistant.

I had integrated lights and sensors successfully, still struggling with the mesaagebox.

Purpose of using message box:

Scenario 1: need to have a confirmation message displayed when i press a certain button on the screen.

When confirm button is pressed it fires an action to home assistant. Maybe turns on a switch.

Scenario2: when an alram is triggered in Home assistant, message box appears on the screen as a warning, confirmation button needs to be pressed to initiate clear alarm action.

Any chance that a SSD1963 based screens will work? I do see some reference in the lvgl source, but nothing definitive. Here is an example (it is 7 inches, which is the attraction as far as I am concerned.) 7" 7 inch 800x480 TFT LCD Display Touch Screen Module SSD1963 LCD controller For Arduino AVR STM32 ARM MCU 800*480 800 480|Instrument Parts & Accessories| - AliExpress

I think you’ll need to use the HA custom integration, and do the automations in HA. You could create the msgbox via a jsonl command over mqtt, then set it to hidden to make it disappear. Or switch to a page that has the msgbox, then back again after you click disable.

Any chance that a SSD1963 based screens will work? I do see some reference in the lvgl source, but nothing definitive.

As long as there’s a driver for it, it should work. Both TFT_eSPI and LovyanGFX seem to have configuration options for SSD1963 panels. But to have a definitive answer you would have to test it proper.

I’m quite bad at HA integrations myself, but you will need to check the {{ val }} or {{ text }} that is sent in the up event. Similar to this button matrix example:

      - obj: "p1b24"
        event:
          "up":
            - service: >
                {% if val == 0 %}     # First button pressed
                climate.turn_on
                {%-elif val == 1 %}   # Second button pressed
                climate.turn_off
                {%-elif val == -1 %}  # Msgbox contents pressed
                # ignored
                {% endif %}
              target:
                entity_id: "climate.thermostat_1"

I have not tested this to confirm, but I think that should point you in the right direction.

I have issue on Unicode, I make a label in Unicode : “Chiếu điểm” actually I got just “Chiêu iêm”. Mean I lost “Đ”, “ế, ể”.
image

I believe these letters belong to the Vietnamese character set, which we currently don’t support in full.
I’ve added a reply in Github discussions on how the go forward with adding support for Vietnamese.

1 Like

Thanks. I shall try this

Fan and scent diffuser


Animated fan icon example at:
https://haswitchplate.github.io/openHASP-docs/0.6.2/integrations/home-assistant/sampl_conf/#fan-and-scent-diffuser

1 Like

First a big thanks for this project - I had 4 spare FreeTouchDeck circuit boards and matching screens sitting around and was wondering about how I could integrate them into my HA setup.

I seem to be missing something with the file editor though. I can delete files, create files, upload and download files but for the life of me how do you EDIT files??? I can make changes to a file chosen in the editor, but how do I save those changes?

Just type Ctrl-S or Cmnd-S on a Mac to save the file to flash.

1 Like