New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Moderators: leecollings, remb0
-
- Posts: 82
- Joined: Sunday 25 June 2023 21:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.3
- Location: The Netherlands
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Thanks for asking, but no at the moment. I am going to try next week
-
- Posts: 82
- Joined: Sunday 25 June 2023 21:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.3
- Location: The Netherlands
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Tried to edit the code, but i am running into trouble.Rik60 wrote: ↑Saturday 27 April 2024 17:58Thx,Thorgal789 wrote: ↑Saturday 27 April 2024 12:13 Ha yes, I m reading the value, data don't contain "open" or "closed" but the level (except for 0 and 100 value, so only full closed or full open)Code: Select all
Data : "Set Level: 38 %"
So you don't to change the icon but add a text for the covering ?Code: Select all
For me i like the On, Off, Open, Closed as text in a icon.
If it's just that, I can make the code today. But if you want to search yourself, you can useto have the covering level and print "open" or "closed" (it's a numeric value, from 0> 100)Code: Select all
d->level
or use
with that you will check the "full closed", and all others values will be the "Open"Code: Select all
if (d->type == TYPE_BLINDS && strcmp(d->data, "Closed") == 0)
Check the "data" value on a browser using the URLyou can have a "custom" device not managed like mines.Code: Select all
http://192.168.1.1:8080/json.htm?type=command¶m=getdevices&rid=ID
I am going to try to edit the code myself.
Thanks for the tips.
For the switch and powersockets i use:
Code: Select all
if (d->type < TYPE_SWITCH && strcmp(d->data, "On") == 0)
Code: Select all
if (d->type < TYPE_SWITCH && strcmp(d->data, "Off") == 0)
For the blinds i use:
Code: Select all
if (d->level < TYPE_BLINDS && strcmp(d->data, "Open") == 0)
Code: Select all
if (d->level < TYPE_BLINDS && strcmp(d->data, "Closed") == 0)
Am i doing something wrong?
I like to have 'Open', 'Closed' and, if possible the level between them.
I can see in the data the level status as:
Code: Select all
Data : "Set Level: xx %"
Code: Select all
Data : "Closed"
Code: Select all
Data : "Open"
Thanks
-
- Posts: 815
- 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)
Code: Select all
d->level
Code: Select all
if (d->level > 0)
But easier the code can be just
Code: Select all
// Display a open/clode state for covering
if (d->type == TYPE_BLINDS)
{
lv_obj_t * label = lv_label_create(Button_icon);
lv_obj_set_style_text_color(label, color, 0);
lv_obj_align_to(label, img, LV_ALIGN_OUT_RIGHT_BOTTOM, 0, 0);
if (strcmp(d->data, "Closed") == 0)
{
lv_label_set_text(label, " Closed");
}
else
{
lv_label_set_text(label, " Open");
}
}
To print the level can use
Code: Select all
lv_label_set_text_fmt(label, "%d %",d->level );
-
- Posts: 82
- Joined: Sunday 25 June 2023 21:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.3
- Location: The Netherlands
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Thanks,
Added and edited a bit:
With this as result (and some translation):
Added and edited a bit:
Code: Select all
// Display a open/clode state for covering
if (d->type == TYPE_BLINDS)
{
lv_obj_t * label = lv_label_create(Button_icon);
lv_obj_set_style_text_color(label, color, 0);
lv_obj_align_to(label, img, LV_ALIGN_OUT_RIGHT_BOTTOM, 0, 0);
if (strcmp(d->data, "Closed") == 0)
{
lv_label_set_text(label, " Dicht");
}
if (strcmp(d->data, "Open") == 0)
{
lv_label_set_text(label, " Open");
}
if ((strcmp(d->data, "Closed") != 0) && (strcmp(d->data, "Open") != 0))
{
lv_label_set_text_fmt(label, " %d %%",d->level );
}
}
- Attachments
-
- Display_4x4_level.jpg (206.39 KiB) Viewed 1465 times
-
- Posts: 815
- 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, so the data contain "open" or "close" or a level ? there is 3 possibles values ?
BTW I will take your capture for the project ^^.
BTW I will take your capture for the project ^^.
-
- Posts: 82
- Joined: Sunday 25 June 2023 21:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.3
- Location: The Netherlands
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Yes, the data can contain 3 possible values:
Open
Closed
Level %
Open
Closed
Level %
-
- Posts: 10
- Joined: Sunday 01 November 2020 20:48
- Target OS: Windows
- Domoticz version: 2024.4
- Location: Sweden
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
I get this 7" displayboard and wonder if this can work with same software, do i have to make the driver myself?
Panlee ZX7D00CE01S-V13
http://en.smartpanle.com/product-item-19.html
https://www.aliexpress.com/item/1005006156603547.html
data:
https://img01.71360.com/file/read/www2/ ... asheet.pdf
Panlee ZX7D00CE01S-V13
http://en.smartpanle.com/product-item-19.html
https://www.aliexpress.com/item/1005006156603547.html
data:
https://img01.71360.com/file/read/www2/ ... asheet.pdf
-
- Posts: 815
- 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 found somes usefull links
https://github.com/moononournation/Ardu ... ssions/361
https://github.com/moononournation/Ardu ... ssions/368
https://github.com/fbiego/jarvis-lvgl-esp32
So based on them have created a esp32-ZX7D00CE01S environnement to test on branch "test", need to enable your device in platformio.ini file to test it
I m not using the same code than them for the touch, but it seem you have a GT911 too and the code I m using is already tested for another device.
https://github.com/moononournation/Ardu ... ssions/361
https://github.com/moononournation/Ardu ... ssions/368
https://github.com/fbiego/jarvis-lvgl-esp32
So based on them have created a esp32-ZX7D00CE01S environnement to test on branch "test", need to enable your device in platformio.ini file to test it
Code: Select all
default_envs = esp32-ZX7D00CE01S
-
- Posts: 10
- Joined: Sunday 01 November 2020 20:48
- Target OS: Windows
- Domoticz version: 2024.4
- Location: Sweden
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Super! i do some testing
-
- Posts: 10
- Joined: Sunday 01 November 2020 20:48
- Target OS: Windows
- Domoticz version: 2024.4
- Location: Sweden
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Have done som testing now and i get no backlight so dont know if screen is working, touchdriver seems to work, i can calibrate screen according to log.
No backlight
I tested the files from https://github.com/fbiego/jarvis-lvgl-esp32 and then i get backlight and working screen for 1 second then start flickering one line.. i have marked photo to see that the backlight is on
I try to find out how the backlight is turning on and do some more testing
No backlight
Code: Select all
--- Terminal on COM5 | 115200 8-N-1
--- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at https://bit.ly/pio-monitor-filters
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x128
load:0x403c9700,len:0xb90
load:0x403cc700,len:0x28cc
entry 0x403c98b8
Starting application
Config version: 0
Clearing Global Config
Init 911 driver
Driver GT911 started: (800x480)
Check ACK on addr request on 0x
5D
: SUCCESS
Starting calibration
Calibration coef: 1.2 , -1.4
Calibration offset: -103.8 , 602.4
Display buffer size: 38400 bytes
Screen init done
Brightness value: 255
-
- Posts: 815
- 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)
Try adding in esp32-ZX7D00CE01S.h file
It's the code Im using for other device, can be enought.
On his code he have disabled this one and use instead
For the second part, file to edit is screen_driver.cpp around line 524
Code: Select all
#define GFX_BL 45
On his code he have disabled this one and use instead
Code: Select all
#define GFX_BL 45
const int freq = 1000;
const int ledChannel = 7;
const int resolution = 8;
Code: Select all
// #ifdef GFX_BL
// pinMode(GFX_BL, OUTPUT);
// digitalWrite(GFX_BL, HIGH);
// #endif
ledcSetup(ledChannel, freq, resolution);
ledcAttachPin(GFX_BL, ledChannel);
ledcWrite(ledChannel, int(2.55 * 95));
-
- Posts: 10
- Joined: Sunday 01 November 2020 20:48
- Target OS: Windows
- Domoticz version: 2024.4
- Location: Sweden
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
I added #define GFX_BL 45 in driver file and i get picture , i have to change resolution to 800x481 because a white line at bottom (read this on the other link you find)
But i cant swipe right (settings) screen get white and restart, swipe left is working.
I upload a video here:
(Havent fix the custom font)
But i cant swipe right (settings) screen get white and restart, swipe left is working.
I upload a video here:
(Havent fix the custom font)
-
- Posts: 815
- 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)
Nice, updating the code (not sure I have set the 481 at good place, in the platformio.ini file ?
Ok so you have crash on the "tool" panel (There is in order, tool/home/home_bis/group/info)
This page display hardware information, there is perhaps something bad on memory stuff ATM for your device
Can you try to catch logs using the serial monitor ?
Else I think the guilty code is here, the rest only display 2 buttons.
Can try to disable this code in tools-panel.cpp, and re-enable it line by line.
About custom font, where are you front ? (Wich one font you need)
Ok so you have crash on the "tool" panel (There is in order, tool/home/home_bis/group/info)
This page display hardware information, there is perhaps something bad on memory stuff ATM for your device
Can you try to catch logs using the serial monitor ?
Else I think the guilty code is here, the rest only display 2 buttons.
Code: Select all
lv_mem_monitor_t mon;
lv_mem_monitor(&mon);
uint32_t used_size = mon.total_size - mon.free_size;
char Text[151];
lv_snprintf(Text, 150, "+ HEAP Memory Usable (Kb) %d, Max %d, Total %d\n", ESP.getMaxAllocHeap()/1024, ESP.getFreeHeap()/1024, ESP.getHeapSize()/1024);
lv_snprintf(Text + strlen(Text),150, "+ PSRAM Memory Free (Kb) %d, Total %d\n", ESP.getFreePsram()/1024, ESP.getPsramSize()/1024);
lv_snprintf(Text + strlen(Text), 150, "+ LV Heap %d kB used (%d %%) %d%% frag.\n", used_size / 1024, mon.used_pct, mon.frag_pct);
//lv_snprintf(Text + strlen(Text), 150, "Spiram size (Kb) %d , himem free %d\n", esp_spiram_get_size()/1000, esp_himem_get_free_size()/1000); // Not used, CRASH
lv_snprintf(Text + strlen(Text), 150, "+ Application Version : %d", 1);
label = lv_label_create(cont2);
lv_label_set_long_mode(label, LV_LABEL_LONG_WRAP);
lv_label_set_text(label, Text);
lv_obj_set_size(label, LV_PCT(100), LV_PCT(100));
lv_obj_set_style_text_align(label, LV_TEXT_ALIGN_LEFT, 0);
About custom font, where are you front ? (Wich one font you need)
-
- Posts: 10
- Joined: Sunday 01 November 2020 20:48
- Target OS: Windows
- Domoticz version: 2024.4
- Location: Sweden
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
The crash happens when try to get Psram info
if i disable the Psram line it works, maybe some config/bug for the ESP32S3 / Psram
if i disable the Psram line it works, maybe some config/bug for the ESP32S3 / Psram
Code: Select all
char Text[151];
lv_snprintf(Text, 150, "+ HEAP Memory Usable (Kb) %d, Max %d, Total %d\n", ESP.getMaxAllocHeap()/1024, ESP.getFreeHeap()/1024, ESP.getHeapSize()/1024);
//lv_snprintf(Text + strlen(Text), 150, "+ PSRAM Memory Free (Kb) %d, Total %d\n", ESP.getFreePsram()/1024, ESP.getPsramSize()/1024);
lv_snprintf(Text + strlen(Text), 150, "+ LV Heap %d kB used (%d %%) %d%% frag.\n", used_size / 1024, mon.used_pct, mon.frag_pct);
//lv_snprintf(Text + strlen(Text), 150, "Spiram size (Kb) %d , himem free %d\n", esp_spiram_get_size()/1000, esp_himem_get_free_size()/1000); // Not used, CRASH
lv_snprintf(Text + strlen(Text), 150, "+ Application Version : %d", 1);
-
- Posts: 10
- Joined: Sunday 01 November 2020 20:48
- Target OS: Windows
- Domoticz version: 2024.4
- Location: Sweden
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
About custom font, im from Sweden so i use åäö but we solved this erlier on Github and i think i can modify that now.
-
- Posts: 815
- 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)
Yep @ElMyggo have share his police on the github https://github.com/Smanar/CYD-Domoticz- ... 2100620260
About the issue, have made some search but I can't say if the issue is from the config or the hardware. But there is others users with the same issue.
According the jarvis project can try to replace in the platoformio.ini file
by
In build_flags
Perhaps your device don't have psram, but from the ALI express link it have 8M, there is different version ?
If you can't avoid the crash I will disable it for all board, but it can be usefull later ...
About the issue, have made some search but I can't say if the issue is from the config or the hardware. But there is others users with the same issue.
According the jarvis project can try to replace in the platoformio.ini file
Code: Select all
board = esp32-s3-devkitc-1
board_build.partitions = min_spiffs.csv ; Use partitions that allocate 512KB for SPIRAM
Code: Select all
board_build.partitions = app3M_fat9M_16MB.csv
board = esp32s3box
Code: Select all
-mfix-esp32-psram-cache-issue
If you can't avoid the crash I will disable it for all board, but it can be usefull later ...
-
- Posts: 10
- Joined: Sunday 01 November 2020 20:48
- Target OS: Windows
- Domoticz version: 2024.4
- Location: Sweden
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Have now tested many different settings whitout any luck so i continue to have psram disabled.
I should have 8M memory but i can get a faulty board or something else.
I should have 8M memory but i can get a faulty board or something else.
-
- Posts: 815
- 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)
Don't worry, I will disable it by defaut for all OS.
For the moment it's just an information, the code don't use them, so not usefull.
I will re-enable it later when needed.
Code is updated (just disabled the psram debug output)
For the moment it's just an information, the code don't use them, so not usefull.
I will re-enable it later when needed.
Code is updated (just disabled the psram debug output)
-
- Posts: 815
- 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)
For thoses one that use the "stand by" mode, or don't use intensely the device, gizmocuz have added a new feature on recent domoticz version.
It's possible now to subscribe on websocket notification only for needed devices.
To enable it, on "test" branch, just enable (For the moment only possible if you don't use "Bonus Home page panel")
On the "tool panel" I have added the Running time, and the total data received by the device by Websocket. the difference is just incredible, at start you will have a enormous JSON, but after it something like 20 time lighter without problem on hudge installation.
It's possible now to subscribe on websocket notification only for needed devices.
To enable it, on "test" branch, just enable
Code: Select all
-DLIGHTWS
On the "tool panel" I have added the Running time, and the total data received by the device by Websocket. the difference is just incredible, at start you will have a enormous JSON, but after it something like 20 time lighter without problem on hudge installation.
- gizmocuz
- Posts: 2350
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Perhaps if you put all used devices in a roomplan, and use this in your initial query, you have a lot less data at startup.
(See the example www/templates/custom.example)
(See the example www/templates/custom.example)
Quality outlives Quantity!
Who is online
Users browsing this forum: No registered users and 0 guests