Page 4 of 13
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Thursday 29 February 2024 22:48
by palnic

- 20240229_154334.jpg (64.03 KiB) Viewed 1893 times
Thank you! Trusted network was an issue. Working to adjust a screen
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Friday 01 March 2024 16:16
by Thorgal789
For this page, it's my fault, the display is not dynamic enought, lot of value are hard coded.
I will correct it this Week end.
BTW you need to reverse color
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Friday 01 March 2024 17:38
by palnic

- 20240301_101921.jpg (109.06 KiB) Viewed 1867 times
Thanks. I made a change in SETTINGS screen. On the home screen when you click any SWITCH buttons, program goes on the second screen where you can turn it ON/OFF. I want to turn ON/OFF my switches on home screen, could you please point where I can look for the event handler, I am still learning. I don't want full Domoticz menu on this small screen, just 2/3 switches, 2/3 temp sensors and that it, everything on the home screen. Thanks again.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Friday 01 March 2024 18:29
by kniazio
palnic wrote: ↑Friday 01 March 2024 17:38
20240301_101921.jpgThanks. I made a change in SETTINGS screen. On the home screen when you click any SWITCH buttons, program goes on the second screen where you can turn it ON/OFF. I want to turn ON/OFF my switches on home screen, could you please point where I can look for the event handler, I am still learning. I don't want full Domoticz menu on this small screen, just 2/3 switches, 2/3 temp sensors and that it, everything on the home screen. Thanks again.
I join in the request @palnic

Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Saturday 02 March 2024 15:46
by Thorgal789
But the problem is to keep something homogeneous. There is so much "light" device, and just a little where the "fast clic" is possible, and not so hard to use one more clic.
BTW, was not so hard to code, so have added a special flag, you can enable it in the platformio.ini file "DFASTCLIC", it will make possible a "fast clic" for some device
Code: Select all
#ifdef FASTCLIC
Device *d2 = (Device *)d;
if ((d2->type == TYPE_PUSH) || (d2->type == TYPE_LIGHT) || (d2->type == TYPE_SWITCH) || (d2->type == TYPE_PLUG))
{
char buff[256] = {};
lv_snprintf(buff, 256, "/json.htm?type=command¶m=switchlight&idx=%d&switchcmd=%s", d2->idx, "Toggle");
HTTPGETRequest(buff);
return;
}
#endif
It will use the "toogle" command, I think it will be enought ?
New version online, still on branch "test", with this feature, some graphical changes, and native support for @palnic device (vertical mode)
DBONUSPAGE is still WIP.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Saturday 02 March 2024 16:49
by kniazio
Come on, sir. Now this is MEGA. Just some extra pages and the project is beautiful. Respect.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Wednesday 06 March 2024 16:30
by palnic
@Thorgal789 Thanks a lot, I am using your latest main branch. Everything works as it is supposed. Was going to replace wall switch with display, when faced another issue. Wall switch is a standard/electric switch and I can't operate it with the display. Here is my idea. The display has three GPIO on connector P3. I can create virtual switches for Domoticz. Is it possible to link these virtual switches to the GPIO? If it is possible, I can design the PCB to add some relays there and manage local switches. Also I can order some prototype PCBs to play with. What is your thoughts?
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Wednesday 06 March 2024 18:13
by Thorgal789
Yeah I had the same idea when I have started the project, use the GPIO or other stuff integred to the device, on mine I have temperature, luminosity, led, sound and ect ...
But the problem is the communication with domoticz.
My first idea was to make a plugin, so all sensors can be usable, and will be possible to send command to the device (double side communication), like a dynamic display, all will be managed by the plugin and not the device. But there is no interface, so it mean making plenty scripts to make a custom display or select which one device to use or not.
ATM the device is able to send request, so it can send request to a virtual device created in domoticz to enable or disable it.
But it receive only websocket, haven't enabled a server feature. So not possibble to trigger GPIO from domoticz (or using a hacky code that scan websocket for a special device name and trigger gpio, this is possible too)
The code is dynamic, so you can make all you want with it, change the widget number, the page to use, the device you prefer, but not possible to add "special" widget controled only by the device.
So it mean another solution will be to create a special page with just 2 switches to enable/disable the gpio, in local mode. This is easy and can be disabled by defaut for others users to prevent memory use. But more hardware work, haven't see if it's possible yet.
It's possible too using 220 V module behind the device, for exemple a zigbee one.
On my side I have give up with the gpio use for power for 2 reasons :
- it's 240 V, and I'm afraid of fires, I don't want to use DIY stuff for this part.
- Actual available GPIO on mine (the extended GPIO connector) are input only, so need to use a different interface, have checked fastly your device, and I think it's same for you, so probably need to use a serial port ...
If you want to make try, I can code something, I don't think the problem will be the software but more the hardware.
For the moment my solution will be a new hole, I will put a cache when I sell the house. Or replace unused switch, I don't need 4 commands for a light with a presence sensor.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Wednesday 06 March 2024 21:03
by palnic
It is good to free yourself from illusions. You are right, I am not talking about communication, interface and so on issue, just general technical questions. I can buy a Zigbee relay for $3 and use it to replace a wall switch. Just a single 5V relay cost $5. You can buy 7" android tablet for $40 and run fully functional domoticz. It is hard to compete to China.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Thursday 07 March 2024 17:15
by Thorgal789
Lol sure, imagine your device have wifi+bluetooth+full OS+sensors+display+touchpad for less than 10 euros ^^
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Tuesday 12 March 2024 6:43
by kniazio
To @Thorgal789 . I see there are some updates on Github. Please write on the forum what has changed
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Tuesday 12 March 2024 17:30
by Thorgal789
Honnestly I don't remember, the code move a lot ATM, last changes was :
- The "multi page" support, working but setting are still hardcoded
- A special support for the Rain widget.
- Minor Graphical changes
- ATM I m trying to reduce the memory used, so invisible for you.
And we are trying to make a support for the ESP32-4848S040, a square device with relay.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Tuesday 12 March 2024 20:52
by Rik60
Hi, interesting project.
I have a Sunton display EPS32-8048S043C ips display with touch resolution 800*480. I think its a bit simular with the esp32-E32S3RGB43. I have tried this but is not working. I can compile and upload it to the display without errors but the display stays dark, backlight is off. What settings do i have to use/change to make it work?
Thanks
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Wednesday 13 March 2024 16:35
by Thorgal789
I have found this code
https://github.com/Zer0-bit/8048S043C-t ... 048S043C.h
So have used it to make a try with your device, still on branch "test"
In the platformio.ini file just comment/uncomment
[platformio]
;default_envs = esp32-2432S028R
;default_envs = esp32-2432S024C
;default_envs = esp32-E32S3RGB43
;default_envs = esp32-4848S040
default_envs = esp32-8048S043C
We had the same problme for the esp32-E32S3RGB43, your device don't have "special feature" for backlight with solder or not a resisitor ?
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Thursday 14 March 2024 9:32
by Rik60
Thanks for the update.
After seareching the web i found another solution, i modified esp32-E32S3RGB43 a bit, i had to change some IO pins, after that the backlight went on and the calibration screen was visible, but the touch didn't work.
After updating the testversion the dispay starts and the calibration screen was visible, but only 1 cross is visible. With some luck the wifi setting screen shows but i can't select a wifi and the keyboard is partly visible. I think i have to play with some setting.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Thursday 14 March 2024 17:30
by Thorgal789
You are using the code on the github (branch "test") or using a custom one ?
Can you share it if it's a custom one ? I have see some issues (corrected) about this device and the touchpad resolution.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Friday 15 March 2024 21:17
by Rik60
Finale i have the display running, using the branch "test"on github. I had to make some changes:
platformio.ini:
line 166 changed 800 to 480
line 167 changed 480 in 800
in driver esp32-8048043C.h:
line 55 and 57 change text TFT_WIDTH in 800
line56 and 58 change text TFT_HEIGHT in 480
In settingsscreen i can select rotate screen, but has no effect. On the home screen i only have 4 devices on the top line. If i try to slect more devices in setting(Dft devices), they are not visible.
Also a tip: On a empty home screen, is it possible to have some text here so you can see that the startup is finished
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Saturday 16 March 2024 12:43
by Thorgal789
Thx, have corrected the code with yours values
In settingsscreen i can select rotate screen, but has no effect
Yes was not enabled with your driver, because I can't try it, and hard to add new device with more exotic settings. I have re-enabled it on the new "test" branch
Code: Select all
#ifdef LOVYANGFX
tft.setRotation(global_config.rotateScreen ? 3 : 1);
#endif
The code switch between value 3 and 1, values can go from 0 to 3 and 4 to 7 in "mirored" mode.
This setting is to rotate at 180 degré, not 90, it's to have the USB port on the other side, no to switch portrait/landscape.
If i try to slect more devices in setting(Dft devices), they are not visible
Perhaps a typo ?
You can see what happen using the "serial monitor", there is so much usefull log for the moment.
Also a tip: On a empty home screen, is it possible to have some text here so you can see that the startup is finishe
As yes, not a bad idea, on first run, if the user haven't used hard coded value, the application take all idx from 0 to 9, hoping for at least one of them is working.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Saturday 16 March 2024 17:41
by Rik60
Thx,
I have downloaded the updated code. Worked fine.
I am trying to fill the homescreen, i can't put all switches there, seems that only the types "switch" can by put there. If i try a type "Lighting 1" is is not visible. If i try a screen (type = Switch) it is on the homescreen but i can't control it. There is no command in the serial screen.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Saturday 16 March 2024 20:03
by Thorgal789
It's possible I miss some widget type, like the "ARC" type.
If you know how to get information (using http://IP:PORT/json.htm?type=command¶m=getdevices&rid=ID, can you give me the type/subtype (and switchtype if exist) ?
Else a widget capture from domoticz.
And yes, if the device type is not supported you will have an empty place, but it's fast to correct.
I have take a look fast here , but I don't see what can be the "Lighting 1"
https://www.domoticz.com/wiki/Developin ... vice_Types