-
-
Save itmaybeokay/bd5c7aa574e8ed517148cf9c4c267bdb to your computer and use it in GitHub Desktop.
| esphome: | |
| name: panel | |
| friendly_name: panel | |
| platformio_options: | |
| build_flags: "-DBOARD_HAS_PSRAM" | |
| board_build.arduino.memory_type: qio_opi | |
| board_build.flash_mode: dio | |
| board_upload.maximum_ram_size: 524288 | |
| esp32: | |
| board: esp32-s3-devkitc-1 | |
| variant: esp32s3 | |
| framework: | |
| type: esp-idf | |
| sdkconfig_options: | |
| CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: y | |
| CONFIG_ESP32S3_DATA_CACHE_64KB: y | |
| CONFIG_SPIRAM_FETCH_INSTRUCTIONS: y | |
| CONFIG_SPIRAM_RODATA: y | |
| # Enable logging | |
| logger: | |
| i2c: | |
| sda: GPIO08 | |
| scl: GPIO09 | |
| # scan: True | |
| id: bus_a | |
| ch422g: | |
| - id: ch422g_hub | |
| address: 0x24 | |
| # Of the CH422's twenty-four i2c addresses, 0x24 is the correct one to use in the setup here. | |
| # Still, wow, that's a lot of i2c addresses. | |
| # Enable Home Assistant API | |
| api: | |
| encryption: | |
| key: | |
| ota: | |
| - platform: esphome | |
| password: | |
| wifi: | |
| ssid: !secret wifi_ssid | |
| password: !secret wifi_password | |
| # Enable fallback hotspot (captive portal) in case wifi connection fails | |
| ap: | |
| ssid: "Panel Fallback Hotspot" | |
| password: | |
| captive_portal: | |
| psram: | |
| mode: octal | |
| speed: 80MHz | |
| # Define display | |
| display: | |
| - platform: rpi_dpi_rgb | |
| id: my_display | |
| auto_clear_enabled: false | |
| color_order: RGB | |
| pclk_frequency: 16MHZ | |
| dimensions: | |
| width: 800 | |
| height: 480 | |
| de_pin: | |
| number: 5 | |
| hsync_pin: | |
| number: 46 | |
| ignore_strapping_warning: true | |
| vsync_pin: | |
| number: 3 | |
| ignore_strapping_warning: true | |
| pclk_pin: 7 | |
| reset_pin: | |
| ch422g: ch422g_hub | |
| number: 3 | |
| enable_pin: | |
| ch422g: ch422g_hub | |
| number: 2 | |
| hsync_back_porch: 16 | |
| hsync_front_porch: 16 | |
| hsync_pulse_width: 8 | |
| vsync_back_porch: 16 | |
| vsync_front_porch: 16 | |
| vsync_pulse_width: 8 | |
| data_pins: | |
| red: | |
| - 1 #r3 | |
| - 2 #r4 | |
| - 42 #r5 | |
| - 41 #r6 | |
| - 40 #r7 | |
| blue: | |
| - 14 #b3 | |
| - 38 #b4 | |
| - 18 #b5 | |
| - 17 #b6 | |
| - 10 #b7 | |
| green: | |
| - 39 #g2 | |
| - 0 #g3 | |
| - 45 #g4 | |
| - 48 #g5 | |
| - 47 #g6 | |
| - 21 #g7 | |
| touchscreen: | |
| platform: gt911 | |
| id: my_touch | |
| # Uncomment below if you got the janky OTHER i2c address this time | |
| #address: 0x14 | |
| # Probably fixed by adding reset_pin via CH422 though | |
| interrupt_pin: GPIO4 | |
| # DEFINE RESET PIN for consistent i2c address selection | |
| # CTP_RST is wired to IO1 of CH422G | |
| reset_pin: | |
| ch422g: ch422g_hub | |
| number: 1 | |
| mode: OUTPUT | |
| on_touch: | |
| - lambda: |- | |
| ESP_LOGI("Touch", "Touch detected at x=%d, y=%d", touch.x, touch.y); | |
| # Define fonts | |
| font: | |
| - file: "gfonts://Roboto" | |
| id: roboto24 | |
| size: 24 | |
| bpp: 4 | |
| - file: "gfonts://Roboto" | |
| id: roboto18 | |
| size: 18 | |
| bpp: 4 | |
| binary_sensor: | |
| - platform: homeassistant | |
| id: demo_light_status | |
| entity_id: light.demo | |
| internal: true | |
| on_state: | |
| then: | |
| - lambda: |- | |
| if (id(demo_light_status).state) { | |
| lv_obj_add_state(id(lv_button_demo_light), LV_STATE_CHECKED); | |
| lv_label_set_text(id(demo_light_status_label), "On"); | |
| } else { | |
| lv_obj_clear_state(id(lv_button_demo_light), LV_STATE_CHECKED); | |
| lv_label_set_text(id(demo_light_status_label), "Off"); | |
| } | |
| lvgl: | |
| displays: | |
| - my_display | |
| touchscreens: | |
| - my_touch | |
| theme: | |
| button: | |
| bg_color: 0x333333 | |
| bg_grad_dir: VER | |
| text_color: 0xFFFFFF | |
| checked: | |
| bg_color: 0xcc9900 | |
| text_color: 0x000000 | |
| bg_grad_color: 0x664d00 | |
| pressed: | |
| border_color: 0xff6600 | |
| pages: | |
| - id: main_page | |
| layout: | |
| type: flex | |
| flex_flow: column_wrap | |
| width: 100% | |
| bg_color: 0x000000 | |
| bg_opa: cover | |
| pad_all: 5 | |
| widgets: | |
| - button: | |
| checkable: true | |
| id: lv_button_demo_light | |
| width: 140 | |
| height: 150 | |
| widgets: | |
| - label: | |
| text_font: roboto24 | |
| text: "Demo\nLamp" | |
| - label: | |
| id: demo_light_status_label | |
| text: "Off" | |
| align: bottom_left | |
| on_click: | |
| then: | |
| - homeassistant.service: | |
| service: light.toggle | |
| data: | |
| entity_id: light.demo | |
| interval: | |
| - interval: 20s | |
| #startup_delay: 15s | |
| then: | |
| - lambda: |- | |
| if (id(demo_light_status).state) { | |
| lv_obj_add_state(id(lv_button_demo_light), LV_STATE_CHECKED); | |
| lv_label_set_text(id(demo_light_status_label), "On"); | |
| } else { | |
| lv_obj_clear_state(id(lv_button_demo_light), LV_STATE_CHECKED); | |
| lv_label_set_text(id(demo_light_status_label), "Off"); | |
| } | |
I'd just like to flag another possible issue. I just updated espHome to 2024.11.2 (ditto 2024.11.1) and recompiled my waveshare app. It refused to start. It connected to wifi but then did nothing (no display). It doesn't talk to HomeAssistant i.e. port 6053 is not responding. OTA updates still work though.
WARNING Can't connect to ESPHome API for gridish @ 192.168.46.226: Error connecting to [AddrInfo(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=6, sockaddr=IPv4Sockaddr(address='192.168.46.226', port=6053))]: [Errno 111] Connect call failed ('192.168.46.226', 6053) (SocketAPIError)
INFO Trying to connect to gridish @ 192.168.46.226 in the background
When I reverted to 2024.10.3 and recompiled it sprung back to life.
My other espHome devices recompiled OK so I'm suspecting an esp32s3 issue. Any suggestions.
Curious if you folks have figured out the ch422g component yet. I have a use case where I want this display to serve as a wall mounted thermostat. Thusly, I will need to include a temperature sensor and some relays to trigger HVAC actions.
Do you happen to know if this possible using this I/O expander and if so, how do you wire up sensors to the bus?
Thank you so much for this! Do you know if this setup works with https://www.waveshare.com/wiki/ESP32-S3-Touch-LCD-4B ?
Any help would be much appreciated!
Just for info, I have been trying to use an ESP32-S3-Touch-LCD-4.3B in my system (not with home assistant) and I have found an issue at least with my system. I have an ESP32-S3-Touch-LCD-4.3B powered from a 12V DC supply and with a SHT31 I2C module attached to read temperature and humidity. I have found that the touch controller locks up after a while and have, so far, diagnosed this to the ch422g IO expander reacting to the touch controllers I2C reads during its polling. This ends up with the display going blank and lots of touch errors reported on its USB serial interface. It looks like the ch422g is prone to I2C glitches which are made worse with the 12V power and external I2C device attached. Maybe some 47pF caps on the SLC/SDA linesto GND (ESP32 side of M1 - NDC7002N) might help (yet to try) ?
I gave up using touch because of this problem. It would be good if you can find a solution.
@nottledim Looks like there was a breaking change for the ch422g module in espHome 2024.10.0
esphome/esphome#7467
the address is used in a non-standard way for the ch422 so this is correct. i will look into how to make this work.
if you're getting the touchscreen issue, you might try the touchscreen address 0x14 - but that's a temporary workaround at best.