PI4IOE5V6408 8-Bit I2C I/O Expander
The PI4IOE5V6408 component allows you to use the Diodes Incorporated PI4IOE5V6408 8-bit I2C I/O expander in ESPHome using the I²C Bus for communication.
The PI4IOE5V6408 is a low-voltage 8-bit I/O port expander that operates at 1.65V to 5.5V. It provides general-purpose remote I/O expansion for most microcontroller families via the I2C interface. The device supports both pull-up and pull-down resistors on all I/O pins, and includes interrupt capability for input changes.
Once configured, you can use any of the 8 pins (0-7) within 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.
# Example configuration entry
pi4ioe5v6408:
- id: 'pi4ioe_hub'
# Individual outputs
switch:
- platform: gpio
name: "PI4IOE5V6408 Pin 0"
pin:
pi4ioe5v6408: pi4ioe_hub
number: 0
# Individual inputs
binary_sensor:
- platform: gpio
name: "PI4IOE5V6408 Pin 1"
pin:
pi4ioe5v6408: pi4ioe_hub
number: 1Configuration variables
- id (Required, ID): The id to use for this
pi4ioe5v6408component. - address (Optional, int): The I²C address of the device. Defaults to
0x43. - reset (Optional, boolean): Whether to reset the device state during setup. When
true(default), all pins are configured as inputs with high impedance during setup. Whenfalse, the component will read the current state from the device registers. Defaults totrue.
Pin configuration variables
pi4ioe5v6408 (Required, ID): The id of the
pi4ioe5v6408component of the pin.number (Required, int): The pin number. Valid range is 0-7.
inverted (Optional, boolean): If all read and written values should be treated as inverted. Defaults to
false.mode (Optional, Pin Mode): A pin mode to set for the pin. One of:
INPUT- Configure the pin as an input.OUTPUT- Configure the pin as an output.PULLUP- Enable internal pull-up resistor (input mode only).PULLDOWN- Enable internal pull-down resistor (input mode only).
Examples
GPIO Switch Example
switch:
- platform: gpio
name: "Relay 1"
pin:
pi4ioe5v6408: pi4ioe_hub
number: 0
mode:
output: trueGPIO Binary Sensor Example
binary_sensor:
- platform: gpio
name: "Button 1"
pin:
pi4ioe5v6408: pi4ioe_hub
number: 1
mode:
input: true
pullup: trueGPIO Output with Inverted Logic
switch:
- platform: gpio
name: "LED Strip"
pin:
pi4ioe5v6408: pi4ioe_hub
number: 2
mode:
output: true
inverted: true