New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Moderators: leecollings, remb0
-
- Posts: 5
- Joined: Monday 27 January 2025 22:19
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Just dimming the display backlight doesn't do much - I tried, but it's more about bland or not very intense colors. It's like too little sharpness or contrast, unfortunately our TFT display doesn't support these functions. I hope I'm wrong because I'd also like it to be clearer.
-
- Posts: 849
- Joined: Wednesday 15 August 2018 14:38
- Target OS: -
- Domoticz version:
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
What is your device ? it's a 2432S028R ? You know the version ? Else how many USB port you have, mini-USB and USB-C ?
I have a 2432S028R with 1 USB-C + 1 Mini USB (it's the native version, without edition in platformio.ini file)
Used with Dark mode and brightness to 25 % (Yes, I think too thoses devices have too much luminosity) and I haven't problem. I can add 10% but if in your side it have an impact on color and not luminosity it's naother problem, on my side this option realy have an impact on the "light producted" by the device.
I have a 2432S028R with 1 USB-C + 1 Mini USB (it's the native version, without edition in platformio.ini file)
Used with Dark mode and brightness to 25 % (Yes, I think too thoses devices have too much luminosity) and I haven't problem. I can add 10% but if in your side it have an impact on color and not luminosity it's naother problem, on my side this option realy have an impact on the "light producted" by the device.
-
- Posts: 5
- Joined: Monday 27 January 2025 22:19
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
My device is 2432S028 without any letters, version with 1xUSB USBmini 1xUSB C, I'm not entirely sure but the driver is probably ili9432 (backlight gpio 21, LDR gpio34), and maybe that's the problem because at the moment I'm working on 2432S028R and ili9431 driver.
-
- Posts: 5
- Joined: Monday 27 January 2025 22:19
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
The image is a sample of what the difference is, the second display is "Openhasp"
- Attachments
-
- Cyd&Openhasp.jpg (114.67 KiB) Viewed 1654 times
-
- Posts: 849
- Joined: Wednesday 15 August 2018 14:38
- Target OS: -
- Domoticz version:
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
I think I have same.
It's the defaut config, you haven't edited anything in platoformio file ?
So it use the driver TFT_ESPI
(You can try with the 2 other)
The backlight GPIO is 21 yes, but the gpio 34 is the light sensor for me (CDS).
And your device is blinking ? On your capture you have one device with a dark theme and the other with a lighter, so hard to compare.
The dark theme don't use a black color, it's more a "dark grey".

It's an older version, but colors are same.
If you want I can give you a code to replace the "dark grey" by a full dark ?
Make a try with the "light" theme ?
It's the defaut config, you haven't edited anything in platoformio file ?
So it use the driver TFT_ESPI
Code: Select all
-DTFT_ESPI=1
#-DLOVYANGFX=1
#-DARDUINO_GFX
The backlight GPIO is 21 yes, but the gpio 34 is the light sensor for me (CDS).
And your device is blinking ? On your capture you have one device with a dark theme and the other with a lighter, so hard to compare.
The dark theme don't use a black color, it's more a "dark grey".
It's an older version, but colors are same.
If you want I can give you a code to replace the "dark grey" by a full dark ?
Make a try with the "light" theme ?
-
- Posts: 849
- Joined: Wednesday 15 August 2018 14:38
- Target OS: -
- Domoticz version:
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Have updated the "master" code on github. There is a corrective about domoticz device id, I don't remember what is was, but can make a try.
There is too the "light websocket" support and the OTA, so now you can update the device only using Wifi.
There is too the "light websocket" support and the OTA, so now you can update the device only using Wifi.
-
- Posts: 200
- Joined: Thursday 06 October 2016 8:14
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.7243
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Is this the webserver? How to upload OTA?Thorgal789 wrote: ↑Saturday 01 February 2025 12:40 Have updated the "master" code on github. There is a corrective about domoticz device id, I don't remember what is was, but can make a try.
There is too the "light websocket" support and the OTA, so now you can update the device only using Wifi.
- Attachments
-
- cyd_webserwer.png (97.47 KiB) Viewed 1345 times
-
- Posts: 569
- Joined: Monday 20 March 2023 14:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Somewhere in NL
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Put /update after the 192.168.1.117 -> 192.168.1.117/update
Logic will get you from A to B. Imagination will take you everywhere.
-
- Posts: 849
- Joined: Wednesday 15 August 2018 14:38
- Target OS: -
- Domoticz version:
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Ha yes, I forget to describe OTA, I will update the Github in 20 mn.
There is 2 options for OTA, PUSHOTA and PULLOTA you can enable one of them or nothing (not both ofc).
PUSHOTA Enable the OTA in PUSH mode, it mean there is a webserver that run permanently, youcan access it using /update as url.
PULLOTA can be used using the GUI, on the device itself, using the first menu, it will download itself the new firmware, but for the moment the url is hardcoded (not sure people will use this mode, I think I m the only one to prefer the PULLOTA)
In ota.cpp
There is 2 options for OTA, PUSHOTA and PULLOTA you can enable one of them or nothing (not both ofc).
PUSHOTA Enable the OTA in PUSH mode, it mean there is a webserver that run permanently, youcan access it using /update as url.
PULLOTA can be used using the GUI, on the device itself, using the first menu, it will download itself the new firmware, but for the moment the url is hardcoded (not sure people will use this mode, I think I m the only one to prefer the PULLOTA)
In ota.cpp
Code: Select all
const char url[] = "http://192.168.1.81:8080/firmware.bin";
-
- Posts: 5
- Joined: Monday 27 January 2025 22:19
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
If you can, send the black color you mentioned earlier.
-
- Posts: 849
- Joined: Wednesday 15 August 2018 14:38
- Target OS: -
- Domoticz version:
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
About the "dark grey" Im using ?
If you are using the dark theme, the code is in file main_ui.cpp
For information
You want to make the color more black ?
If you are using the dark theme, the code is in file main_ui.cpp
Code: Select all
else
{
background = lv_palette_darken(LV_PALETTE_GREY, 4);
lv_style_set_shadow_color(&style_shadow, lv_palette_darken(LV_PALETTE_GREY, 2));
}
lv_style_set_bg_color(&style_shadow, background);
Code: Select all
For the lighter variants of a palette color use lv_color_t c = lv_palette_lighten(LV_PALETTE_..., v). v can be 1..5. For the darker variants of a palette color use lv_color_t c = lv_palette_darken(LV_PALETTE_..., v). v can be 1..4.
Code: Select all
background = lv_color_hex(0x000000);
-
- Posts: 569
- Joined: Monday 20 March 2023 14:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Somewhere in NL
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
I love it
, but just a few remarks:
1. Personnal is incorrect, it should be personal with just 1 'n'
2. Personally I like the black background beter, perhaps that var could be transfered to the personal_settings.h file. So everybody could use its own personal background color more easily.
3. I switched in the info tab the order of baro and utility to be consistent with Domoticz, and also changed the baro into weather like in Domoticz.

1. Personnal is incorrect, it should be personal with just 1 'n'
2. Personally I like the black background beter, perhaps that var could be transfered to the personal_settings.h file. So everybody could use its own personal background color more easily.
3. I switched in the info tab the order of baro and utility to be consistent with Domoticz, and also changed the baro into weather like in Domoticz.
Logic will get you from A to B. Imagination will take you everywhere.
-
- Posts: 849
- Joined: Wednesday 15 August 2018 14:38
- Target OS: -
- Domoticz version:
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Arf, I have just made the release with the typo ....
1 - Corrected, but too late now
2- My GF too, and you are not alone, so for the moment full black is the defaut, the problem is I m using a fonction to generate the palette, and it use only a bool value, so it can be only on or off, not possible to make a third "custom" option, I need lot of settings to have a full custom palette.
3- Corrected too, have increased the tab size and and a capital letter too.
Change on the "test" branch.
Edit:
You haven't a "persistence phenomenon" with the full dark color ? (we can guess the widget even if the display is using a full colored backgound)
1 - Corrected, but too late now
2- My GF too, and you are not alone, so for the moment full black is the defaut, the problem is I m using a fonction to generate the palette, and it use only a bool value, so it can be only on or off, not possible to make a third "custom" option, I need lot of settings to have a full custom palette.
3- Corrected too, have increased the tab size and and a capital letter too.
Change on the "test" branch.
Edit:
You haven't a "persistence phenomenon" with the full dark color ? (we can guess the widget even if the display is using a full colored backgound)
-
- Posts: 4
- Joined: Sunday 23 February 2025 21:14
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
I love it!
Running on esp32-8048S070C in 10 minutes
And I convert it for the esp32-8048S050C.
Only trouble is the timeout. If I put the screen on 50%, it jumps to 100% and not 0% after timeout.. It is inverted
I put my config in attachment
I can't get it to GIT
Running on esp32-8048S070C in 10 minutes
And I convert it for the esp32-8048S050C.
Only trouble is the timeout. If I put the screen on 50%, it jumps to 100% and not 0% after timeout.. It is inverted
I put my config in attachment
I can't get it to GIT
Last edited by Ltech on Sunday 23 February 2025 21:40, edited 1 time in total.
-
- Posts: 849
- Joined: Wednesday 15 August 2018 14:38
- Target OS: -
- Domoticz version:
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Oups, sorry have just see your comment.
Thx I will add it tommorrow to the github.
About your issue, it only happen with the "standby mode" ? I mean , if you set it to 25% or 75% using the setting panel you haven't issue, or it's reversed too ?
I m seing you have edited the code
Code: Select all
screen_setBrightness(254);
-
- Posts: 849
- Joined: Wednesday 15 August 2018 14:38
- Target OS: -
- Domoticz version:
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Ok so I hav found nothing about your issue, nothing similar, and no settings to 'invert" the brighness so have just used a hack
The code is updated on the "test" branch
Code: Select all
#ifdef ESP32_8048S050C
brightness = 255 - brightness;
#endif
-
- Posts: 4
- Joined: Sunday 23 February 2025 21:14
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
No this is only inverting the brightness. The brightness setting mode was fine.
When the sleep mode is activated, it turns to 100% brightness, no to 0%
It has to be somewhere else.
So on first touch, the monitor go back to 50% from 100% after leep mode (wake timeout)
In you modification it is only inverting the default brightness setting, not the screen sleep brightness setting
I guess the backlight led is driven inverted. When in pwm those are pulses, when in sleep it is an fix level...
When the sleep mode is activated, it turns to 100% brightness, no to 0%
It has to be somewhere else.
So on first touch, the monitor go back to 50% from 100% after leep mode (wake timeout)
In you modification it is only inverting the default brightness setting, not the screen sleep brightness setting
I guess the backlight led is driven inverted. When in pwm those are pulses, when in sleep it is an fix level...
-
- Posts: 849
- Joined: Wednesday 15 August 2018 14:38
- Target OS: -
- Domoticz version:
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
The "hack" invert all brightness, it need to work for all requests, even the sleep brightness.
You mean with it the normal setting for brightness is reversed but you still have the same issue ?
The fonction is screen_timer_sleep() and inside there is
Code: Select all
screen_setBrightness(0);
I have just see this fonction
Code: Select all
void set_screen_brightness()
{
if (global_config.brightness < 32)
screen_setBrightness(255);
else
screen_setBrightness(global_config.brightness);
}
I guess the backlight led is driven inverted. When in pwm those are pulses, when in sleep it is an fix level...
Code: Select all
screen_setBrightness(0);
I m reducting the frequency too, but I don't think it can have an impact on brightness ....
-
- Posts: 4
- Joined: Sunday 23 February 2025 21:14
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Yes, this make it works! Thank-you !
You can publish the 5" sunton
Was this my mistake trying to make the screen working?
screen_setBrightness(254) => screen_setBrightness(0)

You can publish the 5" sunton
Was this my mistake trying to make the screen working?
screen_setBrightness(254) => screen_setBrightness(0)
Code: Select all
#ifdef AUTO_BRIGHTNESS
....
#else
screen_setBrightness(0);
isScreenInSleep = true;
// Screen is off, no need to make the cpu run fast, the user won't notice ;)
setCpuFrequencyMhz(CPU_FREQ_LOW);
Serial.printf("CPU Speed: %d MHz\n", ESP.getCpuFreqMHz());
#endif
}
-
- Posts: 849
- Joined: Wednesday 15 August 2018 14:38
- Target OS: -
- Domoticz version:
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
IDK ^^, depend if this code was here before or after your issue.Was this my mistake trying to make the screen working?
Im doing same, it s for that there is so much disabled code, I m not able to remember if it's usefull or not.
So what is the final solution ? to add it officially on github.
Rool back to
Code: Select all
screen_setBrightness(0);
Who is online
Users browsing this forum: No registered users and 1 guest