Page 14 of 15
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Saturday 28 February 2026 17:27
by Rik60
I have a switch named "Terras verlichting". It is not an On/Off switch but a dimmer. How can i change the icon op the display so i can also set a value or slider?
Thanks
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Sunday 01 March 2026 9:09
by Thorgal789
@Rik60
So ATM the device is reconised as simple light, without dimmer feature ?
Can you give me some information about the device ?
The code set a Dimmer if
- type = "Light/Switch"
- subtype = "Switch"
- switchtype = "Dimmer"
You can see thoses information on the device widget in domoticz or using a browser
Code: Select all
http://IP:PORT/json.htm?type=command¶m=getdevices&rid=ID
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Sunday 01 March 2026 11:29
by Rik60
"Type" : "Lighting 2",
"SubType" : "AC",
"SwitchType" : "Dimmer",
The device is a light, remote controlled by "Klik aan Klik uit" on 433Mhz.
Thanks
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Sunday 01 March 2026 15:08
by Thorgal789
Ok so make a search on (you will found it in data_setup.cpp around line 457
Code: Select all
else if (strncmp(type, "Lighting", 8) == 0)
and edit the block to have
Code: Select all
else if (strncmp(type, "Lighting", 8) == 0)
{
d->type = TYPE_LIGHT;
const char* switchtype = i["SwitchType"];
if (strcmp(switchtype,"Dimmer") == 0)
{
d->type = TYPE_DIMMER;
}
}
And BTW what mean the "AC" ? alternative current ?
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Monday 02 March 2026 9:13
by Rik60
Thanks,
I have a slider now, but i can't control the light intensity with it, even when i move it. The slider is moving when i control the intensity from another device (computer). On the display dashboard there is no indication now that the lamp is on or off.
AC is, in this case, is how to transmit a code for a specific device, how the code is build.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Monday 02 March 2026 16:55
by Thorgal789
Here I don't see the problem, perhaps someting specific to this device ? But return are working ...
When I try to send command to domoticz I m using the API
Code: Select all
/json.htm?type=command¶m=switchlight&idx=IDX&switchcmd=Set%%20Level&level=LEVEL
The result in domoticz is
Code: Select all
2026-03-02 16:46:40.865 Status: User: admin (IP: 192.168.1.29) initiated a switch command (36/Deconz - Dimmer salon/Set Level)
2026-03-02 16:46:40.911 Deconz: onCommand called for Unit 8: Parameter 'Set Level', Level: 69, Hue:
2026-03-02 16:46:43.897 Status: User: admin (IP: 192.168.1.29) initiated a switch command (36/Deconz - Dimmer salon/Set Level)
2026-03-02 16:46:43.926 Deconz: onCommand called for Unit 8: Parameter 'Set Level', Level: 28, Hue:
2026-03-02 16:46:48.828 Status: User: admin (IP: 192.168.1.29) initiated a switch command (36/Deconz - Dimmer salon/Set Level)
2026-03-02 16:46:48.831 Deconz: onCommand called for Unit 8: Parameter 'Set Level', Level: 79, Hue:
2026-03-02 16:47:12.564 Status: User: admin (IP: 192.168.1.29) initiated a switch command (36/Deconz - Dimmer salon/Set Level)
2026-03-02 16:47:12.574 Deconz: onCommand called for Unit 8: Parameter 'Set Level', Level: 51, Hue:
Have made the try on a deconz dimmer.
You haven't an error message ?
On the display dashboard there is no indication now that the lamp is on or off
You haven't a small "on" when the device is on ?
Here I m checking "Data" value in
Code: Select all
http://IP:PORT/json.htm?type=command¶m=getdevices&rid=ID
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Saturday 07 March 2026 9:11
by Thorgal789
@Rik60 you had some time to make test with the API to see where the problem is from ?
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Saturday 07 March 2026 11:13
by Rik60
Sorry, spent a lot a time for another domoticz issue.
Attached a domoticz log whart domoticz is receiving from the display, nowether the possition of the slider is, received is always a level of 31?
And on the dashboard of the display there is no indication that the lamp is on.
Thanks
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Saturday 07 March 2026 21:20
by Thorgal789
31 is the device ID ^^.
On my side I have
Code: Select all
2026-03-02 16:47:12.564 Status: User: admin (IP: 192.168.1.29) initiated a switch command (36/Deconz - Dimmer salon/Set Level)
2026-03-02 16:47:12.574 Deconz: onCommand called for Unit 8: Parameter 'Set Level', Level: 51, Hue:
The 36 value is always the same.
I will try to simulate your device on Domoticz but without the hardware Im not sure it will work.
Can you share the complete devince json from domoticz ?
Code: Select all
http://IP:PORT/json.htm?type=command¶m=getdevices&rid=31
Perhaps you are concerned by
Level should be the dim level (not percentage), like 0-16 or 0-100 depending on the hardware used
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Sunday 08 March 2026 11:42
by Rik60
It is a bit strange, if the lamp is on and tap on the diplay for a low lamp setting it is working but the value is never the same.
The displayed range on the display is from 0-100%, domoticz is range from 0-100 (without %)
I never see that the level is set a a level, in your case the level is set at 51.
Attached the complete device json and some domoticz logging.
The display i use is an ESP32S3-8043S043
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Monday 09 March 2026 16:48
by Thorgal789
I never see that the level is set a a level, in your case the level is set at 51
Yeah it's from the hardware, can be different for all of them, in this exemple it's a message from the python plugin.
Same than me, and it's "On" when the light is on ?
The code just check for value "On" (not for "Off"), if it's "On" it's power on, in all other situation it's power off.
But here
Code: Select all
"Level" : 40,
"LevelInt" : 6,
"MaxDimLevel" : 15,
For me the max level is 100, not 15. I think domoticz is using a 0/100 value but make a convertion at a moment (6 = 40% of 15)
And from the API
Level should be the dim level (not percentage), like 0-16 or 0-100 depending on the hardware used
So can you make try with values from 0 to 15 max to test?
The code check for "level" value, so if you send a level = 6, the hardware will see 40 in websocket return, so the slider will move itself to position 40.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Monday 09 March 2026 20:37
by Rik60
Did some tests:
slider display slider domoticz
13 13
6 6
19 100
9 -> 60 60 set the display slider on 9, slider domoticz -> 60, slider display ->60
93 93
3 -> 20 20
There is never "On" on the display dashboard that the lamp is on.
If i set the slider in domoticz on a value, the slider on the display is then always on that value.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Tuesday 10 March 2026 17:50
by Thorgal789
20% of 15 = 3
60% 15 = 9
9 -> 60
60 set the display slider on 9, slider domoticz -> 60, slider display ->60
You send the request with level = 9/15, domoticz convert it in percent = 60%, and the device display the 60%
So it's seem to be the problem, have updated the code on branch "test"
https://github.com/Smanar/CYD-Domoticz- ... e552886c6c
I think it will solve the level problem.
For the "On" never displayed, I realy have no clue ...
Can you check what is the "Data" value when the light is powered on the device json ?
Code: Select all
"CustomImage" : 0,
"Data" : "Off",
"Description" : "",
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Tuesday 10 March 2026 20:00
by Rik60
Thanks, that slider problem is solved. Level on the display is now always the same as in Domoticz.
If i switch the lamp off, data is " Off", if the lamp is on at a level, data is "Set level: 46%". 46 is the level at that moment.
Next to the slider on the right there is a small On/Off switch slider.
If i move that switch to the right the lamp goes on and the switch stays On. If i switch the lamp off in Domoticz the lamp goes off and the switch is moving to its off position. If i then turn the lamp on in Domoticz the switch on the diaplay stays in its off position.
I never see "On" on the dashboard. It was in earlier version of the software, this problem occurd when the slider was introduced.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Wednesday 11 March 2026 16:46
by Thorgal789
If i switch the lamp off, data is " Off", if the lamp is on at a level, data is "Set level: 46%".
Ok so I think you have found the problerm
On device_panel.cpp around line 409, replace
Code: Select all
if (strcmp(SelectedDevice->data, "On") == 0)
By
Code: Select all
if (strcmp(SelectedDevice->data, "Off") != 0)
In Home_panel.cpp around line 113, replace
Code: Select all
if (d->type < TYPE_SWITCH && strcmp(d->data, "On") == 0)
by
Code: Select all
if (d->type < TYPE_SWITCH && strcmp(d->data, "Off") != 0)
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Thursday 12 March 2026 16:49
by Rik60
Yes, it's working now. Slider is ok, and on the display's dashboard the lamp is "On" when the lamp is switched on.
Just a thought, is it possible to have a push button as On/Off switch? Now it's a slider switch next to the level slider
Thanks
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Thursday 12 March 2026 18:33
by Thorgal789
Nice, the updated code is not yet online, but next versin will include your changes.
Code: Select all
is it possible to have a push button as On/Off switch? Now it's a slider switch next to the level slider
Ha yes, the defaut "button" is a switch (a little slider with 2 positions) not a button, but it's the defaut one, for device making only on/off it's possible to switch them direclty on home page, but as this one have slider too, you have the "switch".
But what is the problem with it ? It's just visual, it's not a slider, on press toggle the state, there is no mouvement to done. It's like a button with 2 states ?
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Friday 13 March 2026 9:41
by Rik60
You are right. I thought that it was a slider. If i press it, it's toggles.
Is it possible to have the switch on the same high (line) as the level slider? I think it looks nicer.
Thanks for all your work.
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Friday 13 March 2026 16:32
by Thorgal789
I can't make it general but it's fast.
In device_panel.cpp around line 499, replace
by
Code: Select all
lv_obj_align(slider, LV_ALIGN_CENTER, 0, -19);
Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Sunday 15 March 2026 20:41
by Rik60
I have changed:
into
Code: Select all
lv_obj_align(slider, LV_ALIGN_CENTER, 0, -31);
I think it's nicer...
Thanks