CH422G I/O Expander

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

Once configured, you can use any of the 8 available GPIO pins for your projects. Within ESPHome they can be used in place of internal GPIO pins in many of ESPHome’s components such as the GPIO Binary Sensor or GPIO Switch. They are not usable for PWM or other situations requiring an internal GPIO pin.

Note

This I/O Expander chip is used in the Waveshare ESP32-S3-Touch-LCD-4.3

# Example configuration entry
ch422g:
  - id: ch422g_hub
    address: 0x24

# Individual outputs
switch:
  - platform: gpio
    name: CH422G Pin 0
    pin:
      ch422g: ch422g_hub
      number: 0
      mode:
        output: true
      inverted: false

Configuration variables:

  • id (Required, ID): The id to use for this ch422g component.

  • address (Optional, int): The I²C address of the driver. Defaults to 0x24.

  • restore_value (Optional, boolean): Writes default flags on setup, overriding values from chips cache. Defaults to false.

Pin configuration variables:

  • ch422g (Required, ID): The id of the ch422g component of the pin.

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

  • 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 the pin at. One of INPUT or OUTPUT.

See Also