touchscreen component holds the base code for most touchscreen components
available in ESPHome and is responsible for passing the touch events to
binary_sensors with the
Base Touchscreen Configuration¶
# Example touchscreen touchscreen: - platform: ... on_touch: then: ...
This automation will be triggered when the touchscreen detects a touch.
This trigger provides one arguments of type touchscreen::TouchPoint which has two integer members:
represent the position of the touch in relation to the display width and height. It also has optional members that will be set
depending on the touchscreen platform.
touchscreen binary sensor allows you to setup areas on the touch screen as virtual
binary_sensor: - platform: touchscreen name: Top Left Touch Button x_min: 0 x_max: 100 y_min: 0 y_max: 100 page_id: home_page_id
name (Optional, string): The name for the binary sensor.
id (Optional, ID): Manually specify the ID used for code generation.
touchscreen_id (Optional, ID): Manually specify the ID of the touchscreen.
x_min (Required, int): Left coordinate of the screen area to be detected as the virtual button.
x_max (Required, int): Right coordinate of the screen area to be detected as the virtual button.
y_min (Required, int): Top coordinate of the screen area to be detected as the virtual button.
y_max (Required, int): Bottom coordinate of the screen area to be detected as the virtual button.
page_id (Optional, ID): Only trigger this binary sensor if the display is showing this page.
All other options from Binary Sensor.