LVGL Binary Sensor
The lvgl binary sensor platform creates a binary sensor from an LVGL widget
and requires LVGL to be configured.
Any widget that supports the pressed or checked state can be used; in particular, button, buttonmatrix, checkbox and switch. A single binary sensor supports only a single widget; in other words, it’s not possible to have multiple widgets associated with a single ESPHome binary sensor component.
Configuration variables
Section titled “Configuration variables”- widget (Required): The ID of a supported widget configured in LVGL, which will reflect the state of the binary sensor.
- state (Optional, string): Which widget state to report. One of:
PRESSED(default): The binary sensor isonwhile the widget is being pressed (momentary).CHECKED: The binary sensor reflects thechecked(toggled) state of the widget. This is useful forcheckablebuttons,checkboxandswitchwidgets, where the binary sensor follows the toggle state and updates whenever it changes (either by user interaction or programmatically throughlvgl.widget.update).
- All other variables from Binary Sensor.
Examples:
# Momentary push button - reports pressed statebinary_sensor: - platform: lvgl widget: btn_id name: LVGL push button
# Toggle/checkable widget - reports checked state - platform: lvgl widget: switch_id state: CHECKED name: LVGL switch state