Re: New project, a small wall display to control Domoticz using CYD (Cheap ESP32 touchscreen)
Posted: Monday 18 March 2024 19:58
I have some information, is this what you meant?
Open source Home Automation System
https://forum.domoticz.com/
Code: Select all
{
"DimmerLevels" : "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100",
"IsDimmer" : true,
"Name" : "Screen boven",
"SubType" : "Switch",
"Type" : "Light/Switch",
"idx" : "714"
},
Code: Select all
{
"DimmerLevels" : "none",
"IsDimmer" : false,
"Name" : "Zigbee plug 3",
"SubType" : "Switch",
"Type" : "Light/Switch",
"idx" : "730"
},
Hu ? It was normaly already removed when you have downloaded the code, I need to check if I haven't made the change on the wrong branchi think you can remove the "Ïmpuls" part in Data setup lines 414/417
Yes and no ^^. Yes the code is able to update the widget on homepage, and it does for sensor or warning widget for exemple, but I haven't do something for switch, If you have an idea of something I can do with design ? I prefer avoid use a different icon, because of memory, I can "gray a little" the icon like I do for group, but not realy visible.Is the data on the display synchonized with the main Domoticz, is i switch a light on, on a mobile phone, is it on the display also? Or is the dispay acting like a switch with no actual switch status?
I think it's because the graph, it depend of hardware processor, domoticz json (some of them can be realy hudge).I tried also to display a temp en hum sensor on the dispay, it worked but after selecting this device the display was very slow
Code: Select all
pTab = GetGraphValue(SelectedDevice->type, SelectedDevice->idx, &min, &max);
I m checking all was fine for thoses ones, you have issue with them ?Attached some info about "Screen boven" and "Zibee plug 3".
The dimmer device with idx 714 name "screen boven" is a rollershutter controlled by a Somfy I/O system. I can open or close but also give it a setpoint like a dimmer.
Code: Select all
"Type" : "Light/Switch",
"SubType" : "Switch",
"SwitchType" : "Blinds Percentage",
Code: Select all
content Length : 4786
Free memory : 110580
Code: Select all
content Length : 161936
Free memory : 220
Code: Select all
content Length : 81158
Free memory : 55284
The group/scene feature is still WIP, but yes you can make a try, have corrected the crash. This panel will show ALL groups/scenes (no watchdogs, idk if it can crash) , you can scroll bottom/top, but need to be re-enabledIf i disable the group screen but swipe to it, the display crashes and restart, see attachment.
In Domoticz i have created a group (IDX 5) that turns on/off the 4 zigbee devices. Is it possible to have this on the display to?
Code: Select all
-DNO_GROUP_PAGE # Disable the Group/scene panel
So display them like sensor, with a text on right ?Suggestion for On/Off indication of a switch: put the text On or Off insteat of the power symbol?
Code: Select all
#if DEVICE_SIZE == 1
lv_chart_set_axis_tick(chart, LV_CHART_AXIS_PRIMARY_Y, 3, 2, 4, 1, true, 25);
#else
lv_chart_set_axis_tick(chart, LV_CHART_AXIS_PRIMARY_Y, 3, 2, 4, 1, true, 35);
#endif
Code: Select all
#include <lgfx/v1/platforms/esp32s3/Panel_RGB.hpp>
#include <lgfx/v1/platforms/esp32s3/Bus_RGB.hpp>
#include <driver/i2c.h>
class LGFX: public lgfx::LGFX_Device {
public:
lgfx::Bus_RGB _bus_instance;
lgfx::Panel_RGB _panel_instance;
lgfx::Light_PWM _light_instance;
lgfx::Touch_GT911 _touch_instance;
LGFX(void) {
{
auto cfg = _bus_instance.config();
cfg.panel = &_panel_instance;
cfg.pin_d0 = GPIO_NUM_15; // B0
cfg.pin_d1 = GPIO_NUM_7; // B1
cfg.pin_d2 = GPIO_NUM_6; // B2
cfg.pin_d3 = GPIO_NUM_5; // B3
cfg.pin_d4 = GPIO_NUM_4; // B4
cfg.pin_d5 = GPIO_NUM_9; // G0
cfg.pin_d6 = GPIO_NUM_46; // G1
cfg.pin_d7 = GPIO_NUM_3; // G2
cfg.pin_d8 = GPIO_NUM_8; // G3
cfg.pin_d9 = GPIO_NUM_16; // G4
cfg.pin_d10 = GPIO_NUM_1; // G5
cfg.pin_d11 = GPIO_NUM_14; // R0
cfg.pin_d12 = GPIO_NUM_21; // R1
cfg.pin_d13 = GPIO_NUM_47; // R2
cfg.pin_d14 = GPIO_NUM_48; // R3
cfg.pin_d15 = GPIO_NUM_45; // R4
cfg.pin_henable = GPIO_NUM_41;
cfg.pin_vsync = GPIO_NUM_40;
cfg.pin_hsync = GPIO_NUM_39;
cfg.pin_pclk = 42;
cfg.freq_write = 12000000;
cfg.hsync_polarity = 0;
cfg.hsync_front_porch = 8;
cfg.hsync_pulse_width = 2;
cfg.hsync_back_porch = 43;
cfg.vsync_polarity = 0;
cfg.vsync_front_porch = 8;
cfg.vsync_pulse_width = 2;
cfg.vsync_back_porch = 12;
cfg.pclk_idle_high = 1;
_bus_instance.config(cfg);
}
_panel_instance.setBus( &_bus_instance);
{
auto cfg = _panel_instance.config();
cfg.memory_width = 800;
cfg.memory_height = 480;
cfg.panel_width = 800;
cfg.panel_height = 480;
cfg.offset_x = 0;
cfg.offset_y = 0;
_panel_instance.config(cfg);
}
{
auto cfg = _panel_instance.config_detail();
cfg.use_psram = 1;
_panel_instance.config_detail(cfg);
}
{
auto cfg = _light_instance.config();
cfg.pin_bl = 2;
//cfg.freq = 44100;
//cfg.pwm_channel = 7;
_light_instance.config(cfg);
}
_panel_instance.light( &_light_instance);
{
auto cfg = _touch_instance.config();
cfg.x_min = 0;
cfg.x_max = 800;
cfg.y_min = 0;
cfg.y_max = 480;
cfg.pin_int = -1;
cfg.bus_shared = false;
cfg.offset_rotation = 0;
// I2C
cfg.i2c_port = I2C_NUM_0; // I2C(0 = SPI or 1 = Wire)
cfg.pin_sda = 19; // SDA
cfg.pin_scl = 20; // SCL
cfg.pin_rst = 38; // RST
cfg.freq = 100000; // I2C
cfg.i2c_addr = 0x5D; // I2C 0x5D or 0x14
_touch_instance.config(cfg);
_panel_instance.setTouch( &_touch_instance);
}
setPanel( &_panel_instance);
}
};
Code: Select all
cfg.hsync_pulse_width = 10;
Code: Select all
cfg.memory_width = 800;
cfg.memory_height = 480;
cfg.panel_width = 800;
cfg.panel_height = 480;
Code: Select all
-DTFT_WIDTH=480
-DTFT_HEIGHT=800
Code: Select all
#include <lgfx/v1/platforms/esp32s3/Panel_RGB.hpp>
#include <lgfx/v1/platforms/esp32s3/Bus_RGB.hpp>
#include <driver/i2c.h>
class LGFX: public lgfx::LGFX_Device {
public:
lgfx::Bus_RGB _bus_instance;
lgfx::Panel_RGB _panel_instance;
lgfx::Light_PWM _light_instance;
lgfx::Touch_GT911 _touch_instance;
LGFX(void) {
{
auto cfg = _bus_instance.config();
cfg.panel = &_panel_instance;
cfg.pin_d0 = GPIO_NUM_15; // B0
cfg.pin_d1 = GPIO_NUM_7; // B1
cfg.pin_d2 = GPIO_NUM_6; // B2
cfg.pin_d3 = GPIO_NUM_5; // B3
cfg.pin_d4 = GPIO_NUM_4; // B4
cfg.pin_d5 = GPIO_NUM_9; // G0
cfg.pin_d6 = GPIO_NUM_46; // G1
cfg.pin_d7 = GPIO_NUM_3; // G2
cfg.pin_d8 = GPIO_NUM_8; // G3
cfg.pin_d9 = GPIO_NUM_16; // G4
cfg.pin_d10 = GPIO_NUM_1; // G5
cfg.pin_d11 = GPIO_NUM_14; // R0
cfg.pin_d12 = GPIO_NUM_21; // R1
cfg.pin_d13 = GPIO_NUM_47; // R2
cfg.pin_d14 = GPIO_NUM_48; // R3
cfg.pin_d15 = GPIO_NUM_45; // R4
cfg.pin_henable = GPIO_NUM_41;
cfg.pin_vsync = GPIO_NUM_40;
cfg.pin_hsync = GPIO_NUM_39;
cfg.pin_pclk = 42;
cfg.freq_write = 12000000;
cfg.hsync_polarity = 0;
cfg.hsync_front_porch = 8;
cfg.hsync_pulse_width = 2;
cfg.hsync_back_porch = 43;
cfg.vsync_polarity = 0;
cfg.vsync_front_porch = 8;
cfg.vsync_pulse_width = 2;
cfg.vsync_back_porch = 12;
cfg.pclk_idle_high = 1;
_bus_instance.config(cfg);
}
_panel_instance.setBus( &_bus_instance);
{
auto cfg = _panel_instance.config();
cfg.memory_width = 800;
cfg.memory_height = 480;
cfg.panel_width = 800;
cfg.panel_height = 480;
cfg.offset_x = 1000;
cfg.offset_y = 2000;
_panel_instance.config(cfg);
}
{
auto cfg = _panel_instance.config_detail();
cfg.use_psram = 1;
_panel_instance.config_detail(cfg);
}
{
auto cfg = _light_instance.config();
cfg.pin_bl = 2;
//cfg.freq = 44100;
//cfg.pwm_channel = 7;
_light_instance.config(cfg);
}
_panel_instance.light( &_light_instance);
{
auto cfg = _touch_instance.config();
cfg.x_min = 0;
cfg.x_max = 480;
cfg.y_min = 0;
cfg.y_max = 800;
cfg.pin_int = -1;
cfg.bus_shared = false;
cfg.offset_rotation = 0;
// I2C
cfg.i2c_port = I2C_NUM_0; // I2C(0 = SPI or 1 = Wire)
cfg.pin_sda = 19; // SDA
cfg.pin_scl = 20; // SCL
cfg.pin_rst = 38; // RST
cfg.freq = 100000; // I2C 8000 de incercat
cfg.i2c_addr = 0x5D; // I2C 0x5D or 0x14
_touch_instance.config(cfg);
_panel_instance.setTouch( &_touch_instance);
}
setPanel( &_panel_instance);
}
};