Open regystro opened 6 months ago
Hello @regystro , could you do me a favor and hook the interrupt pin to a bineary_sensor
and check what the response is in the log or in HA? And report back with the patron you are seeing when you press the display and move it around and lift it up again.
Hi @nielsnl68 . I just tested adding this:
binary_sensor:
- platform: touchscreen
name: Top Left Touch Button
x_min: 0
x_max: 100
y_min: 0
y_max: 100
on_press:
- lambda: |-
ESP_LOGI("binary_sensor", "press");
on_release:
- lambda: |-
ESP_LOGI("binary_sensor", "release");
on_state:
- lambda: |-
ESP_LOGI("binary_sensor", "state");
on_click:
- lambda: |-
ESP_LOGI("binary_sensor", "click");
on_double_click:
- lambda: |-
ESP_LOGI("binary_sensor", "double_click");
Using interrupt_pin: GPIO21
, nothing is detected.
Disabling interrupt_pin
and changing update_interval: 50ms
(= polling) detects and logs all possible states.
I encountered the same problem.
The problem
When using
interrupt_pin
with a CST820 sensor , the touches do not triggeron_touch
action.Polling works as expected (removing
interrupt_pin
, and settingupdate_interval: 50ms
as suggested by the documentation)Which version of ESPHome has the issue?
2024.4.0
What type of installation are you using?
pip
Which version of Home Assistant has the issue?
No response
What platform are you using?
ESP32
Board
esp32dev
Component causing the issue
cst816 Touch Screen Controller
Example YAML snippet
Anything in the logs that might be useful for us?
No response
Additional information
The board is an ESP32-2432S024C (2.4'' display with CST820 capacitive touchscreen). The display is an ILI9341. The board is detected by ESPHome like this:
The interrupt pin is GPIO21. Platformio definitions: https://github.com/rzeldent/platformio-espressif32-sunton/blob/main/esp32-2432S024C.json
I'm forcing
update_interval: never
because even when the documentation says it should default to never,esphome config
shows a value of 50ms when interrupt_pin is set. Also if not set to never, the logs suggest you to:[W][touchscreen:032]: Touch Polling Stopped. You can safely remove the 'update_interval:' variable from the YAML file.