Skip to content

XL9535 I/O Expander

The XL9535 component allows you to use XL9535 I/O expander in ESPHome. It uses I²C Bus for communication.

Once configured, you can use any of the 16 available pins for your projects. Within ESPHome they emulate a real internal GPIO pin and can therefore be used with many of ESPHome’s components such as the GPIO Binary Sensor or GPIO Switch.

NOTE

This I/O Expander chip is used in the Lilygo T-RGB 2.1” Round Display

# Example configuration entry
xl9535:
- id: xl9535_hub
address: 0x20
# Individual outputs
switch:
- platform: gpio
name: XL9535 Pin 0
pin:
xl9535: xl9535_hub
number: 0
mode:
output: true
inverted: false
  • id (Required, ID): The id to use for this xl9535 component.
  • address (Optional, int): The I²C address of the driver. Defaults to 0x20.
  • xl9535 (Required, ID): The id of the xl9535 component of the pin.

  • number (Required, int): The pin number. Valid numbers are 0-7 and 10-17.

  • inverted (Optional, boolean): If all read and written values should be treated as inverted. Defaults to false.

  • mode (Optional, string): A pin mode to set for the pin at. One of INPUT or OUTPUT.